History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-405
Type: Bug Bug
Status: In Progress In Progress
Priority: Minor Minor
Assignee: Matthew Turland
Reporter: T.Lechat
Votes: 13
Watchers: 14
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Empty items array when parsing rss1.0/RDF feed

Created: 29/Sep/06 04:07 AM   Updated: 02/Jun/08 05:09 AM
Component/s: Zend_Feed
Affects Version/s: 0.1.5
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. File patch.diff (1 kb)
2. Zip Archive ZendRDF.zip (5 kb)

Issue Links:
Dependency
 
Duplicate
 
Related
 


 Description  « Hide
When trying to parse an RSS1.0 / RDF feed (rdf namespace), items array is empty.

Example : http://www.php.net/news.rss (-;

Produce :
[title] => PHP: Hypertext Preprocessor
[link] => http://www.php.net/
[description] => The PHP scripting language web site
[items] => Array
(
)

the XML dump of zend_feed is :

<?xml version="1.0" encoding="utf-8"?>
<channel xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" rdf:about="http://www.php.net/">
<title>PHP: Hypertext Preprocessor</title>
<link>http://www.php.net/</link>
<description>The PHP scripting language web site</description>
<items>
<rdf:Seq>
<rdf:li rdf:resource="http://www.zendcon.com"/>
.../...

<rdf:li rdf:resource="http://www.php.net/archive/index.php"/>
</rdf:Seq>
</items>
</channel>

I did a quick review of Zend_Feed, finding that there is a namespace
registration which seems to be in trouble, but not sure, and it need probaly to switch the item tag of entryRSS class, or add a new entryRDF class.

It's not a matter, but as this the www.php.net feed, it's humoristic (-;

Thanks for all you job.

Thierry



 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Daniel Bezruchkin - 13/Oct/06 06:43 PM
Extracting this into your zend directory will get RDF feeds to work.

Dave Liefbroer - 30/Oct/06 01:16 AM
The attached zip doesn't work. It makes a major error (blank page). Will investigate on the error.

Dave Liefbroer - 30/Oct/06 01:52 AM
It's because of:
$success = @$doc->loadXML(Zend_Feed::utf8ToUnicodeEntities($string));
in Feed.php

The utf8ToUnicodeEntities function doesn't exist (wrong code version?)

In the previous version it was:
$success = @$doc->loadXML($string);
That works!


Bill Karwin - 13/Nov/06 03:26 PM
Changing fix version to 0.6.0.

Ronnie Schwartz - 17/Nov/06 11:40 AM
I have the exact same issue. Any idea when this will be resolved? I've used PEAR's RSS class, no good. I've used Magpie/simplepie, no good. This one was able to parse all of the new feeds but cannot parse the 1.0 rdf feeds. So it's the best so far!

Simone Carletti - 01/Dec/07 12:41 PM
This bug depends on ZF-26.
RSS 1.0 lists items outside channel node and Zend_Feed actually can't handle this situation.

Rather than fixing the behavior, I would suggest to add a new RDF class, as proposed in the description of this issue.
RSS 1.0 is completely an other branch compared with RSS 2.0.

The main difference between RSS 0.91 branch (created by Dave Winer) and RSS 1.0 branch (managed by RSS-DEV Working Group) is that the latter is RDF based while RDF architecture has been completely removed in RSS 0.91, RSS 0.92, RSS 2.0.

Additionally, I would suggest to add a new class property to return feed type/version.
The following seems to be a list of formats currently supported by Zend feed:

  • Atom 0.3
  • Atom 0.5
  • Atom 1.0
  • RSS 0.91
  • RSS 0.92
  • RSS 2.0
    The following formats should be supported but they are not, right now:
  • RSS 1.0
    Perhaps a new ticket is the better solution for a new proposal, rather than a comment.

Simone Carletti - 01/Dec/07 12:42 PM
I forgot to say that my previous comment has been inspired by http://www.nabble.com/zend-feed-issue--tf4928553s16154.html#a14108105

Matthew Turland - 03/Feb/08 08:24 AM
The only difference between RSS 1.0 and other versions that is related to this issue is that item elements are not contained within the channel element. The attached file patch.diff modifies Zend_Feed_Rss to check for this and also patches the appropriate test in the test suite so that, without the patch to Zend_Feed_Rss, RSS 1.0 feed tests will fail.

Simone Carletti - 07/Feb/08 03:19 PM
Hi Matthew,
I gave a look at the patch you submitted a few days ago.

The following line doesn't really makes sense to me.

$this->assertTrue($feed->count() > 0);

_importRssValid method is an utility method and we cannot assume in advance the file he's going to fetch is not a valid empty feed.
I would create some valid RSS 1.0 unit tests instead.

The other part of the patch, the code fragment that should introduce RSS 1.0 compatibility it's fine, but I think it's incomplete.
Zend_Feed doesn't handle only feed import but it's able to create and edit a feed as well.

Did you think about how an imported RSS 1.0 feed will be printed out?
I assume it would be handled by Zend_Feed_Rss class but this library, as underlined by ZF-44, always returns an RSS 2.0 instance.
It means, an RSS 1.0 come in and an RSS 2.0 come out... I suppose this is not a good workflow.

What do you propose to fix this consequential issue?

For the sake of completeness, I'd like to share an additional though.
http://www.feedparser.org/ is, so far, the best feed parser written in python and probably one of the best feed parsers in the world.
Zend_Feed should probably learn something from this library!


Simone Carletti - 02/Jun/08 05:05 AM
Any news on this feature?
I would suggest to change status to unassigned if work is not in progress.