My problem i want to replace a root node i my xml document, no problem:
XMLDoc.LoadXml(HOKAData);
XmlDocumentFragment xdf = AdjustedXMLDoc.CreateDocumentFragment();
XmlNode root =
AdjustedXMLDoc.CreateNode(XmlNodeType.Element,_Roo t,_Namespace);
xdf.InnerXml = XMLDoc.FirstChild.InnerXml;
AdjustedXMLDoc.AppendChild(root);
root.AppendChild(xdf);
result from
AdjustedXMLDoc.Save("C:\\test2.xml");
:
<HOKAROOT xmlns="HokaNamespace">
- <General xmlns=""> <!!!!!!!!!!!!!!-----------Why is the DOM putting a
default empty name space on the children and how can i correct this so it
either not present or has the same namespace as the root!!!!!!!!!!!>
<Document_Number>KO39836</Document_Number>
- <Buy_from_Vendor Number="85500716A">
Hope anyone can help! thanks