Hi,
I'm writing a program that loads an xml document, modifies it, validates
it with an xsd schema, then send it on to another application for
processing. I have no control over this aplication.
The problem is this: for some reason, this application rejects any xml
documents with a namespace (as crazy as that sounds). So I need to strip
the xmlns="www.MyNamespace.com" attribute from the document before
passing it on.
This seems like it should be an easy thing to do... but I can't figure
out how to do it. I've tried
MyXml.DocumentElement.Attributes.RemoveAll();
and even
MyXml.LoadXml("<RootNode>" + OrderXml.DocumentElement.InnerXml +
"</RootNode>");
but neither of those work. RemoveAll() has no effect on the xmlns
attribute, and re-loading the xml with a new root node only moves the
xmlns attribute down to the next child of RootNode.
Any ideas?
thanks,
Gabe