Parsing large XML files (C#)

Parsing large XML files (C#)

Post by Doug Baxt » Sat, 21 Dec 2002 02:12:48



Need to be able to deal with big XML files by dividing them into "bite
size" chunks. Eg, input file 20mb size, divide into 4mb chunks.

Anyone got any ideas as to the best way to
1. figure out how big an XML file is
2. divide into chunks of a pre-determined size

Any solution/ideas much appreciated, espec C#
Thanks!

 
 
 

Parsing large XML files (C#)

Post by bruce barke » Sat, 21 Dec 2002 03:11:51


there is no handy way to chop up an xml file, but 20mb is too large for a
dom load. use the XMLReader, as its a forward only one pass reader of the
xml file (simular to a saxreader).

hint: if your node names are not unique, maintain a stack of where you are
in the tree.

-- bruce (sqlwork.com)


Quote:> Need to be able to deal with big XML files by dividing them into "bite
> size" chunks. Eg, input file 20mb size, divide into 4mb chunks.

> Anyone got any ideas as to the best way to
> 1. figure out how big an XML file is
> 2. divide into chunks of a pre-determined size

> Any solution/ideas much appreciated, espec C#
> Thanks!