
W3C::XHTML::HTMLCompatChecker - The W3C XHTML/HTML Compatibility Checker
Checks XHTML documents (online or local) for compatibility with legacy HTML User-Agents.

W3C::XHTML::HTMLCompatChecker can be used to check whether some content written in XHTML can safely be served as HTML (text/html) to User-Agents that can process HTML,
but not XML.
This checker follows the guidelines for compatibility found in the XHTML 1.0 Specification,
for XHTML 1.0 content served "as HTML" (i.e with the media type text/html).
http://www.w3.org/TR/xhtml1/#guidelines
This checker also has a "any xhtml" mode, where any XHTML document, regardless of its media type, will be checked.

use W3C::XHTML::HTMLCompatChecker;
my $checker = W3C::XHTML::HTMLCompatChecker->new();
my @messages = $checker->check_uri("http://... ");

$checker = W3C::XHTML::HTMLCompatChecker->new
$checker->check_uri("http://... ")
Check an online XHTML 1.0 document, served as "text/html" media type, for incompatibilities with legacy HTML.
$checker->check_uri("http://... ", any_xhtml=>1)
Check any online XHTML document, regardless of doctype and media type for incompatibilities with legacy HTML.
$checker->check_content("<!DOCTYPE html ...")
Check an XHTML 1.0 document (as string), for incompatibilities with legacy HTML.
$checker->check_content("<!DOCTYPE html ...", any_xhtml=>1)
Check any XHTML document (as string), for incompatibilities with legacy HTML.
The checker will return an array of hashes, each hash representing an error/warning/info, as follows:
Severity of message: Error, Warning, Info, Hint or Abort
line where observation was made
(may be undefined for Abort messages)
column/offset where observation was made
(may be undefined for Abort messages)
Explanation of the message
Identifier for the relevant compatibility guideline
Example: 1 is http://www.w3.org/TR/xhtml1/#C_1
Title of the relevant guideline
Example: Element Minimization and Empty Element Content
If the any_xhtml parameter is not set, the checker will return a single Abort message if:
text/html (N/A for check_content), orIf the any_xhtml parameter is set, the checker will return a single Abort message if the document is not well-formed XML.

Public bug-tracking interface at http://www.w3.org/Bugs/Public/

Developed as one of the Open Source projects at The World Wide Web Consortium http://www.w3.org/Status
Based on original code donated by Björn Höhrmann.