ILMV Posted August 24, 2009 Share Posted August 24, 2009 Hello all, I am trying to parse a Google Calendar feed into an object, but for some reason it is omitting certain tags: <gd:when startTime='2009-08-27T07:00:00.000Z' endTime='2009-08-27T14:00:00.000Z' /> The gd:when tag is pretty important in my application, and I am assuming it is being ignored because it doesn't follow the <tag></tag> format. I using simplexml. Can anyone help? Many thanks, ILMV[/code] Quote Link to comment Share on other sites More sharing options...
trq Posted August 24, 2009 Share Posted August 24, 2009 You might want to post some relevant code. Quote Link to comment Share on other sites More sharing options...
ILMV Posted August 24, 2009 Author Share Posted August 24, 2009 Oh dear... it seems as if I forgot to slap a closing code tag in there, sorry. $url="http://www.google.com/calendar/feeds/".$calendar_id."/".$magicCookie."/full?".$query_string; $sxe = new SimpleXMLElement($url, LIBXML_NOEMPTYTAG, TRUE); echo($sxe->asXML()); This is my current code, the 'LIBXML_NOEMPTYTAG' parameter specifies that any empty tags such as <gd:when /> will be converted to <gd:when></gd:when> Even with this code I still cannot access the gd:when tag (or any other tag formatted similarly), I have been trawling the net like crazy, and some people are suggesting it's because the tag contains a semi colon, a namespace? I have probably cheated slightly by replacing the gd:when tag with gd_when tag, this has solved the problem. Cheers, ILMV Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.