Hi!
If there is a module:
xquery version "1.0"; module namespace m="http://www.host.ru/xquery/m"; declare variable $m:db := "mydb";
declare function m:up() as xs:string { let $new-doc := <root-element><item>1</item></root-element> let $update := db:add($m:db, document { $new-doc }, "id1.xml") return "Result string" };
and I use it from python API or basexclient utility. Use as:
xquery import module namespace m="http://www.host.ru/xquery/m" at "/tmp/test.xqy"; m:up()
I get an error:
Stopped at line 8, column 4 in /tmp/test.xqy: [XUST0001] Let expression: no updating expression allowed.
What could be the problem?