Reading large XML documents in .net

前端 未结 3 567
清歌不尽
清歌不尽 2020-11-30 09:07

I need to read large xml using .net files which can easily be several GB of size.

I tried to use XDocument, but it just throws an System.OutOfMemoryException when I

3条回答
  •  星月不相逢
    2020-11-30 09:59

    The following page makes an interesting read, providing a means to mine data from XML file without loading it in memory. It allows you to combine the speed of XmlReader with the flexibility of Linq:

    http://msdn.microsoft.com/en-us/library/bb387035.aspx

    And quite an interesting article based on this technique:

    http://blogs.msdn.com/b/xmlteam/archive/2007/03/24/streaming-with-linq-to-xml-part-2.aspx

提交回复
热议问题