I have the following xml document. I am trying to select any child which has a sibling with the same value2 and where value3 is not Closed.
<root>
<child>
<value1>Type A</value1>
<value2>Class 1</value2>
<value3>Active</value3>
</child>
<child>
<value1>Type B</value1>
<value2>Class 1</value2>
<value3>Closed</value3>
</child>
<child>
<value1>Type C</value1>
<value2>Class 2</value2>
<value3>Active</value3>
</child>
<child>
<value1>Type D</value1>
<value2>Class 2</value2>
<value3>Active</value3>
</child>
<child>
<value1>Type E</value1>
<value2>Class 3</value2>
<value3>Active</value3>
</child>
</root>
My attempt is:
//child[following-sibling::child/value2=value2 and value3!=’Closed’]
but this is not having the desired result of applying the multiple conditions to the following-sibling function.
Any ideas?
To apply to any sibling, union the
following-siblingand thepreceding-siblingaxes.