0
下面你可以看到我想要解析的XML文件,但它似乎并没有深入到 。用Dom解析XML
我想要得到Kunde
节点,并获取其子节点的值。这是 mycode的样子至今:
foreach($xml->childNodes AS $test){
$m = new Karte();
$m->setPDateCreate($test->childNodes->item(0)->nodeValue);
$m->setPDateModify($test->childNodes->item(1)->nodeValue);
$m->setPDateAcess($test->childNodes->item(2)->nodeValue);
}
现在的问题是,第一个项目都有它的所有内部Kunde
节点和它们的值。
这里的XML文件:
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<JCExport xmlns="https://whatever/">
<Kunden>
<Kunde>
<KDateCreate>26.06.2013 17:25:55</KDateCreate>
<KDateModify>26.06.2013 17:25:55</KDateModify>
<KDateAccess>26.06.2013 17:25:55</KDateAccess>
</Kunde>
<Kunde>
<KDateCreate>26.06.2013 17:25:55</KDateCreate>
<KDateModify>26.06.2013 17:25:55</KDateModify>
<KDateAccess>26.06.2013 17:25:55</KDateAccess>
</Kunde>
<Kunde>
<KDateCreate>26.06.2013 17:25:55</KDateCreate>
<KDateModify>26.06.2013 17:25:55</KDateModify>
<KDateAccess>26.06.2013 17:25:55</KDateAccess>
</Kunde>
<Kunde>
<KDateCreate>26.06.2013 17:25:55</KDateCreate>
<KDateModify>26.06.2013 17:25:55</KDateModify>
<KDateAccess>26.06.2013 17:25:55</KDateAccess>
</Kunde>
<Kunde>
<KDateCreate>26.06.2013 17:25:55</KDateCreate>
<KDateModify>26.06.2013 17:25:55</KDateModify>
<KDateAccess>26.06.2013 17:25:55</KDateAccess>
</Kunde>
</Kunden>
</JCExport>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>