XSLT并将变量赋给表td

时间:2013-08-21 08:01:40

标签: xslt

<xsl:variable name="calculateHours" select="number(concat(substring-before(ToTime, ':'), '')) - number(concat(substring-before(FromTime, ':'), ''))"/>
    <xsl:if test="concat(substring-before(FromTime, ':'), ':00') = $Hour">
        <td align="center" valign="top" class="classCell" rowspan="$calculateHours">
            sad
        </td>
    </xsl:if>

但我如何在

中使用$calculateHours
<td align="center" valign="top" class="classCell" rowspan="$calculateHours">

$calculateHours未转换为数字

1 个答案:

答案 0 :(得分:2)

尝试用{}括号括起来,即<td align="center" valign="top" class="classCell" rowspan="{$calculateHours}">