How best to use XPath with very large XML files in .NET?

前端 未结 10 2123
自闭症患者
自闭症患者 2020-12-14 10:07

I need to do some processing on fairly large XML files ( large here being potentially upwards of a gigabyte ) in C# including performing some complex xpath queries. The prob

10条回答
  •  星月不相逢
    2020-12-14 10:21

    You've outlined your choices already.

    Either you need to abandon the XPath and use XmlTextReader or you need to break the document up into managable chunks on which you can use XPath.

    If you choose the latter use XPathDocument its readonly restriction allows better used of memory.

提交回复
热议问题