|
Subject: Re: [xsl] How to copy all child elements except specific one? From: Dimitre Novatchev <dnovatchev@xxxxxxxxx> Date: Tue, 16 Jan 2001 11:46:23 -0800 (PST) |
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
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] How to copy all child ele, Michael Kay | Thread | RE: [xsl] How to copy all child ele, Morris, Chris |
| RE: [xsl] xml to xml transform, Shimon Pozin | Date | RE: [xsl] How to copy all child ele, Morris, Chris |
| Month |