This project has moved and is read-only. For the latest updates, please go here.

Removing Namespace definition

Topics: Developer Forum, User Forum
Feb 19, 2009 at 9:36 AM
Is there an easy way to remove the namespace from the feed xml created using the .ashx handler?

I'm trying to add my feeds to Feedburner but it doesn't recognise the namespaces generated

<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="2.0">

I tested the same feed with just

<rss version="2.0">

And it worked fine.

Any ideas?
Jul 10, 2013 at 6:58 PM
Edited Jul 10, 2013 at 6:58 PM
This Stackoverflow post shows how to remove xml namespace attributes.

To remove the namespaces from the generated RSS, modify RssXmlHelper.cs at line 106 as follows:
var xns = new XmlSerializerNamespaces();
xns.Add(string.Empty, string.Empty);
XmlSerializer serializer = new XmlSerializer(typeof(T));
serializer.Serialize(output, rssDocument, xns);