<xsl:variable name="a">20</xsl:variable>
<xsl:variable name="b">10</xsl:variable>
<xsl:if test="($a) > ($b)">
------
</xsl:if>
I getting error in the if condion..
Also, in XSLT 2.0, you can use the operators "gt" (greater than), "lt" (less than), and "eq" (equal).
The XSLT <xsl:value-of> element is used to extract a value from an expression defined in the select attribute. The expression defined in the mandatory select attribute is either an XPATH expression (for nodes and/or values) or a variable reference. The return of the <xsl:value-of> function is a literal value.
You're always safe using > here, although some XSLT processors process the greater-than sign correctly if you use > instead. If you need to use the less-than operator ( < ), you'll have to use the < entity.
Try the following :
<xsl:if test="$a > $b">
Try using the character entities for > (>) and < (<) operators in expressions, otherwise some parsers think you are closing the tag early, or opening another.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With