Reputation: 940
I have this:
<h1>This <i>is</i> a <a href="#someID">good</a> link</h1>
And I want to strip out ONLY the <a>
but not what is IN the <a>
, and NOT the italic, so I get:
This <i>is</i> a good link
How can I do that in XSLT 2.0?
Upvotes: 0
Views: 17
Reputation: 167726
Use
<xsl:template match="a">
<xsl:apply-templates/>
</xsl:template>
for the a
element, together with the identity transformation template
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* , node()"/>
</xsl:copy>
</xsl:template>
Upvotes: 2