remove xml file namespace attribute

  • Thread starter Thread starter Guest
  • Start date Start date
martin1 said:
I want to remove xml namespace attribute
(xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance") in the following file

<AutoData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Table1>
<Data1> 10 </Data1>
<Data2> 20 </Data2>
<Data3> 40 </Data3>
<Table1>
^^^^^^^^

Note that the sample markup you post is not even well-formed XML. You
need a </Table1> there.


As for removing that attribute assuming the XML is well-formed and has
been loaded into an XmlDocument instance as shown earlier you can do e.g.
Xml_Document.DocumentElement.RemoveAttribute("xsi",
"http://www.w3.org/2000/xmlns/")
 
Back
Top