Valor Retornado

Erros

If an empty string is passed as the filename
or an empty file is named, a warning will be generated. This warning
is not generated by libxml and cannot be handled using libxml's error handling
functions.

This method may be called statically, but will issue an E_STRICT error.

While malformed HTML should load successfully, this function may generate E_WARNING errors when it encounters bad markup. libxml's error handling functions may be used to handle these errors.

This puts the HTML into a DOM object which can be parsed by individual tags, attributes, etc.. Here is an example of getting all the 'href' attributes and corresponding node values out of the 'a' tag. Very cool....

The options for surpressing errors and warnings will not work with this as they do for loadXML()e.g.<?php$doc->loadHTMLFile($file, LIBXML_NOWARNING | LIBXML_NOERROR);?>will not work.you must use:<?phplibxml_use_internal_errors(true);$doc->loadHTMLFile($file);?>and handle the exceptions as neccesarry.

Note that this function doesn't parse the individual tags WITHIN the html file - it's all loaded as a "black box", and you end up with an XML widget that comprises nothing but the complete chunk of HTML.

I was hoping it would function as a sort of HTML-validator/parser, but that doesn't seem to be the case.