Dear all @BaseX, in last snapshot,
When adding/replacing a document with db:add/db:replace, If xml content is not a document-node, but an element, namespaces definitions are just forgotten in target document. The root element has a prefix, but no definition. Result is valid if you do not pass $xml but document { $xml }
In the documentation, one can see that input can be a string (file path or serialized xml) or a document node. Maybe these functions could abort when an element is given ?
Thank you for your fantastic tool !
Best regards,
Hi Fabrice,
When adding/replacing a document with db:add/db:replace,
If xml content is not a document-node, but an element, namespaces definitions are just forgotten in target document.
Thanks for the information. The code for replacing documents has been changed just recently. I just tried to reproduce the described behavior, but did not succeed so far. The following bxs test script returns <x:a xmlns:x="x"/> as expected. Could you possibly modify it and send me a version that yields a wrong result?
<commands> <create-db name='db'/> <xquery><![CDATA[ db:replace('db', 'a.xml', <x:a xmlns:x='x'/>) ]]></xquery> <xquery>.</xquery> </commands>
Thanks, Christian
basex-talk@mailman.uni-konstanz.de