August 8th, 2002, 03:59 AM
-
XSLT problem: numeric comparison
Hello,
I got a problem on getting the numeric comparison work in my XSL.
here is my code:
Code:
<xsl:variable name="FirstRec">
<xsl:for-each select="./Results/Result">
<xsl:if test="position() = 1">
<xsl:value-of select="./RecNo"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:if test="$FirstRec > ./RecPerPage">
... do something here ...
</xsl:if>
when $FirstRec is 50, and ./RecPerPage is 10, its work.
but when $FirstRec is 101, and ./RecPerPage is 50, the 'test' "$FirstRec > ./RecPerPage" doesnt work.
Any idea?
Thanks
August 11th, 2002, 07:08 PM
-
Your variable is being evaluated as a string, and "5" is bigger than "1", just like "b" is bigger than "a". Try number($FirstRec) > number(./RecPerPage)