This will be best illustrated with an example:
I am looking for a primary prefix name with an ancestor that contains something with SEARCH_KEY in the name, this works well.
//PrimaryExpression/PrimaryPrefix/Name [
ancestor::MethodDeclaration//Something/Something[contains(@Image,'SEARCH_KEY')]
]
Now is there any way for SEARCH_KEY to be the Image property of the Name element?
In XPath 1.0 it isn’t possible to define and refer to range variables.
In XPath 2.0 one can use a
forexpression like this: