return for-each-pair($entries, $contents, %updating function($entry,
In the latest snapshot [1], the built-in higher-order functions (for-each-pair, apply, etc.) are not allowed anymore to evaluate updating functions. As a result, your original query will now yield an error (XPTY0004). As I didn’t see this covered in the specs, I have added a W3 bug entry [2].
Cheers, Christian
[1] http://files.basex.org/releases/latest/ [2] https://www.w3.org/Bugs/Public/show_bug.cgi?id=29333
$content) { let $target := $basePath || '/' || $entry/text() return try { db:store($database, $target, $content) } catch * { () } })