Rev 6348 | Rev 6350 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6348 | Rev 6349 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #!/usr/bin/perl |
1 | #!/usr/bin/perl |
2 | - | ||
3 | use WebService::Validator::HTML::W3C; |
- | |
4 | 2 | ||
5 | ## validator file validator_uri |
3 | ## validator file validator_uri |
6 | my $file = shift(@ARGV); |
4 | my $file = shift(@ARGV); |
7 | my $uri = shift(@ARGV); |
5 | my $uri = shift(@ARGV); |
- | 6 | if ($uri =~ /http/) { |
|
- | 7 | use WebService::Validator::HTML::W3C; |
|
8 | my $v = WebService::Validator::HTML::W3C->new(detailed => 1); |
8 | my $v = WebService::Validator::HTML::W3C->new(detailed => 1); |
9 | $v->validator_uri($uri); |
9 | $v->validator_uri($uri); |
- | 10 | } |
|
- | 11 | { |
|
10 |
|
12 | use WebService::Validator::HTML::W3C::Fast; |
11 |
|
13 | my $v = WebService::Validator::HTML::W3C::Fast->new("detailed" => 1, validator_path => '$uri'); |
- | 14 | } |
|
12 | if ( $v->validate_file("$file") ) { |
15 | if ( $v->validate_file("$file") ) { |
13 | if ( !$v->is_valid ) |
16 | if ( !$v->is_valid ) |
14 | { |
17 | { |
15 | foreach my $E (@{$v->errors}) { |
18 | foreach my $E (@{$v->errors}) { |
16 | ##next if ($E->msg =~ /not allowed in prolog/); |
19 | ##next if ($E->msg =~ /not allowed in prolog/); |
Line 24... | Line 27... | ||
24 | next if ($E->msg =~ /Conflict between Mime Type/); #error coming from last.html |
27 | next if ($E->msg =~ /Conflict between Mime Type/); #error coming from last.html |
25 | next if ($E->msg =~ /xmlParseEntityRef/); #error I do not understand, link with & |
28 | next if ($E->msg =~ /xmlParseEntityRef/); #error I do not understand, link with & |
26 | printf("\$wims_name_warning: line %d, %s\n", $E->line, $E->msg);} |
29 | printf("\$wims_name_warning: line %d, %s\n", $E->line, $E->msg);} |
27 | } |
30 | } |
28 | } else { |
31 | } else { |
29 | printf ("Failed to validate the |
32 | printf ("Failed to validate the validator $v->uri : %s\n", $v->validator_error); |
30 | } |
33 | } |