locked
Reading and Displaying RSS Feed using Silverlight ListView Control RRS feed

  • Question

  • Hello, I am getting a problem while reading and displaying feeds in my listview control. I am using WebClient Class to read the xml. I saw an example in the net that they are displaying and reading RSS feed and displaying those feed in Datagrid. Here is the link http://www.dotnetcurry.com/ShowArticle.aspx?ID=252&AspxAutoDetectCookieSupport=1 its works here :These are my original XML Links which i am converting into RSS using FeedBurner and YahooPipes : http://www.bollywoodhungama.com/rss/news.xml http://www.bollywoodhungama.com/rss/features.xml http://www.bollywoodhungama.com/rss/movie_reviews.xml http://www.bollywoodhungama.com/rss/movie_previews.xml They are using feedburner to get the feed from this link : http://feeds.feedburner.com/netCurryRecentArticles its work perfectly. But when i insert my own feed which i hosted using feedburner i got into a big trouble my feed burner link : http://feeds.feedburner.com/bollywoodhungama/ecog ==> Feed Burner Link What i changed in the source [ which show is the dotnetcurry Article ] only the link now i am getting feeds from my link then i got the error saying : System does not support 'ISO-8859-1' encoding. Line 1, position 31. when i used yahoo pipe link : http://pipes.yahoo.com/pipes/pipe.info?_id=a7ea3ae00656856774ea39801ea8f90 ==> Yahoo Pipe Here i am getting System.Exception Error When i googled on this they say that clientaccesspolicy.xml need to hosted on the server.I do not have control over that. Some 1 Can u assist me where i am going wrong or something like that. Thanks
    Wednesday, November 11, 2009 3:20 AM

All replies

  • I tried in the following way and it works for me.

    XmlReaderSettings
     readerSettings = new
     XmlReaderSettings
    ();
    readerSettings.DtdProcessing = DtdProcessing .Parse;
    readerSettings.ConformanceLevel = ConformanceLevel .Auto;

    XmlReader reader = XmlReader .Create(e.Result, readerSettings);
    SyndicationFeed rssFeed = SyndicationFeed .Load(reader);

    foreach (SyndicationItem rssItem in rssFeed.Items)
    {
        NewsItem newsItem = new NewsItem ();
        newsItem.HeadLine = rssItem.Title.Text;
        newsItem.Description = rssItem.Summary.Text;
        newsItem.Link = (rssItem.Links.FirstOrDefault() != null ) ? rssItem.Links.FirstOrDefault().GetAbsoluteUri() : null ;
        newsItem.NewsDate = rssItem.PublishDate.LocalDateTime;
        newsItemColl.Add(newsItem);
    }
    Friday, October 1, 2010 3:38 PM