searching children of ancestors
This may take a minute to explain, so please be patient.
I am using Saxon 9 on Windows.
I have a source document a simple structure such as:
a - b - x - y
+ c - d - e
+ c - d - e
+ c - d - e
+ b - x - y
+ c - d - e
+ c - d - e
+ c - d - e
+ b - x - y
+ c - d - e
+ c - d - e
+ c - d - e
My structure is really much deeper, but this will do to explain my problem.
I find myself at a 'y' node and I decide I need information from all the 'e' nodes that are descendants of my current 'b' node. I don't care about the 'e' nodes that are descendants of the other 'b' nodes.
My initial thought was to use: ancestor::node()//e to get the information. Problem is, and it is now obvious to me, I am getting all the 'e' nodes in the document, not just the ones that are descendants of my 'b' node.
What I need is a way to stop the ancestor once it has a hit on a descendant 'e' node, then reuse that ancestor to find all the 'e' nodes I am interested in.
Or I need another solution.
------------------------
Keep Moving Forward
GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876
Michael Hare
__________________
------------------------
Keep Moving Forward
GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876
Michael Hare
|