簡體   English   中英

xslt 3.0 到 xslt 2.0 的等效表達式

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM