I'm trying to create az xpath, where I want to get a node, in which there exists a child node which has an attribute. My problem is that the only difference in this structure is the child attribute. Here's an example to show you what I mean:
<Values>
<record name="svc_sig">
<record name="sig_in">
<array name="rec_fields">
<record>
<value name=field_name">UniqueName1</value>
</record>
<record>
<value name=field_name">UniqueName2</value>
</record>
<record>
<value name=field_name">UniqueName3</value>
</record>
<record>
<value name=field_name">UniqueName4</value>
</record>
</array>
</record>
</record>
<Values>
For example given UniqueName3 I want to get the record that contains it. So far I tried the following:
/Values/record[@name='svc_sig']/record[@name='sig_in']/array[@name]/record/value[@name='field_name']
With this however I get all the value nodes that has the attribute field_name.