此代码不能分配一个参数是给我的输出test
当预期输出应该是什么..XSLT用布尔值内``<xsl:choose>
是不是有毛病我XSLT处理器或..? :
<xsl:template match="/">
<xsl:param name="IsTextArea">
<xsl:choose>
<xsl:when test="false()">
<xsl:value-of select="true()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="false()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<html>
<xsl:choose>
<xsl:when test="$IsTextArea">test
</xsl:when>
</xsl:choose>
</html>
</xsl:template>
顺便说一句我需要(如,没有扩展和东西)为原料XSLT 1.0的溶液。
是否可以在XSLT 1.0中为param
设置布尔参数?
顺便说一句,如果我将它设置为“1”和“0”,并使用“$ IsTextArea = 1”,它可以吗? – Pacerier 2011-06-09 16:41:27
不可以。正如@Michael-Key正确指出的那样,你总是会有一个字符串。尝试一下 :)! – 2011-06-09 19:22:59