Reputation: 1
I am trying to use XQuery within groovy scripts within SoapUI but not sure if this is possible.
I need to query XML files. For example, find the number value from a Firstname=Jim and Surname=Booth that all belongs to the Summary.
<Summary>
<Number>123</Number>
<Surname>Booth</Surname>
<FirstName>Jim</FirstName>
</Summary>
I have looked into XPath and GPath but don't think it is possible.
Upvotes: 0
Views: 769
Reputation: 2852
Groovy does support XPath and XQuery.
http://groovy.jmiguel.eu/groovy.codehaus.org/Processing+XML.html
http://groovy.jmiguel.eu/groovy.codehaus.org/Processing+XML+with+XQuery.html
Upvotes: 0
Reputation: 89305
"I have looked into xPath and GPath but don't think it is possible."
I don't know about groovy and whether it support XQuery or not, but your example case can be implemented in XPath as follow :
//Summary[FirstName="Jim" and Surname="Booth"]/Number
Upvotes: 1