Re: [xsl] Integrating SAX filters produced streams with XSLT

Subject: Re: [xsl] Integrating SAX filters produced streams with XSLT
From: Joerg Pietschmann <joerg.pietschmann@xxxxxx>
Date: Fri, 07 Sep 2001 09:44:58 +0200
Mike Moran <mmoran@xxxxxxxxxxxxx> wrote:
> However, if you are using a stylesheet minimizing technique[1] for
> templating a website, say, which takes at least two input XML documents,
> one via stdin, and the other a result of opening a file using
> document(), then you have the problem that only one of these inputs can
> be a stream. All the other inputs (via document()) have to be saved in
> files prior to input, at least temporarily.

Not necessarily.

> 2. Change the `file' URI that is given to document() so that it resolves
> to a SAX processed stream. I'm not sure how you would do this.

This is the most obvious solution: write a URI resolver and provide
it to the transformer using setURIResolver(). You can also use this
for a TransformerFactory in order to provide xsl:include'd or xsl:import'd
style sheets from a SAX source. Of course, you have to give your sources
an URI. You can either use a file: URLs and some logic to tell real files
from SAX event streams, or you can invent your own URI style using something
like cache: or sax: as protocol.
Look at
for some ideas. Also look at the sources of the URI resolver classes
provided with the various OSS XSL processors, e.g. Saxon.


 XSL-List info and archive:

Current Thread