2011-12-13 93 views
0

我有這樣一段代碼: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]"/>。 你能幫我嗎?我需要溶液它

+0

向我們展示一些上下文,我們確實需要查看被調用的那些模板的返回類型和值。您可能要像'上校[位置()= $ VAR]'而不是你有什麼,但是這是一個猜測,向我們展示了必要的詳細資料,我們無需猜測可以提供幫助。 –

回答

1

兩個變量的值是結果樹片段(在XSLT 2.0,文檔節點),以及結果樹片段的有效布爾值始終爲true。因此,表達式Col[$varPriceDate]Col[$varPrice]都等同於簡單地寫Col

爲了糾正這個問題,我們需要知道代碼的目的是達到什麼目的,這是不明確的。