Hi, I'm having trouble with namespaces when importing nodes. I'd like to get
this output:
<exampleRoot xmlns="http://mynamespace">
<row Lsm_Info="ABC12 3" />
<row Lsm_Info="DEF45 6" />
</exampleRoot>
But instead I'm getting:
<exampleRoot xmlns="http://mynamespace">
<row Lsm_Info="ABC12 3" xmlns="" />
<row Lsm_Info="DEF45 6" xmlns="" />
</exampleRoot>
This is the code I'm using:
XmlReader reader = command.Execute XmlReader();
XmlElement rootNode = xmlDocument.Cre ateElement("exa mpleRoot ",
http://mynamespace);
xmlDocument.App endChild(rootNo de);
reader.MoveToCo ntent();
XmlNode readerNode = xmlDocument.Rea dNode(reader);
while (readerNode != null)
{
XmlNode importNode = xmlDocument.Imp ortNode(readerN ode, false);
xmlDocument.Doc umentElement.Ap pendChild(impor tNode);
readerNode = xmlDocument.Rea dNode(reader);
}
How do I get rid of the xmlns=""? Any help is much appreciated!
Cheers,
Chris