Xquery assertion - search a variable inside a node
Hi,
Using XQuery assertion we need to print the text of a variable that is inisde a node. In the file attached appears the value that I need, and the wrong answer with extra information that we do not need.
XQuery Expression
<Result>
{
for $x in //baggageEstimationFees/baggageConditions/selectableBaggageDescriptor
return
<element>
<pieces>{$x/baggageDescriptor[@pieces]}</pieces>
<price>{$x/price/text()}</price>
</element>
}
</Result>
Our result expected:
<Result>
<element>
<baggageDescriptor pieces="0"/>
</pieces>
<price>0.00</price>
</element>
<element>
<pieces>
<baggageDescriptor pieces="1"/></pieces>
<price>37.50</price>
</element>
</Result>
Or:
<Result>
<element>
<pieces>0</pieces>
<price>0.00</price>
</element>
<element>
<pieces>
<pieces>1</pieces>
<price>37.50</price>
</element>
</Result>