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

Re: Node vs TreeFragment

Subject: Re: Node vs TreeFragment
From: Mike Brown <mike@xxxxxxxx>
Date: Fri, 8 Jun 2001 14:07:57 -0600 (MDT)
xslt treefragment
> > > <xsl:variable name="theData" select="someParent/someNode[@a='aKey' and
> > > @b='bKey' and @c='cKey']/data" />
>
> On another note ... I'm trying to get at the node/treefragment that
> would be represented by "data" above.  FOP balks, saying that I can't
> convert a treefragment into a nodelist.

That's correct, you can't look inside a result tree fragment. XSLT 1.1
will eliminate the distinction, but in XSLT 1.0 you have to use an
extension function to convert a result tree fragment to a node-set.
Fortunately, vendors supply a foo:node-set() function with their XSLT
processors. The namespace and typical prefix for the "foo" is dependent on
the processor; check the docs for the one you are using.

However in your case, you have not created a result tree fragment with the 
code above. You have only identified a node-set. It should not cause any 
problems as-is. I suspect you are actually trying to do something like

<xsl:variable name="copiedData">
  <xsl:copy-of select="$theData">
</xsl:variable>
<xsl:value-of select="$copiedData/path/to/some/descendant/of/data"/>

when you should just be doing

<xsl:value-of select="$theData/path/to/some/descendant/of/data"/>


 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.