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

Re: what are node set fragments and why are they ruining my

Subject: Re: what are node set fragments and why are they ruining my life?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 14 Dec 1999 10:27:35 GMT
what are fragments
node set fragments don't exist, which may account for your confusion.

There are two related datatypes

node sets, and result tree fragments.

> "not being well-formed",
A result tree fragment need not have a root element, so it is not a well
formed document (it could be linearised to a XML external parsed entity)

> Cannot convert value [** RESULT TREE FRAGMENT **] to
> a node-set

See, node sets are not the same thing as result tree fragments.


A node set is what you get back from a select expression
so select="aaa[@xxx]|aaa[bbb]"

gives you the set of all elements with name aaa and either a
xxx attribute or a bbb child. Note this is a set not a list
if some aaa element has both xxx attribute and bbb child, you only get
it once. The set is however ordered (in document order, normally)


A node set is what you can apply templates to

<xsl:apply-templates select="aaa[@xxx]|aaa[bbb]"/>

ie it's the relevant part of the input document (or some secondary input
document via the docyument() function)

a result tree fragment is what you produce in a template.
You can save it in a variable and while it has similar structure to a
node set (it's a bunch of XML nodes) it is essentially opaque to xsl you
can not apply templates to it or interrogate its structure.
The only thing you can do is use xsl:copy-of to put the value of the
variable holding the result tree fragment into the result tree at some
point. 

xt saxon (at least) have an extension function that converts result tree
fragments to node sets.

>     <xsl:for-each select="$members">
members holds the result tree fragment, so you can't select into it.

You could use
    <xsl:for-each select="xt:node-set($members)">

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.