[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl:copy with 'exclude'

Subject: Re: xsl:copy with 'exclude'
From: Colin Savage <colin.savage@xxxxxxxxx>
Date: Mon, 27 Dec 2004 08:28:12 +0200
copy exclude
You just need to add another template to match the 'filling' tags.
Then when apply templates is used, it will find the most specific
template for a particular node.

so just add this to your identity transform

<xsl:template match="filling"/>


On Sun, 26 Dec 2004 20:41:48 +0000, ben@xxxxxxxxxxxxx <ben@xxxxxxxxxxxxx> wrote:
> 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


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.