Tester\DomQuery invalid tag in Entity

5 years ago

zimmi
Member | 95
+
0
-

Hi,
I'm using <nav> inside my HTML code and I get E_WARNING: DOMDocument::loadHTML(): Tag nav invalid in Entity complaining about the code not being valid. Is it possible to use this element with DomQuery?

I know I can use $dom = @Tester\DomQuery::fromHtml($html);, but I would rather not.

Thanks.

5 years ago

Jan Tvrdík
Nette guru | 2549
+
0
-
$libxmlPreviousState = libxml_use_internal_errors(true);
Tester\DomQuery::fromHtml($html)
libxml_clear_errors();
libxml_use_internal_errors($libxmlPreviousState);

5 years ago

zimmi
Member | 95
+
0
-

Thanks a lot!

5 years ago

zimmi
Member | 95
+
0
-

@Jan Tvrdík may it be php version related issue? It's running fine on PHP 5.3, but I'm getting the error on PHP Version 5.5.9–1.