hi!
I've got a strange issue with the parser. The same PHP function with the same XML file works fine in Windows, but throws an exception in CentOS. The exception is inside expandSimpleXml() and the exact error message is "XMLReader::expand(): /home/mybooklist/xml/-1.xml:1897: parser error : PCDATA invalid Char value 209". Cannot understand this at all, but as a workaround, I want to skip the problem node that causes that error and continue parsing, but it just exits. Here is the code of callback function:
protected function callbackOffer($reader)
{
try {
$element = $reader->expandSimpleXml(); // copy of the current node as a SimpleXMLElement object
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
return true;
}
... parsing $element there
I thought returning true should continue parsing, but it is not. Is it possible to continue parsing after that exception? How?
hi! I've got a strange issue with the parser. The same PHP function with the same XML file works fine in Windows, but throws an exception in CentOS. The exception is inside expandSimpleXml() and the exact error message is "XMLReader::expand(): /home/mybooklist/xml/-1.xml:1897: parser error : PCDATA invalid Char value 209". Cannot understand this at all, but as a workaround, I want to skip the problem node that causes that error and continue parsing, but it just exits. Here is the code of callback function:
... parsing $element there
I thought returning true should continue parsing, but it is not. Is it possible to continue parsing after that exception? How?
Thanks!