cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Boag/CAM/Lotus" <Scott_B...@lotus.com>
Subject RE: XSLT API Proposal
Date Fri, 04 Feb 2000 14:03:35 GMT

Kay Michael <Michael.Kay@icl.com> wrote:
> I was just looking again to see how you'd handle Embedded Stylesheets
and/or
the xml-stylesheet PI.

Ah.  You're right about that.  Now that you said it, that is a big problem
with only having process(...) on the Transform object.

> In fact rather than having setParser() on XSLTProcessor, why not have it
on
XSLTInputSource?

I like this.  It simplifies things also, and makes general sense.

> XSLTSourceDocument source = new XSLTSourceDocument(new
> XSLTInputSource(xxx));
> XSLTInputSource stylesheet = source.getAssociatedStylesheet();
> XSLTProcessor style = new XSLTProcessor(stylesheet);
> XSLTTransform transform = style.createTransform();
> transform.setParameter(name, value);
> transform.process(source);
>
> But this isn't quite right yet because both XSLTSourceDocument and
> XSLTProcessor need to be interfaces rather than implementations.

Right, and it seems a bit complicated.  I like the notion of a
XSLTSourceDocument. How about:

XSLTProcessor processor = new VendorProcessor();
XSLTSourceDocument source
   = processor.getSourceDocument(new XSLTInputSource(xxx));
Transform transform = source.getAssociatedStylesheet();
processor.setParameter(name, value);
transform.process(processor, source,
     new XSLTResultTarget(xxx));

comments?

> I'd be quite inclined as well to make XSLTInputSource a DocumentHandler
> rather than XSLTProcessor and Transform: it seems logical to have all the
> different ways of getting input in one place.   Only problem is that it's
an
> implementation rather than an interface, but I expect there is some way
> around that, e.g. make it abstract.

Besides the problem you name with it needing to be an implementation (I
don't think the abstract class helps a lot), I see XSLTInputSource as a
simple data-holding class.  It doesn't make sense to me to make it a full
event handler.  Why is DocumentHandler on XSLTProcessor and Transform so
bad?

-scott





Mime
View raw message