xsl-list
[Top] [All Lists]

RE: Cannot use result tree fragment

2003-06-18 11:08:06
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(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
abbouh
Sent: 18 June 2003 17:29
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] 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



<Prev in Thread] Current Thread [Next in Thread>