I launched test from SoapUI and I want to figure out an XQuery assert. I am not able to write the XQuery request.
My xml file (answer request SoapUI)
<parent>
<total1>10.000</total1>
<total2>15</total2>
<value1>1</value1>
<value2>2</value2>
</parent>
Expected answer
I want only nodes starting with total, and the number value of node value
<parent>
<total1>10.0</total1>
<total2>15.0</total2>
</parent>
Current not working XQuery request
<parent>
{ for $n in //parent/*[starts-with(name(),'total')]
return ($n/name() ,$n/number(text()) )
}
</parent>
This is not right because it display only node name. All nodes are on the same line : <parent> total1 10.0 total2 15.0 </parent>
I am OK to do it using XQuery or XPath
<parent> { for $n in //parent/*[starts-with(name(),'total')] return ($n)} </parent>
? – Andersson