[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: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 18 Jun 2003 19:08:06 +0100
cannot use result tree fragment
When people write

<xsl:variable name="x">
  <xsl:value-of select="ABCD"/>
</xsl:variable>

they nearly always should be writing

<xsl:variable name="x" select="ABCD"/>

Sometimes the only effect of doing it the first way is that it runs
slower. Sometimes the effect is that it doesn't work at all.

You have copied the string value of the document into a text node. The
elements have disappeared, so even if XSLT 1.0 didn't have restrictions
on using result tree fragments, your path expression would find nothing.

Michael Kay



> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of abbouh
> Sent: 18 June 2003 17:29
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Cannot use result tree fragment
> 
> 
> 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">
> 
> why , and any other suggestion
> Thanks
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 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.