Boost logo

Boost :

From: Glen Fernandes (glen.fernandes_at_[hidden])
Date: 2019-09-23 16:12:02


On Monday, September 23, 2019, Bjorn Reese wrote:

> As a former developer of one of said XML parsers, we learned the
> proper abstractions the hard way. If you start with a pull parser (what
> Vinnie refers to as an online parser, and what you refer to as
> an iterating parser), such as the XmlTextReader, then all the other
> interfaces flows naturally from that.
>
> Although the pull parser is mainly used as the basic building block
> for the other abstractions, it can also be used directly, e.g. for quick
> scanning of large JSON documents without memory allocation.
>
> A push parser (SAX) can easily be created by calling the pull parser
> in a loop and firing off events.
>
> Serialization is done by incrementally using a pull parser inside a
> serialization input archive, and likewise a a similar interface for
> generating the layout (e.g. XmlTextWriter) can be used for output
> archives.
>
> A tree parser (DOM) is simply a push parser that generates nodes as
> events are fired off.
>

Dominique explained some of the pull (stax) / push (sax) terminology to me
off-list, and I agree. This does appear to be the more appealing underlying
facility.

Glen


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk