Hello,
I would like to bind a sequence of xs:string to an external variable. I've tried various ways and after trying to read the source and the spec I fear that it might not be possible.
First of all the code:
Inside the xquery:
declare variable $mysequence as xs:string* external;
On the Java side:
ClientQuery clientQuery = clientSession.query(query); clientQuery.bind(parameter, values.get(parameter));
I tried to give the type "xs:string*" as a third parameter to clientQuery.bind, but I got the error message "org.basex.core.BaseXException: [XPST0003] Unknown type 'xs:string*'", so this is not the way to do it.
I furthermore tried to pass a string array as a parameter, but the variable got the value of the output of the toString method. When I tried with a list of Strings, I got again the output of the toString method.
What I want is something like the following:
let $mysequence := ("Hello", "world")
but using sequence values transmitted from the java application using an external variable. Is there any way to achieve this?
The goal is to test for membership in the sequence, i.e. allowing the parametrize the query using a variable number of possible values.
Thanks for your assistance,
Johannes