I am trying to parse the RSS feed at this link http://www.gazetaexpress.com/rss.php?cid=1,13&part=rss but when I try to display the results, it causes the following error:
Warning: DOMDocument :: load () [domdocument.load]: discrepancy between opening and ending tags: strong line 208 and description at http://www.gazetaexpress.com/rss.php?cid=1,13&part=rss , line: 209 in C: \ wamp \ www \ gazetaExpress \ scripts \ reader.php on line 17
and
Warning: DOMDocument :: load () [domdocument.load]: premature end of data in rss tag line 2 at http://www.gazetaexpress.com/rss.php?cid=1,13&part=rss line: 226 in C : \ wamp \ www \ gazetaExpress \ scripts \ reader.php on line 17
the script that I use for parsing,
$xmlDoc->load($xml); $x=$xmlDoc->getElementsByTagName('item'); for ($i=0; $i<6; $i++) { $item_title=$x->item($i)->getElementsByTagName('title')->item(0)->childNodes->item(0)->nodeValue; $item_link=$x->item($i)->getElementsByTagName('link')->item(0)->childNodes->item(0)->nodeValue; $item_desc=$x->item($i)->getElementsByTagName('description')->item(0)->childNodes->item(0)->nodeValue;
When I try any other rss channel from this site (for example, sports: http://www.gazetaexpress.com/rss.php?cid=1,24&part=rss ), it works fine. This is exactly the above rss feed that will not work. Is there any way around this? any help would be greatly appreciated.
Shpat source share