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

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

    It seems that you already tried using XPathDocument and could not accomodate the parsed xml document in memory.

    If this is the case, before starting to split the file (which is ultimately the right decision!) you may try using the Saxon XSLT/XQuery processor. It has a very efficient in-memory representation of a loaded XML document (the "tinytree" model). In addition Saxon SA (the shema-aware version, which isn't free) has some streaming extensions. Read more about this here.

提交回复
热议问题