Grazie mille, sono già in fase di lettura![]()
Grazie mille, sono già in fase di lettura![]()
Ho controllato, io non ho namespace, forse il mio è più vecchio... Non importa, il concetto non cambia.
Basta registrare il namespace... ad esempio:
http://stackoverflow.com/questions/5...sing-simplexml
Buon lavoro!![]()
Niente ho provato a registrare il namespace ma non mi restituisce nulla:
$data = file_get_contents('file.txt');
$xml = new SimpleXMLElement($data);
$xml->registerXPathNamespace('a', 'http://www.xxxxxxx.com/webapi/data/');
foreach($xml->xpath('//a:nodes') as $event) {
print_r($event);
}
questo è il codice che ho scritto e questo è l'xml che mi ritrovo:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetMakeModelTreeResponse xmlns="http://www.xxxxxxxxxxxx.com/webapi/">
<response xmlns:a="http://www.xxxxxxxxx.com/webapi/data/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:request_id>03585780-c8e5-4913-8539-728c72058bf0</a:request_id>
<a:status>OK</a:status>
<a:build>
<a:number>2014.213.1006.5507</a:number>
<a:time_stamp>
<a:runtime>13.02.2014 20:44:20</a:runtime>
<a:service>13.02.2014 20:44:40</a:service>
</a:time_stamp>
</a:build>
<a:stx3_idpool>
<a:nodes>
<a:node>
<a:name>brand</a:name>
<a:id>51539</a:id>
<a:text>9ff</a:text>
<a:nodes>
<a:node>
<a:name>model</a:name>
<a:id>20284</a:id>
<a:text>Altro</a:text>
</a:node>
</a:nodes>
</a:node>
<a:node>