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

Re: Node-set vs. Result tree fragment

Subject: Re: Node-set vs. Result tree fragment
From: Mike Brown <mike@xxxxxxxx>
Date: Mon, 10 Jul 2000 17:56:56 -0600 (MDT)
node set result tree
Michael J. Hudson wrote:
> What exactly is the difference between a node-set and result tree 
> fragment. 

node-set: non-repeating set of nodes from anywhere in the source tree(s);

result tree fragment: hierarchical branch of nodes created for the result tree

Yout get node-sets from a source tree (which is usually derived from an
XML document), and you tell the XSLT processor to create, in steps (a
fragment at a time, in a nested fashion), a result tree, via the
instructions and literal result elements you put in the stylesheet.
Output, such as an XML or HTML document, may be derived from the result
tree.

> If I have a node-set, will I be able to access the children
> of the nodes in that node-set?

No; not in pure XSLT. This is what the node-set extensions in various
implementations are for, though, as you guessed. These are functions that
supplement the standard XPath & XSLT functions, taking a result tree
fragment argument and returning a node-set. You can use the function call
as the first LocationStep in an expression, like:

<xsl:variable name="aFragment">
  <div style="font-weight: bold">
    <p>hi!</p>
  </div>
</xsl:variable>
<xsl:value-of select="xt:node-set($aFragment)/div/p"/>

These convert-to-node-set functions are generally used for sorting and
grouping operations, although they may not be necessary now that key-based
methods have been devised. (see the FAQ)

   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at         My XML/XSL resources:
webb.net in Denver, Colorado, USA           http://www.skew.org/xml/


 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.