cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Parker" <>
Subject Re: SAX Event cacheing & Generators
Date Fri, 05 May 2000 02:38:29 GMT

----- Original Message -----
From: Williams, Murray Todd <>
To: <>
Sent: Friday, May 05, 2000 12:11 AM
Subject: RE: SAX Event cacheing & Generators

> I must confess I'm just now starting to play directly with the DOM and SAX
> APIs, so I'm not perfectly clear on how the "instance callbacks" and
> callbacks" system is implemented.  Does a different customized class have
> be created for each document DTD that you wish to serialize, or is it
> possible to write a generic utility class that would serialize and
> deserialize from SAX to a binary stream?

You need to look at the SAX Handler interface docs. These specify an
which is a 'contract' between your client class and the parser. The parser
responsible for notifying your client class (via callbacks) with calls such
start document, end document, start element, end element etc. The arguments
to these methods contain the document specific details - eg the element name
Hence the interface API's are very generic.... Thus you can build a custom
handler class
which will work for any document.

AFAIK the SAX Handler api only supports instance method callbacks - ie this
what interfaces are all about. Now the parser doesn't know or care what you
do inside
your callback methods. Hence I had a parser client which built my list of
static calls. Because
I built the client class, I can do anything I want :-) Once I have my list
of *my own callbacks*,
I can replay, splice, merge it at will.


View raw message