C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Training   ASP.NET Web Hosting    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

Play Silverlight Games or Submit your Silverlight applications and earn 90% AdSense revenue.

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Forums » .NET » XML »

How to remove namespace attribute from a xml file ?


Posted Date: 22 Jul 2008      Posted By: saji      Member Level: Gold     Points: 1   Responses: 1



hii,

<?xml version="1.0" encoding="US-ASCII" ?>
<doc xmlns="http://rtf2xml.sourceforge.net/">
<preamble> </preamble>
<body></body>
</doc>

from above XML. How we will remove attribute xmlns="http://rtf2xml.sourceforge.net/" ?

Regards,
Sajid P K





Responses

Author: saji    23 Jul 2008Member Level: GoldRating:     Points: 4

hii..

At last i got the Code for remove namespace attribute from a xml file.
[CODE}

XmlDocument d = new XmlDocument();
using (XmlTextReader tr = new XmlTextReader("C:\\input.xml"))
{
tr.Namespaces = false;

d.Load(tr);

}


d.Save("C:\\output.xml");



thx.

Regards,
Sajid P K



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : What is XSD in xml
Previous : convert .dae file into .3ds file
Return to Discussion Forum
Post New Message
Category: XML

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use