Consider this condition that exists in a template that is called recursively:
<xsl:if test="$i <= $count">
I'm using an XSLT 2.0 processor (Saxon-B 9.1.0.6). The condition seems to work only when running an XSLT 1.0 stylesheet. When the stylesheet version is set to 2.0 (as it should be), it stops working.
Any ideas why?
Here's the whole thing:
<xsl:template name="for.loop">
<xsl:param name="i" />
<xsl:param name="count" />
<xsl:if test="$i <= $count">
...
</xsl:if>
<!-- Repeat the loop by recursion -->
<xsl:if test="$i <= $count">
<xsl:call-template name="for.loop">
<xsl:with-param name="i">
<xsl:value-of select="$i + 1" />
</xsl:with-param>
<xsl:with-param name="count">
<xsl:value-of select="$count" />
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
Thanks.