By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

remove xml file namespace attribute

P: n/a
Hi, All,

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>
</AutoData>

So finally the file without namespace is like this:

<AutoData >
<Table1>
<Data1 10 </Data1>
<Data2 20 </Data2>
<Data3 40 </Data3>
<Table1>
</AutoData>

Any advice?

Thanks
Martin

Nov 9 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
martin1 wrote:
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 </Table1there.
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/")

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.