Processing google calendar feed (prefixed namespace issue)

From: Date: Fri, 15 Jun 2007 15:36:35 +0000
Subject: Processing google calendar feed (prefixed namespace issue)
Groups: php.db 
Request: Send a blank email to php-db+get-43686@lists.php.net to get a copy of this message
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.

« previous php.db (#43686) next »