J
Jesse Sheidlower
I've just started doing some real testing on my scripts,
and I've run into a problem already. I am trying to test
a generated Web page using WWW::Mechanize and Test::HTML::Lint,
following some posted suggestions from Andy Lester. But I'm
getting an error that doesn't seem to be described in the
Lint docs.
I generate my page using standard CGI.pm functions (via
Template Toolkit), starting with CGI::header and
CGI::start_html, which generates text beginning:
---
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>...
---
I then point at this the following test script:
---
#!/usr/bin/perl -w
use Test::More qw(no_plan);
use Test::HTML::Lint;
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
isa_ok( $mech, "WWW::Mechanize" ) or die;
$mech->get( "http://127.0.0.1/cgi-bin/test/search.cgi" );
is ($mech->status, 200, "Fetched OK" );
html_ok( $mech->content, "Login page HTML" );
---
which produces the following test results:
---
ok 1 - The object isa WWW::Mechanize
ok 2 - Fetched OK
not ok 3 - Login page HTML
# Failed test (02libloading.t at line 10)
# Errors: Login page HTML
# (7:1) Unknown attribute "xmlns" for tag <html>
# (7:1) Unknown attribute "xml:lang" for tag <html>
1..3
# Looks like you failed 1 tests of 3.
---
What do I need to do to get Lint to accept this as valid HTML?
Thanks.
Jesse Sheidlower
and I've run into a problem already. I am trying to test
a generated Web page using WWW::Mechanize and Test::HTML::Lint,
following some posted suggestions from Andy Lester. But I'm
getting an error that doesn't seem to be described in the
Lint docs.
I generate my page using standard CGI.pm functions (via
Template Toolkit), starting with CGI::header and
CGI::start_html, which generates text beginning:
---
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>...
---
I then point at this the following test script:
---
#!/usr/bin/perl -w
use Test::More qw(no_plan);
use Test::HTML::Lint;
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
isa_ok( $mech, "WWW::Mechanize" ) or die;
$mech->get( "http://127.0.0.1/cgi-bin/test/search.cgi" );
is ($mech->status, 200, "Fetched OK" );
html_ok( $mech->content, "Login page HTML" );
---
which produces the following test results:
---
ok 1 - The object isa WWW::Mechanize
ok 2 - Fetched OK
not ok 3 - Login page HTML
# Failed test (02libloading.t at line 10)
# Errors: Login page HTML
# (7:1) Unknown attribute "xmlns" for tag <html>
# (7:1) Unknown attribute "xml:lang" for tag <html>
1..3
# Looks like you failed 1 tests of 3.
---
What do I need to do to get Lint to accept this as valid HTML?
Thanks.
Jesse Sheidlower