This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Result Tree Fragments & Variables
- To: xsl-list at mulberrytech dot com
- Subject: Result Tree Fragments & Variables
- From: lachance at chass dot utoronto dot ca (Francois Lachance)
- Date: Sat, 1 Apr 2000 08:57:02 -0500 (EST)
- Reply-To: xsl-list at mulberrytech dot com
David,
Striving for a bit more comprehension here by referring to the
recommendation:
XSLT 11.1
A variable may be bound to a result tree fragment instead of one of the
four basice data-types (string, number, boolean, node-set).
<!-- this is why I thought variables could be bound to node-sets -->
XSLT 11.1
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.
<!-- this is rephrased by David -->
> but any use of xsl:variable with non empty content produces a result
tree
> fragment so although this is basically the same as a node set
> containing one node with child zzzz nodes in sorted order,
> you can not access those nodes by any standard means.
XSLT 11.1
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.
<!-- But aren't "permitted operations" standard, unless one means by
standard most currently in use by stylesheet writers? -->
XSLT 11.2
If the variable-binding element does not have a select attribute and has
non-empty content (i.e. the variable-binding element has one or more child
nodes), then the content of the variable-binding element specifies the
value.
<!-- I read here a description of one possible type of binding. I
intrepret this to mean that the absence/presence of the select attribute
is decisive here in determining the data-type which will result from the
binding. -->
XSLT 11.2
The content of the variable-binding element is a template, which is
instantiated to give the value of the variable. The value is a reult tree
fragment equivlat to a node-set containing just a single root node have as
children the sequence of nodes produced by instantantiating the template.
<!-- I take this to mean that other types of binding are possible when the
select attribute is used with the xsl:variable element. A variable may be
bound to a node-set. -->
Is it the case that
<xsl:variable select="*"/>
will bind the variable to a node set?
--
Francois Lachance
Post-doctoral Fellow
projet HYPERLISTES project
http://www.humanities.mcmaster.ca/~hyplist/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list