cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kay Michael <>
Subject RE: SAT API Proposal (Draft 3) (was XSLT API)
Date Thu, 10 Feb 2000 12:55:35 GMT
SAX2 / ContentHandlers etc

It would be useful to add an example that uses StylesheetHandler; I can't
quite see how it's supposed to work. And if this is for feeding the
Stylesheet as a SAX event stream, what is the equivalent for source

I'm confused by your chaining example,
    transform1.parse(new InputSource("foo.xml"));

x.setParent(y) means that x takes its input from y; this is a pull model; so
my first instinct (assuming you want the sequence to be 1, 2, 3) is to
reverse it to:

    transform3.parse(new InputSource("foo.xml"));

But this seems strange, and is especially strange if the first thing in the
pipeline is not a real parser, but an application trying to supply SAX
events. It also doesn't extend to multiple outputs from a stylesheet. We
really want a "push" pipeline, whereas XMLFilter gives us a "pull" model.
Since we're doing a "push" into the serializer, perhaps we should use the
same mechanism to push events from one transformation into the next, and
from the user's application into the first transformation:


That then raises the question about whether a ContentHandler is good enough,
what about events like comments that a ContentHandler doesn't handle? My
view would be to define a SATEventHandler interface that extends
ContentHandler, DTDHandler, and LexicalHandler, and to define SATFilter
modeled on XMLFilter but (a) extending SATEventHandler instead of the native
SAX2 handler interfaces, and (b) working on a push model rather than pull.

Finally, the remark about multiple outputs raises the question as to whether
setContentHandler() really belongs on Transformation at all. We already have
it on Result, which seems a more natural place: presumably there will be one
Result for each output tree, once multiple outputs are in the XSLT spec.

Mike Kay

View raw message