I am trying to parce the Rss feed on a Repeater (or Gridview) But I am unable to. Keeps "Data at the root level is invalid. Line 1, position 1." error.
XmlDocument rssXmlDoc = new XmlDocument();// Load the RSS file from the RSS URLrssXmlDoc.Load("http://feeds.skynews.com/feeds/rss/home.xml");// Parse the Items in the RSS fileXmlNodeList rssNodes = rssXmlDoc.SelectNodes("rss/channel/item");StringBuilder rssContent = new StringBuilder();// Iterate through the items in the RSS fileforeach (XmlNode rssNode in rssNodes){ XmlNode rssSubNode = rssNode.SelectSingleNode("title"); string title = rssSubNode != null ? rssSubNode.InnerText : ""; rssSubNode = rssNode.SelectSingleNode("link"); string link = rssSubNode != null ? rssSubNode.InnerText : ""; rssSubNode = rssNode.SelectSingleNode("description"); string description = rssSubNode != null ? rssSubNode.InnerText : ""; // rssContent.Append("<a href='"+ link +"'>"+ title +"</a><br>"+ description); rssContent.Append(description);}// Return the string that contain the RSS itemsDataSet ds = new DataSet();XmlTextReader reader = new XmlTextReader(new StringReader(rssContent.ToString()));ds.ReadXml(reader);rssRepeater.DataSource = ds.Tables[2];rssRepeater.DataBind();