How to remove namespaces from XmlDocument???

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
 
I

Italo Silveira

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



Good luck, Italo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top