Re: [xsl] Shallow (in-place) parent-child swap

Subject: Re: [xsl] Shallow (in-place) parent-child swap
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 11 Dec 2006 10:09:24 GMT
copy most stuff:

<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>

don't copy w that contain (one or more) phr

<xsl:template match="w[phr]">
<phr>
<xsl:for-each select="phr">
<w>
<xsl:copy-of select="node()"/>
</w>
</xsl:for-each>
</phr>
</xsl:template>


David

Current Thread