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:36:00 PM khalil_mi@h... wrote: > If the input xml is: > <tag1> > <tag2> > ......... many elements here > </tag2> > <tag3> > <tag4> 5</tag4> > ......... many elements here > </tag3> > <tag3> > <tag4> > 7 </tag4> > ......... many elements here > </tag3> > > ..... many tag3 elements here > > </tag1> > > And I want to choose the tage3 whose tag4 is 7 then the desired > output is: > > <tag1> > <tag2> > ......... many elements here > </tag2> > <tag3> > <tag4> > 7 </tag4> > ......... many elements here > </tag3> > </tag1> 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. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
