ZF-3128: Zend_Feed_Rss::__wakeUp improvement

Description

Hi,

First, this is my first post... If something is wrong in my issue tracker usage, let me know. Actually, Zend_Feed can't read del.icio.us feed, because it uses RSS 1.0. So I improve Zend_Feed_Rss::__wakeUp method as below:


        // Check for RSS 1.0 feed
        if ($doc->getElementsByTagName('RDF')->item(0)) {
            $this->_element = $doc->getElementsByTagName('RDF')->item(0);
        } else {
            // Find the base channel element and create an alias to it.
            $this->_element = $doc->getElementsByTagName('channel')->item(0);
        }

        if (!$this->_element) {
            /** 
             * @see Zend_Feed_Exception
             */
            require_once 'Zend/Feed/Exception.php';
            throw new Zend_Feed_Exception('No root  or  element found, cannot parse channel.');
        }

The changes are in the 'RDF' item check and in the Zend_Feed_Exception message. Hope this is useful and apologize for any errors.

Comments

(you should use the ``` style in the bug tracker, to make your code more readable, see http://framework.zend.com/issues/secure/… )

lol, I meant the { code } block (if I write it, it wouldnt get shown, how silly I feel .... )

I guess the better way to correct this trouble is create a new class to read RSS 1.0/RDF feeds adequately, cause the changes I made generate some wrong behaviors. See below:


// RSS 2.0
var_dump($rss->description()); // returns a object

// RSS 1.0
var_dump($rss->description()); // returns null

So I'm creating a class Zend_Feed_Rss-based. How new classes can be submitted to ZF?

Please evaluate and categorize as necessary.

There is much more in Zend_Feed to be changed to make the library compatible with RSS 1.0 (and RDF based) files.

Zend_Feed not only consumes feeds, but creates them as well. I exposed a list of common issues to care of in ZF-405.

To not split discussions and lost valuable suggestions, I would flag this issue as duplicate of ZF-405. What do you think?

Closing as duplicate of ZF-405.