I'm using the following code to create what will be the root element of my
XML document.
XmlDocument controlDocument = new XmlDocument();
//add root node
XmlElement rootNode = controlDocument .CreateElement( "ns0:MyRootElem ent" );
rootNode.SetAtt ribute( "xmlns:ns0" , "http://my.namespace.ur i" );
controlDocument .AppendChild(ro otNode);
I'm trying to get it so that it comes out as follows:
<ns0:MyRootElem ent xmlns:ns0="http ://my.namespace.ur i">
</ns0:MyRootEleme nt>
however, when I'm print out the XML document, it's only printing out as
such:
<MyRootElemen t xmlns:ns0="http ://my.namespace.ur i">
</MyRootElement>
Why is it getting rid of the beginning 'ns0:'? And what can I do to keep it
in there?
thnx,
Christoph