I\'m looking for the right xpath syntax to get a specific parent of an element. Example:
root |- div | | | |----??? ---| | | |-
Use:
/root/div[.//a[@class='1']]/text()
This selects any text node that is a child of any a element that has a class attribute with value '1' and that (the a element) is a descendent of any div element that is a child of the top element named root.
a
class
'1'
div
root