Quantcast
Channel: conversion of atom feed to rss feed - Stack Overflow
Viewing all articles
Browse latest Browse all 2

conversion of atom feed to rss feed

$
0
0

i want to convert a XML find having atom feed into rss feed. I used the following method :

public void AtomToRss20(string atomFileName, string rssFileName)    {        ConvertToRss20(ReadFeed(atomFileName), rssFileName);    }    private static void ConvertToRss20(SyndicationFeed feed, string rssFileName)    {        Rss20FeedFormatter rss2 = new Rss20FeedFormatter(feed);        XmlWriter writer = XmlWriter.Create(rssFileName);        rss2.WriteTo(writer);        // You can also use         // feed.SaveAsRss20(writer);               }    private static SyndicationFeed ReadFeed(string fileName)    {        StreamReader stream = new StreamReader(fileName);        XmlReader reader = XmlReader.Create(stream);        SyndicationFeed feed = SyndicationFeed.Load(reader);        return feed;            }

It executes successfully but when i viewed the file I found that it is incomplete and terminated with missing closing tags. Can somebody please tell the problem in this or some other method for the conversion.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images