Forum Discussion

techva's avatar
techva
New Contributor
8 years ago

Getting error for xQuery

Hi, I have a very simple xQuery Assertion:

 

declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace ns1='http://www.webservicex.net/';
<resultData>
{
for $x in //ns1:SupplierData
return $x
}
</resultData>

 

I am getting the following error:

XQuery Match Assertion failed for path [declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/'; declare namespace ns1='http://www.webservicex.net/'; { for $x in //ns1:SupplierData return $x } ] : Exception:org.custommonkey.xmlunit.Diff [different] Expected namespace URI 'null' but was 'http://www.webservicex.net/' - comparing at /resultData[1]/SupplierData[1] to at /resultData[1]/SupplierData[1]

 

My expected result is:

<resultData>
<SupplierData>
<SupplierNumber>0230740001</SupplierNumber>
<CompanyName>DR WILLIAM B HUTCHESON &amp; ASSOC OPTOME</CompanyName>
<Address1>112 ELDEN ST</Address1>
<Address2>STE C</Address2>
<City>HERNDON</City>
<Zip>VA</Zip>

...

 

  • Is the namespace missing for SupplierData in the expected result?

    To check that, I usually click the Select from current button under Expected Result to see the XQuery expression result from the current message.