1

我正在使用 xpath 来解析来自 icecat 的 xml 文件

编码:

$xml = new DOMDocument;
$xml->load('140.xml');
$xml = new DOMXpath($xml);
$hasil = $xml->query('//ICECAT-interface/Product/ProductFeature');
$namafitur = $xml->query('//ICECAT-interface/Product/ProductFeature/Feature/Name');
foreach($namafitur as $value) {
  echo $value->getAttribute('Value'), ": <br>";
}
foreach($hasil as $value) {
  echo $value->getAttribute('Presentation_Value'), ": <br>";
}

我希望将结果分别组合成一行

谁能帮我?

4

0 回答 0