Subversion Repositories wimsdev

Rev

Rev 6349 | Go to most recent revision | Details | Last modification | View Log | RSS feed

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