Reputation: 23
I'm using the BaseX REST API to run xQuery files.
Parameters can be passed in via query strings:
declare variable $param1 as xs:string external;
However, I could not find out how to set a default value for a parameter. Is this even possible?
thanks! Max
Upvotes: 0
Views: 706
Reputation: 167516
In XQuery, for such a variable declaration you can define a default by using e.g. declare variable $param1 as xs:string external := 'foo';
, see https://www.w3.org/TR/xquery-31/#id-variable-declarations.
Upvotes: 1