Conditionals
xsl:if
<xsl:if test="..."> ... </xsl:if>
Examples
<xsl:for-each select="catalog/cd">
<xsl:if test=".[artist='Bob Dylan']">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>
</xsl:if>
</xsl:for-each>
xsl:choose xsl:when...xsl:otherwise
<xsl:choose>
[<xsl:when test="..."> ... </xsl:when>]+
[<xsl:otherwise> ... </xsl:otherwise>]
</xsl:choose>
Examples
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title"/></td>
<xsl:choose>
<xsl:when test=".[artist='Bob Dylan']">
<td bgcolor="#ff0000"><xsl:value-of select="artist"/></td>
</xsl:when>
<xsl:otherwise>
<td><xsl:value-of select="artist"/></td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:for-each>