[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] SELECT ALL CHILD NODES AND EXCEPT ONE


Subject: RE: [xsl] SELECT ALL CHILD NODES AND EXCEPT ONE
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Sun, 23 May 2004 15:15:44 +0100

XPath 2.0 makes this easy, with an "except" operator: A except B selects
nodes in node-set A that are not in node-set B.

Some XSLT 1.0 processors offer the EXSLT set:difference() extension function
which does the same thing.

In standard XPath 1.0 you can write "A except B" as

A[count(.|B) != count(B)]

but it is likely to be quite inefficient.

Michael Kay 

> -----Original Message-----
> From: Arul Kumar [mailto:arulxml@xxxxxxxxxxxx] 
> Sent: 23 May 2004 11:58
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] SELECT ALL CHILD NODES AND EXCEPT ONE
> 
> Hello all,
> 
> I have an XML, with the root element <chapter> under this 
> there are many 
> child nodes. My question is, how to select the all the child nodes of 
> <chapter> and except the node '//ce:section/ce:section-title'.
> 
> Please advice me the XPath expression, so that I can use it 
> in my XSL. 
> Many thanks.
> 
> Best regards
> Arul


Current Thread
Keywords