XSL reference documentation generated from the W3C Recommendation 16 November 1999
xsl:if
<if>
test = boolean-expression
Model: template
</if>
The xsl:if element has a test attribute,
which specifies an
<xsl:template match="namelist/name"> <xsl:apply-templates/> <xsl:if test="not(position()=last())">, </xsl:if> </xsl:template>
The following colors every other table row yellow:
<xsl:template match="item">
<tr>
<xsl:if test="position() mod 2 = 0">
<xsl:attribute name="bgcolor">yellow</xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</tr>
</xsl:template>