How can I use the xsl:when to test a compound condition?
Until now, all my conditions were simple ones, so I had no trouble using the xsl:choose and xsl:when element.
For example,
Code:
<xsl:choose>
<xsl:when test="@item = 'fruit'">
… DO SOMETHING
</xsl:when>
<xsl:otherwise>
… DO SOMETHING ELSE
</xsl:otherwise>
</xsl:choose>
But now I want to test a compound condition.
For example,
If attribute ‘item’ equals fruit, and attribute ‘item-num’ is greater than 1, then do something. Otherwise, do something else.
How do I do that?
Re: How can I use the xsl:when to test a compound condition?
You just have to use more operators : @item = 'fruit' and @item-num > 1