Below is an xpath that works. It returns all the values of the value attribute of the OutputField tag:
//Satellite/multidataset/file[contains(@name, '311multi')]/Data/DriftAnalysis[contains(@name, '311')]/Metric[@name='Detail' and @type='Overlap']/Element[@metrictype='Overlap']/OutputField[@name='Cleared']/@value
But when I try to sum the returned values of the value attribute like the example below I get the error "Expression must evaluate to a node-set error". Can anyone tell me why and how to fix it?
sum(//Satellite/multidataset/file[contains(@name, '311multi')]/Data/DriftAnalysis[contains(@name, '311')]/Metric[@name='Detail' and @type='Overlap']/Element[@metrictype='Overlap']/OutputField[@name='Cleared']/@value)
And here is a snipit of the xml file that I'm zeoring in on.
.
.
.
<Metric name="Detail" type="Overlap">
<Element name="PFMR Inactive" metrictype="Overlap" category="MAIN" aname="Detail|PFMR Inactive" metricstatistic="UniqueValueOverlap" label="PFMR Inactive">
<OutputField name="Rome - 20101201" value="2"/>
<OutputField name="Rome - 20101229" value="2"/>
<OutputField name="Difference" value="0"/>
<OutputField name="Cleared" value="0"/>
<OutputField name="Remaining" value="2"/>
<OutputField name="New" value="0"/>
</Element>
<Element name="FUND-CODE Invalid" metrictype="Overlap" category="MAIN" aname="Detail|FUND-CODE Invalid" metricstatistic="UniqueValueOverlap" label="FUND-CODE Invalid">
<OutputField name="Rome - 20101201" value="0"/>
<OutputField name="Rome - 20101229" value="0"/>
<OutputField name="Difference" value="0"/>
<OutputField name="Cleared" value="0"/>
<OutputField name="Remaining" value="0"/>
<OutputField name="New" value="0"/>
</Element>
.
.
.
</Metric>
.
.
.