Hi BaseX team,
I wonder why I can't use admin:write-log as output of an updating function
Using
...
return if(file:is-file($path)) then ( try { file:delete($path) } catch * { admin:write-log('Could not delete image file ' || $path) (: works with update:output('...'):) } , delete node $img ) else ( delete node $img )
I get the error
*Expressions must all be updating or return an empty sequence.*
Kind regards
Hi Markus,
The reason is that the XQuery Update Facility was finalized before try/catch was introduced with XQuery 3 (this is why the specification provides no rules for handling this case). We’ll look at this soon, though [1].
Thanks for the hint, Christian
[1] https://github.com/BaseXdb/basex/issues/1693
On Thu, Jul 4, 2019 at 4:39 PM Markus Wittenberg Wittenberg@axxepta.de wrote:
Hi BaseX team,
I wonder why I can't use admin:write-log as output of an updating function
Using
...
return if(file:is-file($path)) then ( try { file:delete($path) } catch * { admin:write-log('Could not delete image file ' || $path) (: works with update:output('...'):) } , delete node $img ) else ( delete node $img )
I get the error
Expressions must all be updating or return an empty sequence.
Kind regards
-- Markus Wittenberg
Tel +49 (0)341 248 475 36 Mail wittenberg@axxepta.de
axxepta solutions GmbH Lehmgrubenweg 17, 88131 Lindau
Amtsgericht Berlin HRB 97544B Geschäftsführer: Karsten Becke, Maximilian Gärber
A new snapshot is available [1]. BaseX 9.2.3 will be released this or next week.
Cheers, Christian
[1] http://files.basex.org/releases/latest/
On Thu, Jul 4, 2019 at 4:51 PM Christian Grün christian.gruen@gmail.com wrote:
Hi Markus,
The reason is that the XQuery Update Facility was finalized before try/catch was introduced with XQuery 3 (this is why the specification provides no rules for handling this case). We’ll look at this soon, though [1].
Thanks for the hint, Christian
[1] https://github.com/BaseXdb/basex/issues/1693
On Thu, Jul 4, 2019 at 4:39 PM Markus Wittenberg Wittenberg@axxepta.de wrote:
Hi BaseX team,
I wonder why I can't use admin:write-log as output of an updating function
Using
...
return if(file:is-file($path)) then ( try { file:delete($path) } catch * { admin:write-log('Could not delete image file ' || $path) (: works with update:output('...'):) } , delete node $img ) else ( delete node $img )
I get the error
Expressions must all be updating or return an empty sequence.
Kind regards
-- Markus Wittenberg
Tel +49 (0)341 248 475 36 Mail wittenberg@axxepta.de
axxepta solutions GmbH Lehmgrubenweg 17, 88131 Lindau
Amtsgericht Berlin HRB 97544B Geschäftsführer: Karsten Becke, Maximilian Gärber
basex-talk@mailman.uni-konstanz.de