Hi Sebastian,
Thanks for the observation. I’ve created an issue to track this down [1].
Best, Christian
[1] https://github.com/BaseXdb/basex/issues/2136
On Sun, Aug 14, 2022 at 1:09 PM Wiemer, Sebastian < Sebastian.Wiemer@adesso.de> wrote:
Hi,
I ran over an unexpected bahavior of BaseX 9.7.3 Can anyone explain?
Note: BaseX 9.7.3 is running with MIXUPDATES=true
file1.xq: create to functions in a list and call each function with a list comprehension
declare function local:bla(){<bla id=""/> }; declare function local:blubb(){<blubb id=""/> }; (local:bla#0,local:blubb#0)!.()
Result: as expected
<bla id=""/> <blubb id=""/>
file2.xq: same as above, but in an xquery:eval
xquery:eval( ' declare function local:bla(){<bla id=""/>}; declare function local:blubb(){<blubb id=""/> }; local:bla#0,local:blubb#0 ' )!.()
Result: as expected
<bla id=""/> <blubb id=""/>
file3.xq: same as file1, but with a little "twist"
declare function local:bla(){<bla/> update {insert node attribute id {} into .}}; declare function local:blubb(){<blubb/> update {insert node attribute id {} into .}}; (local:bla#0,local:blubb#0)!.()
Result: as expected
<bla id=""/> <blubb id=""/>
file4.xq trying to call the same with xquery:eval will not work ([xquery:update] No updating expression allowed.), so we use xquery:eval-update()
xquery:eval-update( ' declare function local:bla(){<bla/> update insert node attribute id {} into .}; declare function local:blubb(){<blubb/> update insert node attribute id {} into .}; local:bla#0,local:blubb#0 ' )!.()
--
Result: expected
<bla id=""/> <blubb id=""/>
But the result is: local:bla#0 local:blubb#0
file5.xq:
xquery:eval-update( ' declare function local:bla(){<bla/> update insert node attribute id {} into .}; declare function local:blubb(){<blubb/> update insert node attribute id {} into .}; local:bla#0 ' )()
Result: as expected
<bla id=""/>
Is this a bug? A for-loop will not work either.
Best regards, Sebastian
https://www.adesso.de/de/news/it-tacheles/folge-38.jsp?pk_campaign=ittacheles&pk_source=email&pk_medium=banner&pk_content=38_datenplattformen
>>> business. people. technology. <<<
adesso SE mit Sitz in Dortmund Vorstand: Michael Kenfenheuer (Vors.), Dirk Pothen, Andreas Prenneis, Stefan Riedel, Jörg Schroeder, Torsten Wegener Vorsitzender des Aufsichtsrates: Prof. Dr. Volker Gruhn Amtsgericht Dortmund HRB 20663