Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: xpath to select all the elements in XML with one exception only

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 2/7/2008 6:52:00 PM

Martin Honnen wrote:

> XPath selects nodes in an existing documents, it does not change the 
> document. Therefore if you select the root element 'tag1' in your 
> example then it has all its children, you can't remove some of the 
> children with XPath alone, you need XSLT for that.

However if you wanted to select only certain child elements of the root 
element tag1 then you can do that as follows:
   /tag1/*[not(self::tag3[not(tag4 = '7')])]
That selects all those child elements that are not 'tag3' elements not 
having a 'tag4' child element with contents '7'.


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent