Your XML parser is not lying. This is an invalid (not even correct) document that you cannot load with anything.
rsquo - HTML, XML. XML-, -, (amp, lt, gt, quot apos), DTD, <!DOCTYPE>. ( XHTML.)
, , , , XML. (’) β UTF-8.
, , :
$xml= file_get_contents($_FILES['file']['tmp_name']);
$xml= str_replace('’', '’', $xml);
$dom->loadXML(xml);
XML- XML, rsquo, . :
function only_html_entity_decode($match) {
if (in_array($match[1], array('amp', 'lt', 'gt', 'quot', 'apos')))
return $match[0];
else
return html_entity_decode($match[0], ENT_COMPAT, 'UTF-8');
}
$xml= preg_replace_callback('/&(\w+);/', 'only_html_entity_decode', $xml);
, &\w+; , , CDATA PI, . , , , , .
, , , html_entity_decode , XML, , & <.
, -, loadHTML().