Processing google calendar feed (prefixed namespace issue)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello PHP people.  I'm trying to use simplexml to gather info from a
google calendar feed, and I've run into a problem where the google xml
has a namespace prefixed to some fields, and I don't know how to deal
with this colon.  For instance:

$xml_data = simplexml_load_file($xml);

foreach ($xml_data->entry as $item) {

print "<p>";
print $item->title;
print "<br />";
print $item->gd:when;
print "</p>";

}

Printing the $item->title works fine, but it chokes on the colon for
the tag gd:when.  Any ideas how I can extract data from an xml line
that looks like this:

<gd:when startTime='2007-07-29T12:00:00.000-04:00'
endTime='2007-07-29T20:00:00.000-04:00'></gd:when>

Thanks,

A.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux