xsl的流程控制语句

1.<xsl:if test="">(相当于if语句)
    Some output.
  </xsl:if>

2.<xsl:choose>(相当于switch语句)
     <xsl:when mathch="">
    Some output.
     </xsl:when>
     <xsl:otherwise>
    Other output.
     </xsl:otherwise>
  </xsl:choose>

例子:
<xsl:if test="id[text()='1']">(相当于if语句)
...
</xsl:if>
意思就是如果xml里的id的值为1就开始下面的逻辑操作


<xsl:choose>(相当于switch语句)
    <xsl:when test="id[text()='1']">
    ...
    </xsl:when>
    <xsl:otherwise>
    ...
    </xsl:otherwise>
</xsl:choose>

猜你喜欢

转载自1124117571.iteye.com/blog/2289674