Forum Discussion

hngnango's avatar
hngnango
Occasional Contributor
8 years ago
Solved

how to return multiple value in return statement in xqueries expression

Hi 

I am trying to return multiple value in return statement as described below, but I am getting syntax error

===================================================

declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace ns1='http://thomas-bayer.com/blz/';

<Result>
{
  for $x at $i in //ns1:details
 where $x/ns1:bic = 'DEUTDEBB160'
  order by $x/ns1:plz
  return <bezeichnung> data{$/ns/:plz}  {data($x/ns1:bezeichnung)} </bezeichnung>
}
</Result>

========================================

Here is a error message 

XQuery Match Assertion failed for path [declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/'; declare namespace ns1='http://thomas-bayer.com/blz/'; { for $x at $i in //ns1:details where $x/ns1:bic = 'DEUTDEBB160' order by $x/ns1:plz return data{$/ns/:plz} {data($x/ns1:bezeichnung)} } ] : RuntimeException:java.lang.reflect.InvocationTargetException.

 

Question: what the syntax should be in return statement

 

thank