This is my sample XML
<?xml version="1.0"?>
<DOCUMENT>
<MY_DATA_SET xmlns="">
<MY_DATA>
<MY_DATA>
</MY_DATA_SET>
<DOCUMENT>
I want to remove programetically this part xmlns=""
output should be
<?xml version="1.0"?>
<DOCUMENT>
<MY_DATA_SET>
<MY_DATA>
<MY_DATA>
</MY_DATA_SET>
<DOCUMENT>
- let theDocument = getXmlNode(XML,'//DOCUMENT');
(getXMLNode is a function it can give docuemnt node element)
- let testNode = create('<MY_DATA><MY_DATA></MY_DATA></MY_DATA>');
(create the XML from string)
- let firstChild = theDocument._domNode._firstChild;
(getting the first child from the document)
theDocument.node.insertBefore(testNode.node._documentElement, firstChild);
output is :
<?xml version="1.0"?>
<DOCUMENT>
<MY_DATA_SET xmlns="">
<MY_DATA>
<MY_DATA>
</MY_DATA_SET>
<DOCUMENT>
I don want to see this part : xmlns=""
if i try to remove :testNode.node._documentElement.removeAttribute(“xmlns”);
it didn’t work