Subversion Repositories wimsdev

Rev

Rev 11480 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
11480 schaersvoo 1
#!/usr/bin/perl
6348 bpr 2
 
3
## validator file validator_uri
6350 bpr 4
 my $file = shift(@ARGV);
5
 my $uri = shift(@ARGV);
6
 use WebService::Validator::HTML::W3C;
7
 my $v = WebService::Validator::HTML::W3C->new(detailed => 1);
8
 $v->validator_uri($uri);
9
 
6348 bpr 10
 if ( $v->validate_file("$file") ) {
11
   if ( !$v->is_valid )
12
   {
13
     foreach my $E (@{$v->errors}) {
6445 bpr 14
       next if ($E->msg =~ /not allowed in prolog/);
6348 bpr 15
       next if ($E->msg =~ /Conflict between Mime Type/); #error coming from last.html
16
       next if ($E->msg =~ /xmlParseEntityRef/); #error I do not understand, link with &
11777 bpr 17
   #    next if ($E->msg =~ /data-dropdown-menu/); #is not a member of a group specified for any attribute (html5)
18
   #    next if ($E->msg =~ /no attribute \"data/); #html5
19
   #    next if ($E->msg =~ /aria-label/);  #html5
20
   #    next if ($E->msg =~ /nav/);  #html5
6348 bpr 21
       printf("\$wims_name_Error: line %d, %s\n", $E->line, $E->msg);
10817 bpr 22
 
6348 bpr 23
     }
24
     foreach my $E (@{$v->warnings}) {
25
       next if ($E->msg =~ /character "(&|&)" is the first character of a delimiter but occurred as data/);  ##due to wims
26
       next if ($E->msg =~ /Conflict between Mime Type/);  #error coming from last.html
27
       next if ($E->msg =~ /xmlParseEntityRef/); #error I do not understand, link with &
28
       printf("\$wims_name_warning: line %d, %s\n", $E->line, $E->msg);}
6445 bpr 29
   } else {
10817 bpr 30
     printf("Validation has been done"); }
6348 bpr 31
 } else {
6349 bpr 32
     printf ("Failed to validate the validator $v->uri : %s\n", $v->validator_error);
6348 bpr 33
 }