While updating a document in xindice using XUpdate scripts, the child
element 'xmlns:' attributes are moved to the root element. But how to make
sure that this does not happen. How to make sure that the namespace
attribute is retained in the same element.

The following examples illustrates the actual problem.

I have stored a document in Xindice which is of the following format

<Element1><Element2></Element2></Element1>

and using the following XUpdate scripts to append a new element (Element2)

<xu:modifications version="1.0" xmlns:xu="http://www.xmldb.org/xupdate";>
<xu:append select="/*[name()='Element1']">
<xu:element name="Element2">
<Document1 xmlns:Music="http://www.ibm.com/Music";>
<Document2></Document2>
</Document1>
</xu:element>
</xu:append>
</xu:modifications>

But the resulting XML is given below,

<Element1  xmlns:Music="http://www.ibm.com/Music";>
<Element2></Element2>
<Element2>
<Document1>
<Document2></Document2>
</Document1>
</Element2>
</Element1>

But the resulting XML should have been

<Element1>
<Element2></ Element2>
<Element2>
<Document1 xmlns:Music="http://www.ibm.com/Music";>
<Document2></Document2>
</Document1>
</Element2>
</Element1>

Can anyone please let me know what could be the problem

Thanks and Regards
Anand

Reply via email to