I need to read potentially large (~300mb) XML files, and edit some of the nodes. Basically I need to:
What's the best way to approach this in C#? Which XML classes should I use to find and edit the nodes I need to change?
TIA
XmlReader is one of the fastest ways of reading in an XML file. It is forward-only, and read-only. The derived XmlTextReader is generally the class you would reach for. Bear in mind that the speed improvement is only appreciable for very, very large XML files.
XML files can be opened in a browser like IE or Chrome, with any text editor like Notepad or MS-Word. Even Excel can be used to open XML files.
4 Answers. Show activity on this post. The fastest parser will be SAX -- it doesn't have to create a dom, and it can be done with partial xml, or progressively. Info on the PHP SAX parser (Expat) can be found here.
Well parsing XML is not an easy task. Its basic structure is a tree with any node in tree capable of holding a container which consists of an array of more trees.
VTD-XML is the only XML parsing lib that supports a feature called incremental update. It is also memory efficient and performant. But it requires you to download it as a third party lib.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With