xslt变量值

时间:2011-12-13 14:55:30

标签: xslt

我有这段代码:

        <xsl:variable name="varPriceDate">
          <xsl:call-template name="lookup_MarketGNLPricesFile_Valor">
            <xsl:with-param name="PARAM_Key" select="'A'"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:element name="priceDate">
          <xsl:value-of select="Col[$varPriceDate]"/>
        </xsl:element>
        <xsl:variable name="varPrice">
          <xsl:call-template name="lookup_MarketGNLPricesFile_Valor">
            <xsl:with-param name="PARAM_Key" select="'B'"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:element name="price">
          <xsl:value-of select="Col[$varPrice]"/>
        </xsl:element>

<xsl:value-of select="Col[$varPriceDate]"/>显示的结果与<xsl:value-of select="Col[$varPrice]"/>相同。 你能帮助我吗?我需要解决它

1 个答案:

答案 0 :(得分:1)

两个变量的值都是结果树片段(在XSLT 2.0中,文档节点),结果树片段的有效布尔值始终为true。因此,表达式Col[$varPriceDate]Col[$varPrice]都等同于简单地编写Col

为了纠正这个问题,我们需要知道代码的目的是什么,这一点并不清楚。

相关问题