homepage Welcome to WebmasterWorld Guest from 54.167.179.48
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
Forum Library, Charter, Moderators: bill & werty

RSS, ATOM, and Related Technologies Forum

    
Can't parse RSS from site
ArmanSuleimenov

5+ Year Member



 
Msg#: 4081955 posted 8:08 am on Feb 17, 2010 (gmt 0)

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

WebmasterWorld Administrator bill us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4081955 posted 8:36 am on Feb 17, 2010 (gmt 0)

Does the feed you're trying to parse validate?

OnlineConnect



 
Msg#: 4081955 posted 1:01 am on Feb 21, 2010 (gmt 0)

Yes try validating the feed

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved