Hi everyone!
I'm trying to parse RSS feeds from example.com and for several days can't figure why I get this error DOMDocument::load(): Document is empty. The XML code of the feed doesn't specify the xml version. Hopeless, I even tried using $sxml = simplexml_load_file($feedURL) as with Youtube feeds, but no luck. What is peculiar about the XML from this site is that the first item doesn't have <item> tags around it (all the remaining items have that).
Do you guys know what can be the issue?
Any help is appreciated, thanks!
My PHP code which results in an error follows:
<?php
$doc = new DOMDocument();
$doc->load("http://rtq.example.com/RTQ/rss20.aspx?rssid=RSS_PD&num=25&cat=JN008");
foreach ($doc->getElementsByTagName('item') as $node) {
$title = $node->getElementsByTagName('title')->item(0)->nodeValue;
$link = $node->getElementsByTagName('link')->item(0)->nodeValue;
$description = $node->getElementsByTagName('description')->item(0)->nodeValue;
}
?>
The list of warnings:
Warning: DOMDocument::load() [domdocument.load]: Document is empty in http://rtq.example.com/RTQ/rss20.aspx?rssid=RSS_PD&num=25&cat=JN008
Warning: DOMDocument::load() [domdocument.load]: Start tag expected, '<' not found in http://rtq.example.com/RTQ/rss20.aspx?rssid=RSS_PD&num=25&cat=JN008 [edited by: bill at 8:34 am (utc) on Feb 17, 2010]
[edit reason] Use example.com & no links to actual sites please [/edit]