Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: xpath to select all the elements in XML with one exception only [Thread Next] Re: xpath to select all the elements in XML with one exception onlyTo: NULL Date: 3/19/2008 12:51:00 PM On Feb 7, 12:52 pm, Martin Honnen <mahotr...@yahoo.de> wrote: > 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/ That was a very helpful snippet Martin thanks for that. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
