[xsl] xsl:copy with 'exclude'

Subject: [xsl] xsl:copy with 'exclude'
From: ben@xxxxxxxxxxxxx
Date: Sun, 26 Dec 2004 20:41:48 +0000
Hello all.

Here is a predicament. I'm sure, given the right knowledge, that it is simple. Lacking that knowledge, I'm finding it bloody hard!

For the sake of argument... I have a datastructure like :

<gui>
<filling>
</filling>
.
.
.<---- lots of other stuff
.
</gui>

I would like to copy everything in the gui tags, so I use copy-of. However, I would like to EXCLUDE the <filling> tags.

I assumed that this would involve some derivative of the identity function, 

<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
                version="1.0" >

 <xsl:template match="@*|*|processing-instruction()|comment()|text()">
  <xsl:copy>
    <xsl:apply-templates select="*|@*|text()|processing-instruction()|comment()" />
  </xsl:copy>
</xsl:template>

where it would use an "if" clause before the inner apply-templates to prevent recursion whenever it was "about to" copy a filling tag. This "about to" is causing me problems. How does the algorithm tell what node it's currently in? If I use value-of then it returns the content of that node. 

Would such an "if" statement approach then be the best way to tackle the problem?

My apologies if this is a trivial and obvious problem. 

Kindest Regards,

Ben

Current Thread