XPath and XNodes vs Xelements, whats better for mapping two large xml documents?
I want to map two fa开发者_开发技巧irly large xml documents, one of them using the NIEM schema. I am most familiar with the System.Xml.Linq (XElement) class but have heard good things about using XPath and XNodes, contained in the System.Xml namespace.
Anyone have any pros and cons on the two in terms of mapping?
I think the main issue (as you have large XML documents) is whether you need write access or not. If you're mapping from one file to a new file you can use an XmlReader
which gives only forward read only access to the xml document but it is really fast.
I would say however that using XPath is less intuitive than XElement
as most programmers are familiar with Linq syntax but not everyone might be familiar with XPath queries.
精彩评论