Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm currently trying to consume an RSS from other sites. The problem is, the rss is in a .php format. (But it's actually XML, if you view the source)
I'm trying to do it with
//Get the XML from remote URL
XmlDocument xml = new XmlDocument();
//URL currently hardcoded - but you could use a macro param to pass in URL
//Select the nodes we want to loop through
XmlNodeList nodes = xml.SelectNodes("//item");
//Traverse the entire XML nodes.
foreach (XmlNode node in nodes)
//Get the value from the <title> node
var title = node.SelectSingleNode("title").InnerText;
//Get the value from the <description> node
var description = node.SelectSingleNode("description").InnerText;
But it gives me errors.
However, I've tried to change the rss url to other file (https://cyber.harvard.edu/rss/examples/sampleRss091.xml) which is in .xml format and it works fine
Is it possible to consume the RSS if the provided file is in .php format? If yes, what is the possible way to do that? Thanks!
It might have something to do with the fact that the xml rendered by the php file is not valid xml.
Just view the source, copy the entire thing and paste it into any xml validator.
I have a feeling that the error you are getting is a XmlException error.
Further documentation on XmlDocument.Load() might help you better understand how the function works: https://msdn.microsoft.com/en-us/library/875kz807(v=vs.110).aspx
Hope this helps you out.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted