I have a loop with the same tags to load content in ten cells but has a difference div title and background image, so I wonder is there any way to use the switch case just to put correct div title when I do for-each to load content for each cells in XSL? something like this: <...load the same tags content here...> Please help me because I'm new in XSL, and thank you in anyway!!
+4
A:
Hi yes, use if
<xsl:if test="expression">
...some output if the expression is true...
</xsl:if>
or choose
<xsl:choose>
<xsl:when test="expression">
... some output ...
</xsl:when>
<xsl:otherwise>
... some output ....
</xsl:otherwise>
</xsl:choose>
gef
2009-08-03 10:08:52
thank you for your help very much, but I wonder can I make multies xsl:choose like multies case: in switch or just one?
gacon
2009-08-04 01:55:57
Yes you can have multiple <xsl:when .... 's. Obviously the test expression would be different in each case.
gef
2009-08-04 11:13:00
Having a look at the documentation can be a real eye-opener sometimes. ;-) http://www.w3.org/TR/xslt#section-Conditional-Processing-with-xsl:choose
Tomalak
2009-08-04 11:13:06