Subversion Repositories wimsdev

Rev

Rev 6348 | Rev 6350 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. #!/usr/bin/perl
  2.  
  3. ## validator file validator_uri
  4. my $file = 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);
  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. }
  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 {
  32.      printf ("Failed to validate the validator $v->uri : %s\n", $v->validator_error);
  33.  }
  34.