Why do i have my name space on every SyndicationItem element?

117 views Asked by At

I'm trying to find out why my namespace(xmlns:ren="http://www.example.com/rss2/ext") appears on every custom syndicationItem element (<ren:rssTranslationType typeId="1" xmlns:ren="http://www.example.com/rss2/ext">Original Content</ren:rssTranslationType>) when it's already declared at the top of the file? Bizarrely this only happens after the .rss file has been read into the syndicationFeed > contents updated > then spat back out. Creating a new rss file works fine (no additional name space usages).

1

There are 1 answers

0
Rich J On BEST ANSWER

This seemed to cure it: XmlWriterSettings settings = new XmlWriterSettings{Indent = true, NamespaceHandling = NamespaceHandling.OmitDuplicates};

 using (XmlWriter xmlWriter = XmlWriter.Create(sourcePath, settings))
            {
                rssFeedData.SaveAsRss20(xmlWriter);
            }