This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: How to copy all child elements except specific one?
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] How to copy all child elements except specific one?
- From: Dimitre Novatchev <dnovatchev at yahoo dot com>
- Date: Tue, 16 Jan 2001 11:46:23 -0800 (PST)
- Reply-To: xsl-list at lists dot mulberrytech dot com
Chris,
> I assume
>
> <xsl:copy-of select="" />
>
> will do what I need assuming I can come up with the correct select
> expression. How do I build an expression that will choose all child
elements
> except for a specific one?
>
Use:
<xsl:copy-of select="*[not(count(. | $thisChild) = 1)]" />
This can be generalised so that if $thisChild is a node-set containing
a subset of children, then this subset will be excluded from copying:
<xsl:copy-of select="*[not(count(. | $theseChildren) =
count($theseChildren) )]" />
In fact, this is an almost obvious application of the general XPath
expression for set difference (ns1 \ ns2):
ns1[not(count(. | ns2) = count(ns2))]
Dimitre.
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list