我使用,我已經創建<xsl:template>
標籤,它不使用<xsl:for-each>
聲明瞭一些驗證和設置的<xsl:variable>
或<xsl:param>
價值真或假的XSLT條件。XSLT:模板標籤變量和使用打破for-each循環
- 如果條件爲真,是否有任何方法可以打破for-each中的語句?
- 我們可以使用來自主調用例程的Template變量或param的值嗎?
例子:
<!-- Main Xslt -->
<xsl:template>
<xsl:call-template name ="TestTemplate">
<!--
Here I want to use the variable or param that
is defined in TestTemplate, is it possible?
-->
</xsl:call-template>
</xsl:template>
<xsl:template name ="TestTemplate">
<xsl:param name="eee"/>
<xsl:for-each select ="//RootNode/LeafNode">
<xsl:choose>
<xsl:when test ="@Type='ABC'">
<xsl:value-of select ="true"/>
</xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>