Edit report at https://bugs.php.net/bug.php?id=60021&edit=1
ID: 60021
Comment by: drgroove at gmail dot com
Reported by: drgroove at gmail dot com
Summary: DOMDocument errors on HTML5 tags
Status: Open
Type: Bug
Package: DOM XML related
Operating System: Mac OS X
PHP Version: 5.3.8
Block user comment: N
Private report: N
New Comment:
Any progress on resolving this? Working w/ DOMDocument and HTML5 is a huge
pain in the butt right now; you have to write custom error handlers for things
like <header/>, <nav/>, and other HTML5 tags.
Also, just entered a bug report for SimpleXML (where tags w/ both attributes
and text have their attributes dropped). Both DOMDocument and SimpleXML need
updates... it's very difficult to work w/ HTML and XML when both of these APIs
have so many issues.
Thanks for your help everyone :)
Previous Comments:
------------------------------------------------------------------------
[2011-10-09 05:24:13] drgroove at gmail dot com
Description:
------------
Loading HTML documents through DOMDocument->loadHTMLFile(), when the HTML file
contains certain new HTML5 tags, results in this error:
Warning: DOMDocument::loadHTMLFile() [domdocument.loadhtmlfile]: Tag footer
invalid in {file path here}
<footer> is a new HTML5 tag. The error appears for other HTML5 tags as well
(eg, <header>).
Test script:
---------------
// TEST.html
<header>
Some text here
</header>
// TEST.php
<?php
$dom_document = new DOMDocument();
$dom_document->loadHTMLFile("TEST.html");
?>
Expected result:
----------------
DOMDocument should not fail on HTML5 tags.
Actual result:
--------------
Warning: DOMDocument::loadHTMLFile() [domdocument.loadhtmlfile]: Tag footer
invalid in {file path here}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60021&edit=1