I've updated to Xerte version 2.1 (git git-82-g70282af).
I've have these lines which I assume is the fix:
Code:
if (!$this->isValidXml($xml)) {
// Try and fix it ?
_debug("Invalid XML found; trying to repair");
$ok = $this->fixXmlFile($name);
if ($ok === false) {
// Could not fix it!
_debug("Could not fix up the xml file with $name; consult error logs etc.");
}
else {
// reload.
$xml = file_get_contents($name);
}
}
$this->xml = simplexml_load_string($xml);
I do a
Code:
var_dump($this->xml);
after the fix and this returns
.
The output of
Code:
libxml_get_errors();
Code:
array(4) {
[0]=> object(LibXMLError)#8 (6)
{ ["level"]=> int(3)
["code"]=> int(68)
["column"]=> int(2321)
["message"]=> string(27) "xmlParseEntityRef: no name "
["file"]=> string(0) ""
["line"]=> int(1)
}
[1]=> object(LibXMLError)#20 (6)
{ ["level"]=> int(3)
["code"]=> int(68)
["column"]=> int(3381)
["message"]=> string(27) "xmlParseEntityRef: no name "
["file"]=> string(0) ""
["line"]=> int(1)
}
[2]=> object(LibXMLError)#19 (6)
{ ["level"]=> int(3)
["code"]=> int(68)
["column"]=> int(2321)
["message"]=> string(27) "xmlParseEntityRef: no name "
["file"]=> string(0) ""
["line"]=> int(1)
}
[3]=> object(LibXMLError)#18 (6)
{ ["level"]=> int(3)
["code"]=> int(68)
["column"]=> int(3381)
["message"]=> string(27) "xmlParseEntityRef: no name "
["file"]=> string(0) ""
["line"]=> int(1)
}
}
This is the output of the debug.log file which I have anonymised:
Code:
2013-12-02 16:42:37 \website_code\php\xmlInspector.php111Trying to simplexml_load_file : USER-FILES/357-staff-Nottingham/preview.xml
2013-12-02 16:42:37 \website_code\php\xmlInspector.php95Error detected in XML : : line 1, col:2321, message:xmlParseEntityRef: no name
, : line 1, col:3381, message:xmlParseEntityRef: no name
2013-12-02 16:42:37 \website_code\php\xmlInspector.php132Invalid XML found; trying to repair
2013-12-02 16:42:37 \xerte\website_code\php\xmlInspector.php51We were able to fixup the file : USER-FILES/357-staff-Nottingham/preview.xml
Any suggestions?