Jump to content

Random access to large XML documents


Trekstuff
 Share

Recommended Posts

Hi,I need to have random access to the XML document, selecting children may depend of what parents are and vice versa, need to be able to go from deeper level back to ancestors etc. So naturally XPath (and - I am using .NET - XPathDocument and XPathNavigator) are the tools of choice. The problem is - how to deal with large files? Entire document has to be loaded in memory and for files over 50Mb "out of memory" error is guaranteed.Any idea how to have random access to large XML documents?Thanks,Yuriy.

Link to comment
Share on other sites

You'll either have to keep your files small or use a streaming based API which will react on XML nodes as a series of events.Such processors don't keep the whole tree in memory, but only the node(s) they are currently processing. Navigating in the tree with such APIs though is to put it mildly - hard. As for something random, that has always been the job of other functions in the environment to provide. And how exactly is the API going to let you use the generated number is another question.And the final question of course - which API to use. I haven't used .NET so I can't really say for sure, but I think xmlReader is it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...