Hi everybody,
I've a problem that I've reproduced with the following stilesheet:
The following works:
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl
="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates select="catalog"/>
</xsl:template>
<xsl:template match="catalog">
<xsl:variable name="books" select="book"/>
Number of books: <xsl:value-of select="count($books)"/>
</xsl:template>
</xsl:stylesheet>
the following give the error: Can not convert #RTREEFRAG to a NodeList!
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl
="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="parm">book</xsl:variable>
<xsl:template match="/">
<xsl:apply-templates select="catalog"/>
</xsl:template>
<xsl:template match="catalog">
<xsl:variable name="books" select="$parm"/>
Number of books: <xsl:value-of select="count($books)"/>
</xsl:template>
</xsl:stylesheet>
(See attached file: sample.xml)
My real code take parm as parameter, but it gives the same error.
I was expecting that <xsl:variable name="books" select="$parm"/> returned
a nodset that I could pass to the count() function, but I was wrong!!
Any hint?
thanks a lot Maria
sample.xml