Renaming an element's name and namespace using XUpdate
How does one rename an element's name and namespace using XUpdate. The
XUpdate specification does not mention if the content of the rename
instruction is a string or QName.
I looked at eXist's implementation and noticed that the implementation
treats the content of the rename instruction to be a string and only
renames the element's name - actually, it does rename the namespace URI
too - it just gets rid of the current namespace URI.
I can go ahead and change eXist code to treat the content to be a QName
and rename both the namespace URI and the name. However, there are a few
1. Should we use the QName's prefix as the prefix for the element's
name? Or should we use the empty prefix ("").
2. If we use the QName's prefix, there is no mechanism for the caller to
rename the element and also use the empty prefix ("").
3. If we use the QName's prefix or the empty prefix, what if it clashes
with an existing xmlns attribute? Should we overwrite the xmlns attribute?
xmlns attributes are being swallowed by XUpdateProcessor
If I send the following xupdate command to eXist, the xmlns attribute is
being suppressed by XUpdateProcessor
<bar xmlns=""> This child does not have a namespace whereas the parent
has a namespace and might be using the xmlns="myNS" to specify it's
namespace instead of xmlns:somePrefix="myNS"
There is a comment in the XUpdateProcessor that says, "Why are these
showing up? They are supposed to be stripped out?"
In the above example the xmlns attribute is there to reset any potential
xmlns declaration in the parent.
Is there a specific reason, why the xmlns attributes are being suppressed?