在XSL 2.0中,我试图用不同的值迭代一些数据,然后对它们做一些事情。
<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.
我疯狂地谷歌,我确实看到人们抱怨“原子值”,但我没有看到任何人建议如何处理它。我用的是萨克森9。任何见解都将受到极大的赞赏。