J'essaye d'analyser la réponse xml de http://api.hostip.info/?ip=12.215.42.19 avec SimpleXML mais je n'arrive pas à le faire fonctionner.hostip.info - Parse réponse API avec SimpeXML
Réponse
<?xml version="1.0" encoding="ISO-8859-1" ?>
<HostipLookupResultSet version="1.0.1" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.hostip.info/api/hostip-1.0.1.xsd">
<gml:description>This is the Hostip Lookup Service</gml:description>
<gml:name>hostip</gml:name>
<gml:boundedBy>
<gml:Null>inapplicable</gml:Null>
</gml:boundedBy>
<gml:featureMember>
<Hostip>
<ip>12.215.42.19</ip>
<gml:name>Sugar Grove, IL</gml:name>
<countryName>UNITED STATES</countryName>
<countryAbbrev>US</countryAbbrev>
<!-- Co-ordinates are available as lng,lat -->
<ipLocation>
<gml:pointProperty>
<gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:coordinates>-88.4588,41.7696</gml:coordinates>
</gml:Point>
</gml:pointProperty>
</ipLocation>
</Hostip>
</gml:featureMember>
</HostipLookupResultSet>
que quelqu'un peut me aider à accéder par exemple hostip> ipLocation> pointProperty> Point> Coordonnées
Merci à l'avance!
en double possible de [SimpleXML: Travailler avec les espaces de noms contenant XML ] (http://stackoverflow.com/questions/2014835/simplexml-working-with-xml-containing-namespaces) – Gordon
grand je pense que cela aidera :) – n00b