Hi there,

I am having a little trouble with my xmldoc generated from oracle. I am building an xml doc using xmldom. I need to add an element to the doc, however, the element has a namespace prefix (lets call it "prefix" with URI "uri: prefix").

When I create the element and add it to the document, the URI reference is not added. The result is an invalid xml document.
Code:
<root>
  <prefix:element>element text</prefix:element>
</root>
So the question is... Does anyone know how to set an xmlns attribute on a document?
Code:
<root xmlns:prefix="uri:prefix">
  <prefix:element>element text</prefix:element>
</root>
Currently, I am using the following code:
Code:
new_nd := xmldom.makenode(xmldom.createelement(xmldoc, 'prefix:element', 'xmlns:prefix="uri:prefix"'));
txt := xmldom.makenode(xmldom.createtextnode(xmldoc, 'element text'));		
txt := xmldom.appendchild(new_nd, txt);
root_nd := xslprocessor.selectsinglenode(xmldom.makenode(xmldoc), '/');
new_nd := xmldom.appendchild(root_nd, new_nd);
And dbversion = 10.1

DayneO