# $Id$ use Test::More; use WebService::Validator::HTML::W3C; my $test_num = 5; if ( $ENV{ 'TEST_AUTHOR' } ) { $test_num = 6; } plan tests => $test_num; my $v = WebService::Validator::HTML::W3C->new( http_timeout => 10, detailed => 1, ); SKIP: { skip "XML::XPath not installed", $test_num if -f 't/SKIPXPATH'; ok($v, 'object created'); if ( $ENV{ 'TEST_AUTHOR' } ) { my $r = $v->validate('http://exo.org.uk/code/www-w3c-validator/invalid.html'); unless ($r) { if ($v->validator_error eq "Could not contact validator") { skip "failed to contact validator", 5; } } ok ($r, 'page validated'); } else { $v->num_errors( 1 ); $v->_content( qq{ http://exo.org.uk/code/www-w3c-validator/invalid.html http://validator.w3.org/ -//W3C//DTD XHTML 1.0 Strict//EN utf-8 false 4 11 7 end tag for "div" omitted, but OMITTAG NO was specified 70

You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

]]>
>]]>
11 7 XML Parsing Error: Opening and ending tag mismatch: div line 9 and body xmlwf

]]>
>]]>
12 7 XML Parsing Error: Opening and ending tag mismatch: body line 7 and html xmlwf

]]>
>]]>
12 7 XML Parsing Error: Premature end of data in tag html line 3 xmlwf

]]>
>]]>
1 W26">Mismatch between Public and System identifiers in the DOCTYPE declaration
} ); } my $err = $v->errors->[0]; isa_ok($err, 'WebService::Validator::HTML::W3C::Error'); is($err->line, 11, 'Correct line number'); is($err->col, 7, 'Correct column'); like($err->msg, qr/end tag for "div" omitted, but OMITTAG NO was specified/, 'Correct message'); }