Seeking in a huge xml file?

Y

Yexiong Feng

Hello all,

The problem I am trying to solve is that, given a huge xml file (say, 2 GB),
I wan to seek to a random position, and then starting reading the content
from the closest 2nd level node after the seek position.

Anyone knows how to do this?

Thanks!
Feng
 
M

Martin Honnen

Yexiong said:
The problem I am trying to solve is that, given a huge xml file (say, 2 GB),
I wan to seek to a random position, and then starting reading the content
from the closest 2nd level node after the seek position.

Anyone knows how to do this?

Use XmlReader. Once you have found a node you can then perhaps do
ReadSubtree() to pass a reader focussed on that node to higher level
APIs like XmlDocument or XPathDocument or XDocument (in .NET 3.5).
 
H

Hillbilly

Generaly speaking, how long does it take to parse an 2GB XML file on te file
system compared to getting data out of a table in 2GB SQL Server database?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top