This article does not apply to Umbraco 8.
The concepts and code in this article have been deprecated in Umbraco 8 and no longer apply.
If you are using Umbraco 7, this article is perfect for you!
Some XSLT Logic
XSLT has some logic commands that are useful to processing criteria based output. These commands are the "if" and "choose" commands.
The "if" command is useful for deciding to show content or not based on a single criteria. There is no "else" in XSLT, so, the if is somewhat limited.
<xsl:if test="@nodeName = 'example' ">
<!-- do this -->
</xsl:if>
The "choose" command is a bit more powerful in that it allows for multiple choices to be selected from.
<xsl:choose>
<xsl:when test="@nodeName = 'example' ">
<!-- do this -->
</xsl:when>
<xsl:otherwise>
<!-- do this -->
</xsl:otherwise>
</xsl:choose>
In this example, you can have as many when statements as you like, but must have the otherwise statement.
This was copied the original book from Casey Neehouse from the books section of umbraco.org