<xsl:template match="*" mode="addSeatSelectionToAirProduct">
        <xsl:element name="{local-name()}">
            <xsl:apply-templates select="@*" mode="addSeatSelectionToAirProduct"/>
            <xsl:apply-templates select="*|text()" mode="addSeatSelectionToAirProduct"/>
        </xsl:element>
    </xsl:template>
    
    <xsl:template match="@*" mode="addSeatSelectionToAirProduct">
        <xsl:copy/>
    </xsl:template>

其中<xsl:apply-templates select="*|text()" mode="addSeatSelectionToAirProduct"/>

里面的|表示匹配多种类型,*表示匹配当前元素节点、匹配当前属性、匹配子节点、匹配后代节点,text()表示匹配文本类型。

但是有个问题,最后文本节点是怎么实现copy的呢?并没有写

<xsl:template match="text()" mode="addSeatSelectionToAirProduct">
        <xsl:copy/>
</xsl:template>

相关文章:

  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2021-07-27
  • 2021-05-06
  • 2021-05-27
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
  • 2021-09-03
  • 2021-08-11
  • 2022-12-23
相关资源
相似解决方案