RosettaCodeData/Task/Conditional-structures/XSLT/conditional-structures-2.xslt

18 lines
515 B
HTML
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
<xsl:choose>
<xsl:when test="condition1">
2013-10-27 22:24:23 +00:00
<!-- included if condition1 evaluates to true (like C `if`) -->
2013-04-10 22:43:41 -07:00
</xsl:when>
<xsl:when test="condition2">
2013-10-27 22:24:23 +00:00
<!-- included if all previous conditions evaluated to false and
condition2 evaluates to true (like C `else if`) -->
2013-04-10 22:43:41 -07:00
</xsl:when>
2013-10-27 22:24:23 +00:00
<--
...
-->
2013-04-10 22:43:41 -07:00
<xsl:otherwise>
2013-10-27 22:24:23 +00:00
<!-- included if all previous conditions evaluated to false
(like C `else`) -->
<!-- (The `otherwise` element is optional) -->
2013-04-10 22:43:41 -07:00
</xsl:otherwise>
</xsl:choose>