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.