A pull wrapper for SAX parsers

The most simple parser implementation follows a push model. Depending on the content of the document and the internal state of the parser, events like "startElement" or "characters" are sent ("pushed") to a document processor. However, from a document processor point of view, the push model causes some problems: In the event handling method, the processor allways needs to perform some recovery in order to determine its own internal processing state before it can do anything with the event.

In contrast, when the parser is "pull"-based, the processor is in control where it asks for the next event. That can be a great advantage since the processing state can be implemented more implicit and natural in local variables etc.

Also, a pull based parser can simply be handed over between different fragment processors.

For that reasons, I have implemented a "pull wrapper" on top of a simple push based SAX parser. The wrapper can be accessed using the "pull" model by the document processor.