declare variable $n as xs:string external := "";
declare variable $n_arr as xs:integer* := tokenize($n, ",") ! xs:integer(.);
Hi Csaba,The variable types of the REST API are limited to atomic values. With BaseX 11, however, it will be possible to bind multiple values [1]:
(: XQuery file: query.xq :)
declare variable $n as xs:integer* external;
array { $n }You can try the latest stable snapshot [2].Best,ChristianOn Fri, Nov 3, 2023 at 8:30 AM Csaba Fekete <feketecsaba@gmail.com> wrote:HiI'm wondering if this is at all possible...I defined an array variable in my XQUERY:declare variable $ca as array(xs:integer) external := [];How can I assign a value (e.g [1,2]) to this variable through the URL? I have already tried:http://host:port/rest/dbname?run=query.xq&$ca[]=1&$ca[]=2That didn't work. Neither did this:http://host:port/rest/dbname?run=query.xq&$ca=1,2Any hints are much appreciated.ThanksCsaba