fn:apply with an updating function
Dear BaseX people,
I encounter a problem with standard function fn:apply(), applied to an updating function.
declare %updating function f:apply-dbPut($db as xs:string, $input as item(), $path as xs:string) {
let $fn := function-lookup(QName('http://basex.org/modules/db', 'put'), 3)
let $args := [$db, $input, $path]
return apply($fn, $args)
};Message: [XUST0002] Function body must be updating.
Therer seems to be a checking looking for an updating function, and apply() cannot, of course, be classified as such.
Do I make a mistake, or is it a limitation, or a bug?
Thank you for checking, kind regards - Hans-Jürgen
Hi Hans-Jürgen,
Quoted text · Hans-Juergen Rennau · 2 lines
> Therer seems to be a checking looking for an updating function, and apply() cannot, of course, be classified as such. > Do I make a mistake, or is it a limitation, or a bug?
That’s a limitation of the official function. You can use our custom update:apply function as a resort [1].
Hope this helps, Christian
Phantastic - it could not be easier, just insert "update:" before "apply("! That'sBaseX. Cordial thanks! Hans-Jürgen Am Donnerstag, 28. Juli 2022 um 12:17:23 MESZ hat Christian Grün <christian.gruen at gmail.com> Folgendes geschrieben:
Hi Hans-Jürgen,
Quoted text · Christian Grün · 2 lines
> Therer seems to be a checking looking for an updating function, and apply() cannot, of course, be classified as such. > Do I make a mistake, or is it a limitation, or a bug?
That’s a limitation of the official function. You can use our custom update:apply function as a resort [1].
Hope this helps, Christian
Written for BaseX 9.7. BaseX may have changed since: please check the current documentation.