absolute newbie who needs a quick answer (I'm going to research this tonight, but need an answer for now). Apologise in advance for idiocy:
I have written an xpath as follows:
sum(aaa[status='X' and code='Y']/value)
This does exactly what I want. However, aaa lives inside a couple of other nodes in the below format:
fff xmlns="urn:xxx.co.uk/soap:xxx" id="xxx"
ggg type="1" ... title="ASDGHJAS ASHD"
Why doesn't:
sum(fff/ggg/aaa[status='X' and code='Y']/value)
work?
What do I have to do to tell it to look at node fff and ggg? I can't type the full name with all the items that come after the initial name as they are different every time the query runs.
Thanks if you can help a useless first timer!
<fff xmlns="urn:xxx.co.uk/soap:xxx" id="xxx" linktype="0">
<ggg type="1" title="ABC">
<aaa>
<status>X</status>
<code>Y</code>
<value>15</value>
</aaa>
<aaa>
<status>Z</status>
<code>G</code>
<value>5</value>
</aaa>
<aaa>
<status>X</status>
<code>Y</code>
<value>30</value>
</aaa>
</ggg>