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 only Re: xpath to select all the elements in XML with one exception onlyTo: 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/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
