Read past large XML nodes (800 MB)

  • Thread starter Thread starter Kim Rasmussen
  • Start date Start date
K

Kim Rasmussen

Hello there,

Anybody out there who can show me how to read a large xml-file without
getting Out of Memory exception?

I am currently using xmlTextReader but when the reader gets to an element
which contains about 200-800 MB of data the program exits with an exception.

I would like to read the elment tag but not the element's data - if the
element is not the elements I'm looking for I would like to jump to the next
startElement. That sounds a lot like the functionality of
reader.startElement - but the program still exits with Out of Memory
exception.


Thanks in advance,
Kim
 
Anybody out there who can show me how to read a large xml-file without
getting Out of Memory exception?

I am currently using xmlTextReader but when the reader gets to an element
which contains about 200-800 MB of data the program exits with an
exception.

Wow... It may not be much help telling you now (if the XML files are just
handed to you) but XML files (implemented as a file system file) were
obviously never meant to be that large. So my answer would be to store the
lump somewhere else and include references to the lump in your XML document.

Martin.
 
Kim,
Try using XPathDocument xpd=new XPathDocument("Bigfile.xml"); XPathNavigator
xpn=xpd.CreateNavigator();
Then use XPathNodeIterator to step through the large file using MoveNext()
method.

Thanks,
Fakher Halim
 
Back
Top