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