Welcome to WebmasterWorld Guest from 54.227.110.209

Forum Moderators: bill & werty

Message Too Old, No Replies

Can't parse RSS from site

     

ArmanSuleimenov

8:08 am on Feb 17, 2010 (gmt 0)

5+ Year Member



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]

bill

8:36 am on Feb 17, 2010 (gmt 0)

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Does the feed you're trying to parse validate?

OnlineConnect

1:01 am on Feb 21, 2010 (gmt 0)

5+ Year Member



Yes try validating the feed
 

Featured Threads

Hot Threads This Week

Hot Threads This Month