Trying to just simply parse an XML file;
protected void Page_Load(object sender, EventArgs e)
{
XmlDocument xdoc = new XmlDocument();//xml doc used for xml parsing
xdoc.LoadXml("http://latestpackagingnews.blogspot.com/feeds/posts/default");//loading XML in xml doc
XmlNodeList xNodelst = xdoc.DocumentElement.SelectNodes("entry");//reading node so that we can traverse thorugh the XML
foreach (XmlNode xNode in xNodelst)//traversing XML
{
litFeed.Text += "read";
}
}
But I get:
Data at the root level is invalid. Line 1, position 1.
Do I have to do an XMLHTTP request to the file first? Or am I right to assume I can load it in from an external url?