|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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 |
|
#2
|
|||
|
|||
|
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)
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XSLT problem: numeric comparison |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|