It's also possible to use .NET to parse an XML document into a .NET object that represents it (presuming you create a .NET class of a matching structure) using XmlSerializer ([link:msdn2.microsoft.com]). XmlSerializer is itself very C#-ish, so I'd have to think more about a natural way to do this in F#, but it is a quick and easy way to decompose XML into an AST (albeit a sort of weird one, if you're used to the OCaml/F# approach you showed).

Just a thought. :)

By on 9/28/2007 10:48 AM ()

You might like to consider using active patterns to dissect XML documents. This provides the benefits of F#'s powerful pattern matching facilities applied directly to the DOM tree, i.e. without having to copy the data.

This technique was described in one of the earlier F#.NET Journal articles.

By on 9/25/2007 8:48 PM ()

Could you maybe provide a small example demonstrating how the code would look like? Would the whole approach in your opinion be easier, terser or more efficient than the code posted above?

By on 9/26/2007 3:57 AM ()
By on 9/26/2007 5:29 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper