I currently have a problem reading in XHTML as the XML parser doesn't recognise HTML character entities so:
<?php
$text = <<<EOF
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Entities are Causing Me Problems</title>
</head>
<body>
<p>Copyright © 2010 Some Bloke</p>
</body>
</html>
EOF;
$imp = new DOMImplementation ();
$html5 = $imp->createDocumentType ('html', '', '');
$doc = $imp->createDocument ('http://www.w3.org/1999/xhtml', 'html', $html5);
$doc->loadXML ($text);
header ('Content-Type: application/xhtml+xml; charset: utf-8');
echo $doc->saveXML ();
Results in:
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Entity 'copy' not defined in Entity, line: 8 in testing.php on line 19
How can I fix this while allowing myself to serve pages as XHTML5?