N
natkhatbandar
Hi,
I am generating an XML document dynamically using DOM.
I am creating an element using IXMLDOMDocument::createElement() and
then calling IXMLDOMElement::appendChild() for the parent element. For
attributes, I use IXMLDOMDocument2::createAttribute() and then
IXMLDOMElement::setAttributeNode().
My problem is that for each of the elements, an additional "xmlns"
attribute is added with no value (xmlns=""). How can I avoid getting
this extra attribute from being inserted? Note that I am not putting a
prefix for the element names.
--- Sample XML generated-----------------
<MyRoot xmlns="http://www.xyz.com/abc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xyz.com/abc abc.xsd">
<MyElement1 xmlns="" attrib1="v1"/>
..
..
</MyRoot>
I am generating an XML document dynamically using DOM.
I am creating an element using IXMLDOMDocument::createElement() and
then calling IXMLDOMElement::appendChild() for the parent element. For
attributes, I use IXMLDOMDocument2::createAttribute() and then
IXMLDOMElement::setAttributeNode().
My problem is that for each of the elements, an additional "xmlns"
attribute is added with no value (xmlns=""). How can I avoid getting
this extra attribute from being inserted? Note that I am not putting a
prefix for the element names.
--- Sample XML generated-----------------
<MyRoot xmlns="http://www.xyz.com/abc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xyz.com/abc abc.xsd">
<MyElement1 xmlns="" attrib1="v1"/>
..
..
</MyRoot>