Ejemplo n.º 1
0
 /**
  * Callback for XML parser
  *
  * @param   resource parser
  * @param   string name
  * @param   string attrs
  * @see     xp://xml.parser.XMLParser
  */
 public function onStartElement($parser, $name, $attrs)
 {
     parent::onStartElement($parser, $name, $attrs);
     switch ($this->_pathname()) {
         case '/rss/':
             $this->type = RDF_NEWS_RSS;
             break;
         case '/rdf:rdf/':
             $this->type = RDF_NEWS_RDF;
             break;
         case '/rdf:rdf/channel/':
         case '/rss/channel/':
             $this->channel->node = $this->_objs[$this->_cnt];
             break;
         case '/rdf:rdf/image/':
         case '/rss/image/':
             $this->image->node = $this->_objs[$this->_cnt];
             break;
         case '/rdf:rdf/item/':
         case '/rss/channel/item/':
             $this->items[] = new \stdClass();
             $this->items[sizeof($this->items) - 1]->node = $this->_objs[$this->_cnt];
             break;
     }
 }