I want to select all descendant nodes of "first" nodes that are "third" nodes and which attribute name is equal "this"
I'm trying to do that by using the XPath
root/first/descendant::node()[name()='third' and current()/@name='this']
but it does not appear to work.
In other words I would like to select the node "<third name="this"/>" in the tree below (the tree is just an example, I do not know in advance what nodes are nested in "first" nodes)
Code:
<root><first name="1"><second1 name="a"><third name="this"/>
</second1>
<second2 name="b"/>
<second1 name="c"/>
</first>
<first name="2"><second3 name="d"/>
<second4 name="e"/>
<second1 name="f"/>
</first>
</root>
Thanks for your help, and excuse me if the question sounds silly :)