RE: RE: Finding and processing index terms
-----Original Message----- From: Dan Vint <dvint@xxxxxxxxx>
My intention was not to stop anyone from replying, but to have you clarify your requirement.
Let's parse your XPath expressions, I'll give my understanding of them.:
You're looking for an 'indexterm' element which has, at some point along it's ancestor axis, an element whose local name starts with 'div' or whose local name is 'table'. You want the proximate ancestor that matches. That ancestor element must have a 'publicOnly' attribute whose value is not 'Yes'
In this case you have dispensed with the requirement that the element examined must be the proximate ancestor matching the criteria.
This expression appears to be one that will have an identical evaluation to #1.
Here you dispense with any proximity consideration and change the matching value of the 'publicOnly' attribute to 'No'.
//indexterm[ancestor::*[(starts-with(local-name(),'div') or local-name()='table') and not(@publicOnly)]]
This one is largely like the previous one except that you are restricting the ancestors to ones without a 'publicOnly' attribute.
None of these match anything in your sample data. Would you suggest that we change your XML so that one element will match one of the XPath expressions in order to proceed?
-- Charles Knell cknell@xxxxxxxxxx - email
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format