how to exploit the return of template in a variable?
Brought to you by:
ovidiu
From: abbouh <ab...@ra...> - 2003-06-24 09:32:25
|
i use a template for counting the "ht" node,but the problem is when i get the return of template to a variable,i have NaN? this what i use: ........................... <xsl:variable name="nb_ht"> <xsl:call-template name="test1"> <xsl:with-param name="total" select="0"/> <xsl:with-param name="pchapmod" select="//chapmod[4]"/> </xsl:call-template> </xsl:variable> .................................. <xsl:template name="test1"> <xsl:param name="total"/> <xsl:param name="pchapmod" /> <xsl:choose> <xsl:when test="boolean($pchapmod) and name($pchapmod)='chapmod'"> <xsl:variable name="ht_nb" select="count(document(concat(string($pchapmod/attribute::docref),'.xml'))//ht)"/> <xsl:value-of select="$ht_nb"/> <xsl:text> </xsl:text> <xsl:call-template name="test1"> <xsl:with-param name="total" select="$total + $ht_nb"/> <xsl:with-param name="pchapmod" select="$pchapmod/preceding::chapmod[position() = 1]"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$total"/> </xsl:otherwise> </xsl:choose> </xsl:template> |