This tag is a simple conditional construct. Multi conditional testing is also possible by using xsl:choose, xsl:when, and xsl:otherwise.
<xsl:if expr="script-expression" language="language-name" test="pattern">
The example below will put a horizontal line between each continent.
Click here to see the XML structure of this example.
Click here to see the XSL formatted display of the example shown below.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <xsl:template> <xsl:apply-templates select="@*"/> <xsl:if test="@name[.='Africa']"><HR/></xsl:if> <xsl:if test="@name[.='Asia']"><HR/></xsl:if> <xsl:if test="@name[.='Europe']"><HR/></xsl:if> <xsl:if test="@name[.='Latin America and the Caribbean']"><HR/></xsl:if> <xsl:if test="@name[.='North America']"><HR/></xsl:if> <xsl:if test="@name[.='Oceania']"><HR/></xsl:if> <xsl:value-of select="@name"/> <xsl:apply-templates/> </xsl:template> </xsl:stylesheet>