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] Link to comment https://forums.phpfreaks.com/topic/171616-parsing-xml-unusual-xml-tags/ 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. Link to comment https://forums.phpfreaks.com/topic/171616-parsing-xml-unusual-xml-tags/#findComment-904959 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 Link to comment https://forums.phpfreaks.com/topic/171616-parsing-xml-unusual-xml-tags/#findComment-904986 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.