This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Integrating SAX filters produced streams with XSLT


Mike Moran <mmoran@netphysic.com> 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 http://www.biglist.com/lists/xsl-list/archives/200107/msg01261.html
for some ideas. Also look at the sources of the URI resolver classes
provided with the various OSS XSL processors, e.g. Saxon.

HTH
J.Pietschmann

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]