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

RE: Cannot use result tree fragment

Subject: RE: Cannot use result tree fragment
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Wed, 18 Jun 2003 12:40:57 -0400
cannot use result tree fragment
[abbouh]
> i want to get all "ht"  nodes from different  external documents,so i
> use in my xsl file:
> 
> <xsl:for-each select="//doccontent/chapmod">
> <xsl:variable name="vchapmod" select="current()"/>
> <xsl:variable name="vchapmod1">
> <xsl:value-of
> select="document(concat(string($vchapmod/attribute::docref),'.
> xml'))"/>
> </xsl:variable>
> <xsl:for-each select="$vchapmod1//ht">
> 
> but i get this error :
> Error in Xpath expression,Cannot use result tree fragment
> the error is for <xsl:for-each select="$vchapmod1//ht">
> 

When you tell the stylesheet to create a result, it gets stored as a
"Result Tree Fragment" (RTF).  In xslt 1.0, RFTs cannot be used in place
of nodesets, so you cannot operate on the output.  Some processors have
an extension that does let you use them as if they were regular
nodesets.

When you declare a variable the way you did, the processor creates a RTF
and assigns it to the variable.  That is why you got the error message.

But you could simplify you variable and get the result you expected -

<xsl:variable name="vchapmod1" 
 
select="document(concat(string($vchapmod/attribute::docref),'.xml'))"/>

In this construction, you select a nodeset and assign it to the
variable, so you will be able to use it.

Cheers,

Tom P

 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.