validator/httpd/cgi-bin check,1.596,1.597

Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv18816

Modified Files:
	check 
Log Message:
implement locator and info/warning differentiation 

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.596
retrieving revision 1.597
diff -u -d -r1.596 -r1.597
--- check	15 Aug 2008 19:29:27 -0000	1.596
+++ check	18 Aug 2008 14:32:32 -0000	1.597
@@ -868,7 +868,6 @@
     my @nodelist = $xmlDOM->getElementsByTagName("messages");
     my $messages_node = $nodelist[0];
     my @message_nodes =  $messages_node->childNodes;  
-    # @@ TODO locator attributes
     foreach my $message_node (@message_nodes) {
       my $message_type = $message_node->localname;
       my $err;
@@ -878,14 +877,26 @@
         $File->{'Is Valid'} = FALSE;
       }
       elsif ($message_type eq "info") {
-        $err->{type} = "I";
-        if ($message_node->hasAttributes()) {
-          my @attributelist = $message_node->attributes();
-          foreach my $attribute (@attributelist) {
-            #@@ TODO parse attributes, find out if it is a warning
+        $err->{type} = "I"; # by default - we find warnings in the type attribute (below)
+      } 
+      if ($message_node->hasAttributes()) {
+        my @attributelist = $message_node->attributes();
+        foreach my $attribute (@attributelist) {
+          if($attribute->name eq "type"){
+            if (($attribute->getValue() eq "warning") and ($message_type eq "info")) {
+              $err->{type} = "W";                
+            } 
+            
           }
+          if($attribute->name eq "last-column") {
+            $html5_error_col = $attribute->getValue();                
+          } 
+          if($attribute->name eq "last-line") {
+            $html5_error_line = $attribute->getValue();                
+          } 
+          
         }
-      } 
+      }
       my @child_nodes =  $message_node->childNodes;  
       foreach my $child_node (@child_nodes) {
         if ($child_node->localname eq "message") {

Received on Monday, 18 August 2008 14:33:10 UTC