alibaba82
17 years agoSuper Contributor
Xquery issue
Hello,
The Xquery description in the soapui manual says that the it
"resulting in an assertion that will not fail if the items come in another order and/or get more/other data "around" the id element"
However, I notice that when I get more elements than the ones defined in the list, my assertions fails. Not sure I am doing something wrong.
My xquery is
declare namespace ns1='.......hidden';
{
for $z in //ns1:GetRecommendationsResponse[1]/ns1:GetRecommendationsResult[1]/ns1:Airings[1]/ns1:Airing/ns1:AiringRating/text()
order by $z return{data($z)}
}
Expected Result:
TV-14
TV-14
TV-14
Now if I get more or less than 3 airingsRatings my assertion fails with this error.
XQuery Match Assertion failed for path [declare namespace ns1='http://services.tvguide.com/v4/smartrecommendations'; { for $z in //ns1:GetRecommendationsResponse[1]/ns1:GetRecommendationsResult[1]/ns1:Airings[1]/ns1:Airing/ns1:AiringRating/text() order by $z return {data($z)} } ] : Exception:org.custommonkey.xmlunit.Diff [different] Expected number of child nodes '7' but was '9' - comparing at /ALI[1] to at /ALI[1]
your input is appreciated.
Thanks
Ali
The Xquery description in the soapui manual says that the it
"resulting in an assertion that will not fail if the items come in another order and/or get more/other data "around" the id element"
However, I notice that when I get more elements than the ones defined in the list, my assertions fails. Not sure I am doing something wrong.
My xquery is
declare namespace ns1='.......hidden';
{
for $z in //ns1:GetRecommendationsResponse[1]/ns1:GetRecommendationsResult[1]/ns1:Airings[1]/ns1:Airing/ns1:AiringRating/text()
order by $z return
}
Expected Result:
Now if I get more or less than 3 airingsRatings my assertion fails with this error.
XQuery Match Assertion failed for path [declare namespace ns1='http://services.tvguide.com/v4/smartrecommendations'; { for $z in //ns1:GetRecommendationsResponse[1]/ns1:GetRecommendationsResult[1]/ns1:Airings[1]/ns1:Airing/ns1:AiringRating/text() order by $z return {data($z)} } ] : Exception:org.custommonkey.xmlunit.Diff [different] Expected number of child nodes '7' but was '9' - comparing at /ALI[1] to at /ALI[1]
your input is appreciated.
Thanks
Ali