Ah yes, the trouble with using "copy-of" is that it may result in a "tree fragment", (which means there *might* be multiple root nodes), this causes problems when you come to use it.
So to get around this, you will need a second variable that will call the "msxml:node-set" function. This will make the "tree fragment" into a proper node-set.
Error: To use a result tree fragment in a path expression
Hi,
I have my varialble as
<xsl:variable name="Brandsqlresult" >
<xsl:choose>
<xsl:when test="$SqlSession=''">
<xsl:copy-of select="jesper.sql:SQLXml($GetBrandPagewise)"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="SqlSessionStage"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose >
the variable BrandSqlresult will contain SQl result set. When i loop through the Brandsqlresult using foreach loop something like
<xsl:for-each select="$Brandsqlresult//.">
</xsl:for-each>
its shows error: To use a result tree fragment in a path expression, first convert it to a node-set using the msxsl:node-set() function.
but same for-each loop works fine if i have my variable declaration as
<xsl:variable name="Brandsqlresult" select="jesper.sql:SQLXml($GetBrandPagewise)"/>
what makes a mistake?
Hi Selvakumar,
Ah yes, the trouble with using "copy-of" is that it may result in a "tree fragment", (which means there *might* be multiple root nodes), this causes problems when you come to use it.
So to get around this, you will need a second variable that will call the "msxml:node-set" function. This will make the "tree fragment" into a proper node-set.
Trust me, I understand any frustrations with this! :-)
Cheers, Lee.
Its nice man...
Thanks so much.
is working on a reply...