【发布时间】:2013-03-15 20:35:44
【问题描述】:
<xsl:choose>
<xsl:when test="type='LEVEL'">
<xsl:variable name="myVar" select = "value"/>
<xsl:variable name="spaces" select = "'            '"/>
<xsl:value-of select="substring($spaces, 1, $myVar)"/>
</xsl:when>
我在 XSLT 中有上述代码。 myVar 是一个变量,其值类似于(1 或 2 或 3)。 我需要将以下代码行的输出存储在一个变量中,并在 when 条件之外使用它。
xsl:value-of select="substring($spaces, 1, $myVar)"/
我目前无法做到。 有人可以提出一些建议吗?
【问题讨论】: