Jump to content

Archived

This topic is now archived and is closed to further replies.

dragongamer

simple xml and :

Recommended Posts

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?

Share this post


Link to post
Share on other sites
A colon is used for namespaces. Try one of the namespace methods.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.