|
next
|
Subject: recursion of wurfl document - variable does not populate on second iteration Author: j u Date: 09 Nov 2006 04:56 AM Originally Posted: 09 Nov 2006 04:40 AM
|
Excerpt from http://www.xml.com/pub/a/2002/04/10/xslt2.html :
<snip>
Death To the Result Tree Fragment!
In XSLT 1.0 the result tree fragment (RTF) type is like a node-set, but it is really a second-class citizen. An RTF is what you get whenever you use xsl:variable to construct a temporary tree. The problem is that you can't then use an XPath expression to access the innards of this tree, unless you use a vendor-specific extension function, usually called something like node-set(), to convert the RTF into a first-class node-set (consisting of one root node). The rationale for the RTF data type was that it would reduce implementation burden, but since almost all existing XSLT processors provide their own version of a node-set() extension function anyway, that consideration has become moot. In any case, the need to overcome this limitation has been clear for some time, as it is important to be able to break up complex transformations into sequences of simpler transformations.
If you haven't guessed already, XSLT 2.0 has shown RTFs the door. Now when you use xsl:variable to create a temporary tree, the value of that variable is a true node-set. Actually, in XPath 2.0 terms, it is a true node sequence, consisting of one document node, which is XPath 2.0's name for what XPath 1.0 called a "root node". With that sequence you can then use path expressions to drill down inside the tree, apply templates to it, and so on, just like you would with any other source document. With XSLT 2.0, there is no longer a need for the node-set() extension function.
</snip>
I've tried setting my Stylus Studio default XSLT processor to Saxon 8.7.3 (I'm fairly sure it supports XSLT 2.0 fully) and setting the XSL document to XSLT 2.0.
Will post results shortly.
|
|
|