[英]Equivalent expression of xslt 3.0 to xslt 2.0
我在使用 xslt 3.0 時有這個表達式
<xsl:template match="TratEqnt">
<xsl:for-each-group select="Sl" group-adjacent="(position() - 1) idiv 4">
<xsl:copy select="..">
<xsl:copy-of select="* except Sl"/>
<xsl:copy-of select="current-group()"/>
</xsl:copy>
</xsl:for-each-group>
</xsl:template>
但是當我使用 xslt 2.0 時,這是我項目中的強制性行 <xsl:copy select=".."> 不起作用,並顯示編譯器錯誤。 當我試圖將此等效項轉換為 xslt 2.0 時,我沒有獲得所需的功能。 你知道該怎么做嗎? 我必須使用 xslt 2.0
改變
<xsl:copy select="..">
<xsl:copy-of select="* except Sl"/>
到
<xsl:element name="{name(..)}" namespace="{namespace-uri(..)}">
<xsl:copy-of select="../(* except Sl)"/>
或者,改變
<xsl:copy select="..">
<xsl:copy-of select="* except Sl"/>
<xsl:copy-of select="current-group()"/>
</xsl:copy>
到
<xsl:for-each select="..">
<xsl:copy>
<xsl:copy-of select="* except Sl"/>
<xsl:copy-of select="current-group()"/>
</xsl:copy>
</xsl:for-each>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.