22

我有一个循环使用相同的标签来加载十个单元格中的内容,但有一个不同的div标题和背景图像,所以我不知道是否有任何方式来使用开关案例只是为了把正确的div标题时我这样做 - 每个为XSL中的每个单元格加载内容? 是这样的: < ...这里加载相同的标签内容...> 请帮助我,因为我在XSL新的,谢谢你无论如何!XSL开关案例

回答

36

您可以使用,如果条件

<xsl:if test="expression"> 
    ...some output if the expression is true... 
</xsl:if> 

或选择,如果有一个以上的条件,以检查

<xsl:choose> 
    <xsl:when test="expression"> 
    ... some output ... 
    </xsl:when> 
    <xsl:when test="another expression"> 
    ... some output ... 
    </xsl:when> 
    <xsl:otherwise> 
    ... some output .... 
    </xsl:otherwise> 
</xsl:choose> 
+0

感谢你的帮助非常多,但我不知道我能multies XSL :选择像多案例:在交换机或只是一个? – gacon 2009-08-04 01:55:57