RE: Streaming XSL

Subject: RE: Streaming XSL
From: Michael.Kay@xxxxxxx
Date: Wed, 24 Feb 1999 18:17:19 -0000
> BTW, is there a simple syntactic restriction associated with "stream"
> stylesheets, so that the XSL processor could immediately 
> report an invalid
> sheet? Things like never use absolute element path in select 
> patterns, never
> select siblings, that sort of thing?
I have got streaming stylesheets working in SAXON "in the lab" and hope to
publish soon. I haven't worked out the exact list of what works and what
doesn't but here are the main conditions:

- can match on ancestors of the current element, attributes of the current
element and its ancestors, elder siblings of the current element and its
ancestors, but not on child elements. Can use conditions such as
is-first-of-type() but not is-last-of-type(). This applies to the match
condition in templates, and to instructions such as xsl:if and xsl:value-of.

- can use apply-templates with no select parameter. Could potentially also
allow apply-templates with a parameter identifying selected descendant
nodes, (or xsl-for-each) provided we only use it once per template: but I
haven't implemented that.

The stylesheet bible.xsl issued with SAXON 4.01 works in serial mode, so
some quite powerful transformations are possible. Many however require
temporary storage: the technique I use is to store working data as an
attribute of an ancestor element, typically for use when the end tag of the
ancestor is processed. Another useful technique is to generate multiple
output files for merging later.

Some other useful things would be possible if there was a limited lookahead:
for example generating "see next page" hyperlinks on all pages except the

Mike Kay 

 XSL-List info and archive:

Current Thread