Forum Moderators: open
<Result precision="address">
<Latitude></Latitude>
<Longitude></Longitude>
<Address></Address>
<City></City>
<State></State>
<Zip></Zip>
<Country></Country>
</Result>
I want to loop through the geocoder to catch only those with an address precision (others include street, zip, city, state). I tried:
$xml = new SimpleXMLElement($url);
$xml1 = $xml->Result->precision="Address";
but obviously that didn't work. Any help would be appreciated!
However, I use XSLT to produce JSON code, which I fetch in an AJAX callback. I don't do the direct XML parsing that you do. XML->XSLT->JSON works quite well for me. It's basically a direct route between the XML and the JavaScript.
If you know how to use SourceForge Subversion [sourceforge.net], I can direct you to a project that contains these scripts, and that runs them from PHP.