Tests and Conditionsxsl:if offers the equivalent of an if statement. The content of xsl:if is generated if the test is true: <xsl:if test="not(position()=last())"> </xsl:if> xsl:choose is the equivalent of the Java switch statement. It selects one among a number of possible alternatives: <xsl:choose> <xsl:when test="Currency='USD'">Dollars</xsl:when> <xsl:when test="Currency='EUR'">Euros</xsl:when> <xsl:when test="Currency='BEF'">Belgian Francs</xsl:when> <xsl:when test="Currency='CAD'">Canadian Dollars</xsl:when> </xsl:choose> Tip There is no direct equivalent for the if/then/else statement in XSLT, but it can be simulated as follows : <xsl:choose/> <xsl:when test="Confidential='true'"> <B>For Your Eyes Only</B> </xsl:when> <xsl:otherwise><B>You Can Circulate</B></xsl:otherwise> </xsl:choose> |