开发者

XPath and XNodes vs Xelements, whats better for mapping two large xml documents?

开发者 https://www.devze.com 2023-04-06 07:22 出处:网络
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 XPat

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消