I've a php class file that can read xml file like http://www.thedailystar.net/latest/rss/rss.xml but it can't read or parse file this one http://search.yahooapis.com/NewsSearchService/V1/newsSearch?appid=YahooDemo&query=madonna By viewing with my browser I understand that two remote file is different. but both of them are xml. right? but how should I parse or read the second file?
Hopefully this link will help answer you question about RSS and XML? http://www.webmasterworld.com/forum98/80.htm Parsing XML is pretty easy with PHP5 using simplexml_load_file(). <? $xml = simplexml_load_file('http://search.yahooapis.com/NewsSearchService/V1/newsSearch?appid=YahooDemo&query=madonna'); foreach ($xml->Result as $Result) { $Title = $Result->Title; $Summary = $Result->Summary; echo "<b>".$Title."</b><br>"; echo $Summary."<p>"; } ?> Code (markup):
thanks. actually I had a php class which is common in parsing most of RSS like google news or some others AND IT worked fine. I thought this class file will be able to do RSSFEEDS syndication for any xml file. I just came to know that actually, first i have to look into xml elements and child elements of the xml source for coding RSS feeds.