Hola @forecast, como te dice
abimaelrc tienes que usar namespaces ejemplo:
Código PHP:
Ver original<?php
$xml = simplexml_load_file('http://ws.audioscrobbler.com/2.0/?method=geo.getevents&location=madrid&api_key=b25b959554ed76058ac220b7b2e0a026'); $geo = $xml->getNamespaces(true);
$xml->registerXPathNamespace('g', $geo['geo']);
$lat = $xml->xpath('//g:lat');
$long = $xml->xpath('//g:long');
foreach ($lat as $c => $v) {
echo $v . ' ' . $long[$c] . '<br />';
}
Así tienes todas las latitudes y longitudes. Saludos