I want to use xdmp:node-replace to replace a node in my xml document. But, whenever it replaces a node it inserts a blank xmlns tag to that node. How to avoid it?
A blank xmlns tag means that the default namespace is undeclared.
If the new node has no prefix and is in no namespace, and the parent node has a default namespace in its scope, this sounds like correct behavior, for example:
<parent xmlns="http://www.example.com/">
<new-node xmlns=""/>
</parent>
Have you tried replacing with a node that is in the default namespace in scope for the parent? Then I would expect the following result (new-node is in the http://www.example.com/ namespace):
<parent xmlns="http://www.example.com/">
<new-node/>
</parent>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With