dragongamer Posted August 24, 2006 Share Posted August 24, 2006 hi, i have a xml file that i need to be prahsed, via php's 5 simplexml_load_file, the only problem is that i need to get the atraibues, E.G[code]->foo['OMG'][/code]but the line that has the data is[code]<yweather:condition text="Fair" code="34" temp="64" date="Thu, 24 Aug 2006 6:50 pm BST" />[/code]and if i try [code]$xml->channel->item->yweather:condition['code'];[/code]i simply get[quote]Parse error: syntax error, unexpected ':', expecting ',' or ';'[/quote]is there a work around or very simple fix for this? Link to comment https://forums.phpfreaks.com/topic/18568-simple-xml-and/ Share on other sites More sharing options...
effigy Posted August 24, 2006 Share Posted August 24, 2006 A colon is used for namespaces. Try one of the namespace methods. Link to comment https://forums.phpfreaks.com/topic/18568-simple-xml-and/#findComment-80004 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.