1
在XSL 2.0中,我試圖通過不同的值迭代一些數據,然後對它們做些什麼。爲什麼我無法使用此xpath表達式中的子元素進行導航?
<xsl:for-each select="distinct-values(InvoiceLine/Service/ServiceMnemonicCode)">
<xsl:variable name="mnemonic">
<xsl:value-of select="."/>
</xsl:variable>
<fo:table-row>
<fo:table-cell>
<fo:block>
<xsl:value-of select="InvoiceLine/Service[ServiceMnemonic=$mnemonic]/ServiceDescription"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
但是我結束了以下錯誤:
XPTY0020: Axis step
child::element({http://schemas.blabla.com/etp/invoice/types}InvoiceLine, xs:anyType)
cannot be used here: the context item is an atomic value
ailed to compile stylesheet. 1 error detected.
我有蜜蜂瘋狂google搜索,我的確看到人們抱怨「原子值」,但我還沒有看到任何人有什麼建議去做。我已經使用Saxon9。任何有識之士將不勝感激。
本頁面似乎對大家有點幫助: http://www.oxygenxml.com/forum/topic3882.html – nont 2009-10-01 19:27:39