To remove xmlns value from Xml file
-
Hi there, Through coding i'm creating a xml file. In this manually i'm creating some node eg: "". Now what's happening is, it's automatically creating xmlns value as: "". But i don't want that. Please help me. How to remove xmlns value. I don't want that. Regards n Thks Sam.M
-
Hi there, Through coding i'm creating a xml file. In this manually i'm creating some node eg: "". Now what's happening is, it's automatically creating xmlns value as: "". But i don't want that. Please help me. How to remove xmlns value. I don't want that. Regards n Thks Sam.M
Well, that would depend entirely on how you're generating this XML file. Without seeing the code, it's impossible to tell you how to do it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Hi there, Through coding i'm creating a xml file. In this manually i'm creating some node eg: "". Now what's happening is, it's automatically creating xmlns value as: "". But i don't want that. Please help me. How to remove xmlns value. I don't want that. Regards n Thks Sam.M
In vb.net I use the following: Dim ns As New XmlSerializerNamespaces ns.Add("", "") 'empty strings required to prevent default namespace declarations appearing in xml file
-
In vb.net I use the following: Dim ns As New XmlSerializerNamespaces ns.Add("", "") 'empty strings required to prevent default namespace declarations appearing in xml file
Hi All, I saw various option in this thrade and come to solve my own solution for remove xmlns attribute in xml. This is working properly and no any issue with this---> 'Remove the Equifax / Transunian / Experian root node attribute that have xmlns and load xml without xmlns attributes. If objXMLDom.DocumentElement.NamespaceURI <> String.Empty Then objXMLDom.LoadXml(objXMLDom.OuterXml.Replace(objXMLDom.DocumentElement.NamespaceURI, "")) objXMLDom.DocumentElement.RemoveAllAttributes() ResponseXML = objXMLDom.OuterXml End If Therefor no need to do any thing else to remove xmlns from xml :thumbsup: