basex
basex copied to clipboard
XQuery: Updating expressions, type checks, inspect:functions
(: a.xqm :)
module namespace a = 'a';
(: b.xqm :)
module namespace b = 'b';
(: c.xqm :)
module namespace c = 'c';
declare %updating function c:a() as empty-sequence() { error(), c:a() };
The following query…
(: main.xq :)
import module namespace c = 'c' at 'c.xqm';
('a.xqm', 'b.xqm') ! inspect:functions(.)
…returns:
[inspect:parse] Stopped at c.xqm, 3/28:
[XUST0001] type check: no updating expression allowed.
Related (with INLINELIMIT = 0):
(: x.xqm :)
module namespace f = 'f';
declare function f:f() { };
(: x.xq :)
declare function local:a() { current-date()[not(string(.))] };
declare %updating function local:b() { void(local:a()) ,() };
void(inspect:functions('x.xqm')),
local:b()
Unexpected result: Function body must be updating.