![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - XPath - Limiting Parent [Thread Next] Re: XPath - Limiting ParentTo: NULL Date: 1/9/2006 1:56:00 PM Michael Doyle wrote: > Using XPath, I want to get all elements FOO which are not children of > BAR. > > What i have done in this instance is: > //FOO[name(..)!='BAR'] You do not need name checks, you can simply do //FOO[not(parent::BAR)] > this only works when BAR is immediately below FOO, That is what you want if your description above is correct: FOO elements which are not children of BAR. If you want FOO elements which are not descendants of BAR then you can use //FOO[not(ancestor::BAR)] -- Martin Honnen http://JavaScript.FAQTs.com/ | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||
|
