perl/modules/W3C/LogValidator/lib/W3C/LogValidator SurveyEngine.pm,1.10,1.11

Update of /sources/public/perl/modules/W3C/LogValidator/lib/W3C/LogValidator
In directory hutz:/tmp/cvs-serv4363/lib/W3C/LogValidator

Modified Files:
	SurveyEngine.pm 
Log Message:
Updating strings matched by this module with text used in latest
validator. This is very suboptimal, and should be changed to parsing
the XML output (or whatever we use as a stable equivalent) as soon 
as it is stable and official.



Index: SurveyEngine.pm
===================================================================
RCS file: /sources/public/perl/modules/W3C/LogValidator/lib/W3C/LogValidator/SurveyEngine.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- SurveyEngine.pm	12 Nov 2004 07:10:47 -0000	1.10
+++ SurveyEngine.pm	30 Aug 2005 07:57:42 -0000	1.11
@@ -49,7 +49,7 @@
 	$config{ValidatorHost} = "validator.w3.org" if (! exists $config{ValidatorHost});
 	$config{ValidatorPort} = "80" if (!exists $config{ValidatorPort});
 	$config{ValidatorString} = "/check\?uri=" if (!exists $config{ValidatorString});
-	$config{ValidatorVersion} = "0.6.5" if (!exists $config{ValidatorVersion});
+	$config{ValidatorVersion} = "0.7.0" if (!exists $config{ValidatorVersion});
 	bless($self, $class);
         return $self;
 }
@@ -185,14 +185,15 @@
       my $uri_orig = $uri;
       $uri = uri_escape($uri);
       my @result_tmp = ();
-      print "	processing #$census $uri_orig...\n" if ($verbose > 1);
      $census = $census+1;
+      print "	processing #$census $uri_orig...\n" if ($verbose > 1);
       # filling result table with "fixed" content
       push @result_tmp, $census;
       push @result_tmp, $hits{$uri_orig};
       push @result_tmp, $uri_orig;
 
       my $validatorUri = join ("", "http://",$config{ValidatorHost},":",$config{ValidatorPort}, $config{ValidatorString},$uri);
+      print "$validatorUri \n" if ($verbose > 2); # debug info
 	
       my $testStringCharset = undef;
       my $testStringDoctype = undef;
@@ -206,13 +207,19 @@
 		$testStringInvalid = '<h2 id="result" class="invalid">This page is <strong>not</strong> Valid';
 		$testStringValid = '<h2 id="result" class="valid">This Page Is Valid';
 		$testStringErrorNum = '<th>Errors: </th>.*?<td>(\d+)</td>';
-      } else {
-		# Default ValidatorVersion is 0.6.5 (current version as of may 2004)
+      } elsif ( $config{ValidatorVersion} eq "0.6.5" ) {
 		$testStringCharset = 'found are not valid values in the specified Character Encoding';
 		$testStringDoctype = '<h3>No DOCTYPE Found!';
 		$testStringInvalid = '<h2 class="invalid">This page is <strong>not</strong> Valid';
 		$testStringValid = '<h2 id="result" class="valid">This Page Is Valid';
 		$testStringErrorNum = '<th>Errors: </th>.*?<td>(\d+)</td>';
+      } else { 
+		# Default ValidatorVersion is 0.7.0 (current version as of August 2005)
+		$testStringValid = '<h2 class="valid">This Page Is Valid';
+		$testStringErrorNum = 'Failed validation, .* errors';
+		$testStringDoctype = 'No <code>DOCTYPE</code> found!';
+		$testStringInvalid = '<h2 id="results" class="invalid">This page is';
+		$testStringCharset = 'found are not valid values in the specified Character Encoding';
       }
 
       my $request = new HTTP::Request("GET", $validatorUri );

Received on Tuesday, 30 August 2005 07:57:48 UTC