How to remove namespaces from XmlDocument???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I would like to strip all of the "xmlns" attributes out of an XmlDocument.
I coded a function that recurses nodes and calls:

XmlNode n = node.Attributes.RemoveNamedItem("xmlns");

After this call n is NOT NULL - indicating that "xmlns" was removed.
However when I look at the outer xml of node after the call to remove the
"xmlns" node is still present. Does anybody know the trick to stripping
namespaces from my XmlDocument?

Thanx for your help :)

--Richard
 
This seems to be a problem with DotNet. Rename the attribute to anything
else (remove the "x"); it will work.



Good luck, Italo
 
Back
Top