Edit report at https://bugs.php.net/bug.php?id=60021&edit=1
ID: 60021
Comment by: apostnikov at gmail dot com
Reported by: drgroove at gmail dot com
Summary: DOMDocument errors on HTML5 tags
Status: Suspended
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:
Related issue https://gitlab.gnome.org/GNOME/libxml2/-/issues/211
Previous Comments:
------------------------------------------------------------------------
[2021-07-21 00:48:53] apostnikov at gmail dot com
Still getting error on PHP 8.1 beta1
> Warning: DOMDocument::loadHTMLFile(): Tag header invalid in 1.html
------------------------------------------------------------------------
[2020-01-31 13:56:43] matthewheroux at gmail dot com
HTML5 has been the standard for years. This is negatively impacting PHP. Huge issue with keeping PHP
relevant and modern. It seems like such as achievable fix. A few entities, a different doc tag.
------------------------------------------------------------------------
[2016-02-04 07:45:46] cweiske@php.net
There wasn't even a HTML5 tag bug report for libxml2 yet; I've created it now:
https://bugzilla.gnome.org/show_bug.cgi?id=761534
------------------------------------------------------------------------
[2012-04-02 04:13:12] aharvey@php.net
It's a valid issue, but it's really an upstream one: libxml2's HTML parser only
supports HTML 4.01, so until that's extended to support HTML5 or a new parser is
added to libxml2, there's little to be done in PHP proper.
There are userspace parsers available: html5lib will parse documents according
to the HTML5 algorithm and give you a DOMDocument to work with.
Suspending for now. Given that the issue was first raised upstream in 2008, I
wouldn't hold your breath (although I suspect they'd love a patch).
------------------------------------------------------------------------
[2012-04-02 03:41:38] drgroove at gmail dot com
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 :)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=60021
--
Edit this bug report at https://bugs.php.net/bug.php?id=60021&edit=1