[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Result Tree Fragments & Variables

Subject: Re: Result Tree Fragments & Variables
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sat, 1 Apr 2000 17:33:13 GMT
decisive tree
> <!-- this is why I thought variables could be bound to node-sets -->

they can,
<xsl:variable name="x" select="/xxx/yyy"/>
binds x to the node set of nodes rom the input document that are
selected by that xpath expression. But note this is an empty
xsl:variable using the select attribute.


> <!-- But aren't "permitted operations" standard, unless one means by
> standard most currently in use by stylesheet writers? -->

they are standard on node sets.
But you can't use any node set operations on result tree fragments
except
copying the whole thing to the result (or another result tree fragment)
or
converting it to a string by just taking all the character data.

In otherwords you can not query into or deconstruct the tree in any way,
you can just use it as an opaque lump of stuff.

> 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. -->

yes exactly. I described it as having content or being empty, but
equivalently you could say having or not having the select attribute.
if xsl:variable is empty you have to have a select attribute (except for
the degenerate case of an empty rtf) if it is non empty you must not have it.



> Is it the case that
> 	<xsl:variable select="*"/>
> will bind the variable to a node set?

yes it will but it is essentially a subset of the input tree.

what you can't do is bind a variable to a constructed node set (such as
the result of an xsl:sort) because in order to make the construction
you have to place the stuff in the body of an xsl:variable, then
what you get back isn't a node set its an rtf (see my example in earlier
post). 

David


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.