XML parsing memory overhead concerns

James Clark jjc at jclark.com
Fri Dec 17 06:21:51 GMT 1999

"Clark C. Evans" wrote:
> On Fri, 17 Dec 1999, James Clark wrote:
> > Paul Miller wrote:
> >
> > > The only way I could have done that
> > > and keep the sub-element parsing model that I want is to have expat
> > > parse entire document into one big internal memory buffer.
> >
> > How so?  You can layer a next event style interface on top of expat by
> > maintaining a queue of events.  A request for the next event returns the
> > head of the queue; if the queue is empty, it fills the queue by reading
> > another chunk of input and passing it to XML_Parse() with event handlers
> > that append to the queue of events.
> James,
> This would require a multi-threaded approach,
> is this correct?

No. Unlike most parsers, expat has a "push" input model: instead of the
parser making calls to get each block of input bytes, the application
calls the parser passing it each block in sequence whenever it is
convenient for the application.


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)

More information about the Xml-dev mailing list