|
-
January 16th, 2009, 06:55 AM
#1
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?
-
January 17th, 2009, 03:42 PM
#2
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|