def htmlParseFile(filename, encoding):
    """parse an HTML file and build a tree. Automatic support for
      ZLIB/Compress compressed document is provided by default if
       found at compile-time. """
    ret = libxml2mod.htmlParseFile(filename, encoding)
    if ret is None:raise parserError('htmlParseFile() failed')
    return xmlDoc(_obj=ret)