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

前端 未结 10 2126
自闭症患者
自闭症患者 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:29

    In order to perform XPath queries with the standard .NET classes the whole document tree needs to be loaded in memory which might not be a good idea if it can take up to a gigabyte. IMHO the XmlReader is a nice class for handling such tasks.

提交回复
热议问题