XSLT conditional statements
by gregs on Aug.23, 2005, under Uncategorized
One of the other completely new aspects of my job has been working with xmlHTTPRequest and XML/XSL transformation. And here are a few things that I learned during my last project: you can use conditional statements. W3schools proved very helpful in getting to grips with this.
You can do if like statements:
-
<xsl:if test="expression">
-
Do something
-
</xsl:if>
And if/else statements:
-
<xsl:choose>
-
<xsl:when test="expression">
-
Do something
-
</xsl:when>
-
<xsl
therwise> -
Do something else
-
</xsl
therwise> -
</xsl:choose>
The test expressions can be made up of: "=", "and", "<", "& amp;gt;" and probably a whole lot more, but I haven't come across any other ones yet.