![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Test Ancestor axis for not contain any elements except defined [Thread Next] Re: Test Ancestor axis for not contain any elements except definedTo: NULL Date: 8/18/2006 2:06:00 AM Great thanks! PS one more small question (it's not impotnt just interesting in usefull techniques)- how to check it against nodeset which I already formed in Result Tree ? I mean during previous transformations I have a Result Tree nodeset as <checkagainst> <MyRoot/> <LovelyTag1/> <LovelyTag2/> </checkagainst> and want to check all <Item /> not against predefined self::MyRoot self::LovelyTag1 etc but against elements in RTF ? Martin Honnen wrote: > centur@g... wrote: > > > Yes, there are more levels of LovelyTags , and they can be follow in > > random order and have no fixed length, i.e. all this paths should be > > valid > > > > /MyRoot/LovelyTag1/LovelyTag2/Item > > /MyRoot/LovelyTag1/LovelyTag2/LovelyTag2/LovelyTag1/Item > > /MyRoot/LovelyTag2/LovelyTag1/LovelyTag2/LovelyTag1/LovelyTag2/Item > > Checking e.g. > > <xsl:if test="ancestor::*[not(self::MyRoot) and not(self::LovelyTag1) > and not(self::LovelyTag2)]"> > > should tell you that there are ancestor elements which are not > MyRoot/LovelyTag1/LovelyTag2 elements respectively the XPath expression > > //Item[not(ancestor::*[not(self::MyRoot) and not(self::LovelyTag1) and > not(self::LovelyTag2)])] > > should give you all Item elements you are looking for. > > > > > > -- > > Martin Honnen --- MVP XML > http://JavaScript.FAQTs.com/ | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
