What is more efficient for parsing Xml, XPath with XmlDocuments, XSLT or Linq?

后端 未结 4 2076
北海茫月
北海茫月 2021-02-02 09:25

I have parsed XML using both of the following two methods...

  • Parsing the XmlDocument using the object model and XPath queries.
  • XSL/T

But I

4条回答
  •  爱一瞬间的悲伤
    2021-02-02 09:35

    If you want really fast XML processing (reading) you should consider using XmlReader unfortunately implementation is bit hard.

    There is also a way to implement LINQ solution with a combination of XmlReader so you can have the ease of use of LINQ. Also you can get much better performance than XmlDocument/XPath.

    Please refer to following link for more information on this. http://blogs.msdn.com/xmlteam/archive/2007/03/24/streaming-with-linq-to-xml-part-2.aspx

    Also I think if you only work with small XML files using of XmlDocument/XPath won't be a performance issue.

提交回复
热议问题