Page 1 of 1

XML parsing

Posted: Wed Sep 15, 2010 11:38 am
by ginocyber
Hi everyone,

How would I parse for the section information="info_2" from the data_1 tag

<?xml version="1.0" encoding="utf-16"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://nowhere.com/wsdl"><soap:Body><response status="complete" version="46" resource_type="data_1" ns="username" op_type="get_data">
<data_1 id="ID 1" information="info_2" ip_address="info_3" />
</response></soap:Body></soap:Envelope>

?>

Thanks

GC

Re: XML parsing

Posted: Wed Sep 15, 2010 1:32 pm
by Jonah Bron

Code: Select all

$xml->documentElement->getElementsByTagName('data_1')->item(0)->getAttribute('information');

Re: XML parsing

Posted: Wed Sep 15, 2010 2:49 pm
by ginocyber
Thanks Jonah.

That did the trick.