Boost logo

Boost :

From: Jez Higgins (jez_at_[hidden])
Date: 2005-11-04 04:33:05


Stefan Seefeld wrote:
>
> That's a good question. My initial proposal a couple of years ago had
> a SAX API. However, SAX has a number of shortcomings that make it hard
> or inapropriate to use (e.g., no namespaces !).
>

That's not true. SAX was extended to support namespaces above 5 years
ago - see http://www.saxproject.org/ for the Java interface, or my
Arabica library for a C++ version
http://www.jezuk.co.uk/cgi-bin/view/arabica

> A better API that still follows the cursor-style approach from SAX,
> is the XMLReader. It uses a pull model instead of push, i.e. there
> are no callbacks, but instead the application advances the reader's
> internal cursor to the next 'token'.
> See http://xmlsoft.org/xmlreader.html for a comparison to SAX.

For some definition of better. The unpleasantness with pull APIs is the
token - you have to interrogate it for its actual type, and then
dispatch. In certain circumstances this obviously applies to the DOM
too. In other cases, and I accept that I might be unusual in this, SAX
is the right thing to use.

Jez


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