Dear Hans-Jürgen,
my general impression is that the copy-namespaces options were not designed to go hand in hand with XML database systems. They have been keeping us busy for quite some time, and even in Version 7.7, the implementation yielded incorrect results in various cases. This is why we decided to drop them until we can offer a solution that's both correct and efficient in terms of memory consumption. Sorry for that.
I would be interested to hear more about the use case which requires you to inherit namespaces in the query result.
Christian
But from 7.8 on, copy namespaces mode "inherit" is ignored.
I would greatly appreciate if you could restore the correct behaviour, as I have code running which must be compatible with XQuery 1.0 and which needs to "add" in-scope namespaces dynamically. (And in XQuery 1.0 I see no alternative to the pattern shown below.)
Kind regards - Hans-Juergen
Example code:
declare copy-namespaces preserve, inherit;
declare function local:addNamespace($elem, $prefix, $uri) { let $qname := QName($uri, concat($prefix, ':dummy')) return <A>{ attribute {$qname} {""}, $elem }</A>/* };
let $elem := <foo/> return local:addNamespace($elem, 'z', 'http:example.com') ================================
=> BaseX 7.7:
<foo xmlns:z="http:example.com"/>
BaseX >= 7.8:
<foo/>