RE: Simple API for XSL?

Subject: RE: Simple API for XSL?
From: Michael.Kay@xxxxxxx
Date: Wed, 17 Feb 1999 16:38:46 -0000
> -----Original Message-----
> From: Tim McCune [mailto:timm@xxxxxxxxxxxxxxxx]
> I went ahead and wrote an interface that lets us switch XSL 
> processors by changing one line of code.  The interface is pretty simple
so far:
> public String process(Document xml, String stylesheetName) throws
> XSLProcessorImplException;
Well it looks simple but it raises several questions:
- There are XSL processors such as xt that do not take a Document as input.
Perhaps we should allow something like the SAX InputSource. Or extend
InputSource so that as well as allowing a URL, a character stream, or a byte
stream, it also allows a File, or a Document...
- What is the String containing the stylesheetName? A URL? If so, why not
specify it as a URL? Or, again, as a general InputSource? In fact, supplying
a Document here is more useful than for the source XML file, since a likely
scenario is to process lots of source documents using the same stylesheet,
in which case you only want to parser the stylesheet once.
- What is the output? XSL generates a tree, not a String. Should it be a
Document? If we work on the assumption that the output tree will always be
flattened to an XML character stream, supplying a Writer as a third
parameter would be more flexible than getting a String as the result.

Mike Kay

 XSL-List info and archive:

Current Thread