NYCPHP Meetup

NYPHP.org

[nycphp-talk] parsing RSS feeds using the Unserializer

Dallas DeVries dallas.devries at gmail.com
Mon Apr 4 09:21:15 EDT 2005


As you can see PHP did infact set the attribute of an object to have a colon 
in it with a corresponding value. Matching tags and parsing out the colons 
before I unserialize seems like an unecessary hack to avoid this but perhaps 
thats all I'm left with using this Class.

-Dallas

On Apr 4, 2005 8:02 AM, Hans Zaunere <lists at zaunere.com> wrote:
> 
>   I'm using the Unserialize pear class to parse out an RSS feed.
> 
> The problem I'm having is accessing the attribute with the colon in it. 
> Does anyone know how to access this element such as this? 
> 
> $options = array('complexType' => 'object',"parseAttributes" => true,
> "attributesArray" => false);
> $unserializer =& new XML_Unserializer($options);
> $status = $unserializer->unserialize($content);
> $data = $unserializer->getUnserializedData();
> foreach($data->channel->item as $item) {
> echo *$item->dc:creator;*
> 
> stdClass Object
> (
> [title] => Diamond Mind 2005 Predicted Standings Out
> [link] => http://ussmariner.com/?p=2378
> [comments] => http://ussmariner.com/?p=2378#comments
> [pubDate] => Thu, 31 Mar 2005 05:11:34 +0000
> [dc:creator] => DMZ
> [category] => General baseball
> [guid] => http://ussmariner.com/?p=2378
> 
>   Variables shouldn't have a colon in their name.
> 
>  http://www.php.net/manual/en/language.variables.php
> 
>  H
>  
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
> 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20050404/bc9c51a4/attachment.html>


More information about the talk mailing list