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 IXMLDOMDocument 2::createAttrib ute() and then
IXMLDOMElement: :setAttributeNo de().
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:schemaLocat ion="http://www.xyz.com/abc abc.xsd">
<MyElement1 xmlns="" attrib1="v1"/>
..
..
</MyRoot>
-----------------------------------------
Thanks in advance.
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 IXMLDOMDocument 2::createAttrib ute() and then
IXMLDOMElement: :setAttributeNo de().
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:schemaLocat ion="http://www.xyz.com/abc abc.xsd">
<MyElement1 xmlns="" attrib1="v1"/>
..
..
</MyRoot>
-----------------------------------------
Thanks in advance.
Comment