[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: Future XSLT expansion.


Subject: Re: Future XSLT expansion.
From: "Jon Smirl" <jonsmirl@xxxxxxxxxxxx>
Date: Sun, 19 Mar 2000 12:03:23 -0500

Variables contain result tree fragments. A result tree fragment (the stuff
inside the variable) only allows a subset of the node set operations.  Using
the result tree fragment in <xsl:apply-templates select="$x"> would require
the use of /, //, and [] even if only implicitly and the spec forbids this.

Without this restriction stylesheets couldn't be completely compiled. XSL
would have to have a run-time eval function.

XSLT Section 11.1 is what forbids this, you just didn't quote enough of it
in your earlier mail.

11.1 Result Tree Fragments
Variables introduce an additional data-type into the expression language.
This additional data type is called result tree fragment. A variable may be
bound to a result tree fragment instead of one of the four basic XPath
data-types (string, number, boolean, node-set). A result tree fragment
represents a fragment of the result tree. A result tree fragment is treated
equivalently to a node-set that contains just a single root node. However,
the operations permitted on a result tree fragment are a subset of those
permitted on a node-set. An operation is permitted on a result tree fragment
only if that operation would be permitted on a string (the operation on the
string may involve first converting the string to a number or boolean). In
particular, it is not permitted to use the /, //, and [] operators on result
tree fragments. When a permitted operation is performed on a result tree
fragment, it is performed exactly as it would be on the equivalent node-set.


Jon Smirl
jonsmirl@xxxxxxxxxxxx



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



Current Thread
Keywords