helper classes for SAX

Michael Kay M.H.Kay at eng.icl.co.uk
Wed Feb 25 11:36:23 GMT 1998


>"Should we add helper classes to SAX?"
>
I have written a package on top of SAX which I hope to publish soon - I need
to get it past some corporate processes


I wrote it because I found I was doing the same thing repeatedly in a number
of SAX applications. I call the package SAXON (sorry), and it provides the
following services:

- allows you to register a handler for a particular element type (or a
particular element type in the context of a parent element type). The
handler can supply methods to process the element start or end, the
character data or ignorable white space in the element, or the start or end
of a consecutive group of one or more elements (cf. XSL)
- provides you with context information about the element; in particular,
its parent and ancestors, their attributes, and also their elder sibling
elements.
- allows you to associate user data with an element, so for example your
start-element method can pass data to the corresponding end-element method
- allows you to associate an output "bucket" with an element type, so that
all output for that element and its children (unless otherwise specified)
goes into that bucket. Useful for splitting documents and for limited
re-ordering of elements
- allows multiple handlers per element type
- includes some standard element handlers for doing HTML rendition, for
generating automatic numbering, etc

Although I'm not in a position to go public with it yet, I'll be happy to
share the current state of development with any individual who wants to
collaborate.

I do realise of course that some of these facilities can be achieved by
using the DOM instead of an event-based parser, and there is a world of
stuff in JUMBO that I haven't expored yet. I was trying to add value to SAX
without going heavyweight, which of course is a delicate line to tread.

Regards, Mike Kay
ICL




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/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe 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