ID: 42391 User updated by: linus dot martensson at elplan-gm dot se -Summary: DOM handles doctype incorrectly. Reported By: linus dot martensson at elplan-gm dot se Status: Open Bug Type: DOM XML related Operating System: Linux - Ubuntu Feisty Fawn PHP Version: 5.2.3 New Comment:
Retouched the summary. Previous Comments: ------------------------------------------------------------------------ [2007-08-22 21:45:43] linus dot martensson at elplan-gm dot se Description: ------------ The DOM parser fails to parse SEVERAL valid xhtml entities, such as » and ⇒, even though both are specified in http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent and http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent. These two files (among others) are referred to by the specified doctype definition, xhtml1-strict.dtd. The parser is obviously not taking all valid xhtml entities into account, which is a serious problem. Reproduce code: --------------- <?php $d = new DOMDocument(); if(!$d->loadXML('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html><head></head><body>⇒⇒</body></html>')) var_dump(libxml_get_last_error()); Expected result: ---------------- No output, should correctly parse the document and store the two entities in the DOMDocument. Actual result: -------------- When the libXml error is retrieved, this is the apparent error: Line 1: Entity 'rArr' not defined. The parse is aborted. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42391&edit=1