.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Test::HTML::W3C 3pm" .TH Test::HTML::W3C 3pm "2021-01-07" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test::HTML::W3C \- Perform W3C HTML validation testing .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 5 \& use Test::HTML::W3C tests => $test_count; \& # or \& use Test::HTML::W3C \*(Aqshow_detail\*(Aq; \& # or when using both \& use Test::HTML::W3C tests => $test_count, \*(Aqshow_detail\*(Aq; \& \& is_valid_markup($my_html_scalar); \& \& is_valid_file("/path/to/my/file.html"); \& \& is_valid("http://example.com"); \& \& # Get the underlying WebService:;Validator::W3C::HTML object \& my $validator = validator(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The purpose of this module is to provide a wrapper around the W3C that works with the Test::More testing framework. .SH "ABUSE" .IX Header "ABUSE" Please keep in mind that the W3C validation pages and services are a shared resource. If you plan to do many many tests, please consider using your own installation of the validation programs, and then use your local install by modifying the local validtor: .PP .Vb 2 \& my $v = validator(); \& $v\->validator_uri($my_own_validator); .Ve .PP See the documentation for WebService:;Validator::W3C::HTML and the W3C's site at http://validator.w3.org/ for details .IP "\fBvalidator()\fR;" 4 .IX Item "validator();" \&\fBDescription:\fR Returns the underlying WebService::Validator::HTML::W3C object .Sp \&\fBParameters:\fR None. .Sp \&\fBReturns:\fR \f(CW$validator\fR .IP "\fBplan()\fR;" 4 .IX Item "plan();" \&\fBDescription:\fR Access to the underlying \f(CW\*(C`plan\*(C'\fR method provided by Test::Builder. .Sp \&\fBParameters:\fR As per Test::Builder .ie n .IP "is_valid_markup($markup[, $name]);" 4 .el .IP "is_valid_markup($markup[, \f(CW$name\fR]);" 4 .IX Item "is_valid_markup($markup[, $name]);" \&\fBDescription:\fR is_valid_markup tests whether the text in the provided scalar value correctly validates according to the W3C specifications. This is useful if you have markup stored in a scalar that you wish to test that you might get from using \s-1LWP\s0 or WWW::Mechanize for example... .Sp \&\fBParameters:\fR \f(CW$markup\fR, a scalar containing the data to test, \f(CW$name\fR, an optional descriptive test name. .Sp \&\fBReturns:\fR None. .ie n .IP "is_valid_file($path[, $name]);" 4 .el .IP "is_valid_file($path[, \f(CW$name\fR]);" 4 .IX Item "is_valid_file($path[, $name]);" \&\fBDescription:\fR is_valid_file works the same way as is_valid_markup, except that you can specify the text to validate with the path to a filename. This is useful if you have pregenerated all your \s-1HTML\s0 files locally, and now wish to test them. .Sp \&\fBParameters:\fR \f(CW$path\fR, a scalar, \f(CW$name\fR, an optional descriptive test name. .Sp \&\fBReturns:\fR None. .ie n .IP "is_valid($url[, $name]);" 4 .el .IP "is_valid($url[, \f(CW$name\fR]);" 4 .IX Item "is_valid($url[, $name]);" \&\fBDescription:\fR is_valid, again, works very similarly to the is_valid_file and is_valid_file, except you specify a document that is already online with its \&\s-1URL.\s0 This can be useful if you wish to periodically test a website or webpage that dynamically changes over time for example, like a blog or a wiki, without first saving the html to a file using your browswer, or a utility such as wget. .Sp \&\fBParameters:\fR \f(CW$url\fR, a scalar, \f(CW$name\fR, an optional descriptive test name. .Sp \&\fBReturns:\fR None. .IP "diag_html($url);" 4 .IX Item "diag_html($url);" \&\fBDescription:\fR If you want to display the actual errors reported by the service for a particular test, you can use the diag_html function. Please note that you must have imported 'show_detail' for this to work properly. .Sp .Vb 1 \& use Test::HTML::W3C \*(Aqshow_detail\*(Aq; \& \& is_valid_markup(", "My simple test") or diag_html(); .Ve .Sp \&\fBParameters:\fR \f(CW$url\fR, a scalar. .Sp \&\fBReturns:\fR None. .SH "SEE ALSO" .IX Header "SEE ALSO" Test::Builder::Module for creating your own testing modules. .PP Test::More for another popular testing framework, also based on Test::Builder .PP Test::Harness for detils about how test results are interpreted. .SH "AUTHORS" .IX Header "AUTHORS" Victor with inspiration from the authors of the Test::More and WebService::Validator::W3C:HTML modules. .SH "BUGS" .IX Header "BUGS" See \fIhttp://rt.cpan.org\fR to report and view bugs. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2006 by Victor . .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP See \fIhttp://www.perl.com/perl/misc/Artistic.html\fR