SimpleXML: Working with XML containing namespaces

KevinP

New Member
I am trying to get to the geo information off the google-picasa API. This is the original XML:\[code\]<georss:where> <gml:Point> <gml:pos>35.669998 139.770004</gml:pos> </gml:Point></georss:where>\[/code\]I already have come this far, with:\[code\]$ns_geo=$item->children($namespace['georss']);$geo=$ns_geo->children($namespace['gml']);\[/code\]\[code\]var_dump($geo)\[/code\] will output\[code\]object(SimpleXMLElement)#34 (1) { ["Point"]=> object(SimpleXMLElement)#30 (1) { ["pos"]=> string(18) "52.373801 4.890935" } } \[/code\]but\[code\]echo (string)$geo->position or (string)$geo->position->pos; \[/code\]will give me nothing. Is there something obvious that i am doing wrong?
 
Back
Top