I have the following xml code:
File 1.xml
<?xml version="1.0" encoding="utf-8"?>
<DataSet xmlns="">
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<dsAanbod>
<Pand diffgr:id="Pand1" msdata:rowOrder="0" diffgr:hasChanges="inserted">
<PandID>231384</PandID>
</Pand>
</dsAanbod>
</diffgr:diffgram>
</DataSet>
How can i read the data between
I had the following php code
<?php
$xml_url = "1.xml";
$xml = simplexml_load_file($xml_url);
foreach ($xml as $entry){
//Use that namespace
$namespaces = $entry->getNameSpaces(true);
//Now we don't have the URL hard-coded
$diffgr = $entry->children($namespaces['diffgr']);
echo $diffgr->diffgram->dsAanbod->Pand->PandID;
}
?>
But that doesn't work.
Can somebody help me to get acces to a node where it is a child of an namespace element.
Kind Regards