Max
Max

Reputation: 23

How to include a default value for an external variable in BaseX

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

Answers (1)

Martin Honnen
Martin Honnen

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

Related Questions