Re: XML Parse into Structure
Aleix Conchillo FlaquƩ <[email protected]> Fri, 4 Jun 2010 22:19:31 +0200
| Newsgroups | gmane.text.xml.expat.general |
|---|---|
| Message-ID | <[email protected]> |
You can use SCEW (Simple C Expat Wrapper). I think it does what you need, and it also allows you to create in-memory XML trees and dump them to files/memory/... http://www.nongnu.org/scew/ On Fri, Jun 4, 2010 at 20:13, Nick MacDonald <[email protected]> wrote: > Vijay: > > If you want an "in memory" representation of your XML file, you > probably don't want or need to use a SAX based parser like eXpat which > is event based. You'd probably rather find a DOM based parser which > is expressly designed to build a Document Object Model (the DOM in the > name) in memory. You could of course layer a DOM module on top of > eXpat, but I suspect that's a fair amount of work that has already > been done many times before, if you do some searching on Source Force > and other open source repositories I'm sure you'll find a lot of > examples. The whole idea to use SAX is to be able to process a > document with minimal memory overhead... and thus to be able to handle > exceptionally large documents that would use too much memory if they > were loaded into memory all at once. (And SAX would be faster if you > were just searching quickly inside a document... no overhead loading > into memory that parts you'd never use.) > > Good luck, > Nick > >