Sphujidhwaj
9 years agoContributor
XQuery Match Configuration or Groovy Script
I have an XML Response in SOAP which has the below format
<diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <NewDataSet xmlns=""> <Status diffgr:id="Status12" msdata:rowOrder="11"> <id>28</id> <name>Review</name> <categoryId>3</categoryId> <assignrule>P</assignrule> <ismoveAssign>0</ismoveAssign> <isActive>1</isActive> </Status> </NewDataSet> </diffgr:diffgram>
I have to extract the statuses which are more than 500 and I am trying to extract the same by using XQuery Match
<Result> { for $x in //*[local-name() = 'NewDataSet']/*[local-name()='Status']/*[local-name()='name'] return <name> string ($x) </name> } </Result>
But in the output I am able to find only
<Result>
<name>string ($x)</name>
<name>string ($x)</name>
</Result>
Please assist me in this regard. Is my XQuery Correct or should I use Script Assertion?
Please find below the XML response and it is very huge consisting of nearly 4000 lines.