MERKSEN
12 years agoNew Contributor
[Res] JDBC-datasource and XPATH, problems comparing []...
The jdbc-datasource I use sometimes contains null values, like in this simplified example:
Id Name Email
123 Carl carl@test.com
124 Steve (null)
When called, the SOAP-service I am testing returns empty elements, like this:
->
ReadPerson(124)
<-
<ReturnValue>
<Id>124</Id>
<Name>Steve</Name>
<Email/>
<ReturnValue>
I want to treat this as the expected result, but my XPATH-match:
declare namespace ns1='http://test.com/Person;
//ns1:GetPersonResponse[1]/ns1:GetPersonResult[1]/ns1:ReturnValue[1]/ns1:Email[1]
says:
XPathContains comparison failed, expecting [], actual was [null] ([] [null] seems backwards to me, but it's what it says)
I want [] to equal [null], how can I do this?
Id Name Email
123 Carl carl@test.com
124 Steve (null)
When called, the SOAP-service I am testing returns empty elements, like this:
->
ReadPerson(124)
<-
<ReturnValue>
<Id>124</Id>
<Name>Steve</Name>
<Email/>
<ReturnValue>
I want to treat this as the expected result, but my XPATH-match:
declare namespace ns1='http://test.com/Person;
//ns1:GetPersonResponse[1]/ns1:GetPersonResult[1]/ns1:ReturnValue[1]/ns1:Email[1]
says:
XPathContains comparison failed, expecting [], actual was [null] ([] [null] seems backwards to me, but it's what it says)
I want [] to equal [null], how can I do this?