Omit empty namespace declarations

Russ1984

Member
Joined
Feb 29, 2008
Messages
9
Programming Experience
Beginner
Hello,

When loading an xmldocument and appending a new child node somewhere in the document and then saving, the appended node has 'xmlns = ""' in it. Is there anyway to not show the namespace attribute or remove it?
 
It does that if the document has a namespace that you're not using when creating the new node. Use for example doc.DocumentElement.NamespaceURI as namespace when creating the node.
 
Back
Top