製品のXMLファイルを解析するスクリプトがありますが、解析のコツがわからないようです。私はコードを持っています:
$file = $shop_path.'datafeeds/MC-B01.xml';
$xml = simplexml_load_file($file, null, LIBXML_NOCDATA);
$items = $xml->Items;
for($i = 0; $i < 17000; $i++) {
$name = $items[$i]->Product_Name;
echo $name.'<br />';
}
しかし、私はあらゆる種類の奇妙なエラーがスローされます:
PHP Warning: in file C:/xampp/htdocs/trow/tools/rip.php on line 188: simplexml_load_file() [function.simplexml-load-file]: ./../datafeeds/MC-B01.xml:172439: parser error : CData section not finished
PHP Warning: in file C:/xampp/htdocs/trow/tools/rip.php on line 188: simplexml_load_file() [function.simplexml-load-file]: ons, in or out of the water. Cleanup is a snap after the fun with Pipedream
PHP Warning: in file C:/xampp/htdocs/trow/tools/rip.php on line 188: simplexml_load_file() [function.simplexml-load-file]: ^
PHP Warning: in file C:/xampp/htdocs/trow/tools/rip.php on line 188: simplexml_load_file() [function.simplexml-load-file]: ./../datafeeds/MC-B01.xml:172439: parser error : PCDATA invalid Char value 3
PHP Warning: in file C:/xampp/htdocs/trow/tools/rip.php on line 188: simplexml_load_file() [function.simplexml-load-file]: ons, in or out of the water. Cleanup is a snap after the fun with Pipedream
PHP Warning: in file C:/xampp/htdocs/trow/tools/rip.php on line 188: simplexml_load_file() [function.simplexml-load-file]: ^
PHP Warning: in file C:/xampp/htdocs/trow/tools/rip.php on line 188: simplexml_load_file() [function.simplexml-load-file]: ./../datafeeds/MC-B01.xml:172439: parser error : Sequence ']]>' not allowed in content
奇妙な部分は、エラーが示すテキストを含むCDataブロックが正しく形成されたブロックのように見えることです。(大人の性格のため、ここに投稿することはできません。)
助言がありますか?