On 21/01/2008, Abel Braaksma <abel.online@xxxxxxxxx> wrote:
> Here's the/a long version that works in both XSLT 1.0 and 2.0:
>
> <xsl:template match="child::*">
> <xsl:copy>
> <xsl:apply-templates select="attribute::*|node()"/>
> </xsl:copy>
> </xsl:template>
>
> <xsl:template
> match="attribute::*|text()|comment()|processing-instruction()">
> <xsl:copy/>
> </xsl:template>
Here's a version that might be more understandable to a beginner (IMHO):
<xsl:template match="child::*">
<xsl:copy>
<xsl:apply-templates select="attribute::*|child::node()"/>
</xsl:copy>
</xsl:template>
<xsl:template
match="attribute::*|text()|comment()|processing-instruction()">
<xsl:copy/>
</xsl:template>
|