W3C::LogValidator::HTMLValidator - [W3C Log Validator] Batch HTML validation (using the W3C Markup Validator)
use W3C::LogValidator::HTMLValidator; my %config = ("verbose" => 2); my $validator = W3C::LogValidator::HTMLValidator->new(\%config); $validator->uris('http://www.w3.org/Overview.html', 'http://www.yahoo.com/index.html'); my %results = $validator->process_list;
This module is part of the W3C::LogValidator suite, and checks HTML validity of a given document via the W3C HTML validator service.
Constructs a new W3C::LogValidator:HTMLValidator processor.
W3C::LogValidator:HTMLValidator
You might pass it a configuration hash reference (see "config_module" in W3C::LogValidator and W3C::LogValidator::Config)
$validator = W3C::LogValidator::HTMLValidator->new(\%config);
Processes a list of sorted URIs through the W3C Markup Validator.
The list can be set uris. If the $val was given a config has when constructed, and if the has has a "tmpfile" key, process_list will try to read this file as a hash of URIs and "hits" (popularity) with DB_File.
uris
process_list
Returns a result hash. Keys for this hash are:
name (string): the name of the module, i.e "HTMLValidator" intro (string): introduction to the processing results thead (array): headers of the results table trows (array of arrays): rows of the results table outro (string): conclusion of the processing results
Returns a list of URIs to be processed (unless the configuration gives the location for the hash of URI/hits berkeley file, see process_list If an array is given as a parameter, also sets the list of URIs and returns it.
Given a list of URIs of documents to process, returns a subset of this list containing the URIs of documents the module supposedly can handle. The decision is made based on file extensions (see auth_ext), content-type (see HEAD_check) , and the setting for ExcludedAreas
auth_ext
HEAD_check
Checks whether a document with no extension is actually an HTML/XML document through an HTTP HEAD request returns 1 if the URI is of an expected content-type, 0 otherwise
Returns the file extensions (space separated entries in a string) supported by the Module. Public method accessing $self->{AUTH_EXT}, itself coming from either the AuthorizedExtensions configuration setting, or a default value
Sets / Returns whether the document being processed has been found to be valid or not. If an argument is given, sets the variable, otherwise returns the current variable.
Sets / Returns the number of validation errors for the document being processed. If an argument is given, sets the variable, otherwise returns the current variable.
Sets / Returns whether the module was able to process validation of the current document successfully (regardless of valid/invalid result) If an argument is given, sets the variable, otherwise returns the current variable.
Sets / Returns all HTTP headers returned by the markup validator when attempting to validate the current document. If an argument is given, sets the variable, otherwise returns the current variable.
Resets all validation variables to 'undef'. In effect, prepares the processing module to the handling of a new document.
Public bug-tracking interface at http://www.w3.org/Bugs/Public/
Olivier Thereaux <ot@w3.org>
W3C::LogValidator, perl(1). Up-to-date complete info at http://www.w3.org/QA/Tools/LogValidator/
To install W3C::LogValidator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm W3C::LogValidator
CPAN shell
perl -MCPAN -e shell install W3C::LogValidator
For more information on module installation, please visit the detailed CPAN module installation guide.