diff options
author | ot <ot@localhost> | 2008-08-18 14:32:32 +0000 |
---|---|---|
committer | ot <ot@localhost> | 2008-08-18 14:32:32 +0000 |
commit | cabfeaf84125e060e2f207a0c408cf12864dea9b (patch) | |
tree | 6989f70ce88de01fda8a756df84928f3076fd226 | |
parent | eca0d19e8ed5c40f0240ba6892149f72926cd689 (diff) | |
download | markup-validator-cabfeaf84125e060e2f207a0c408cf12864dea9b.zip markup-validator-cabfeaf84125e060e2f207a0c408cf12864dea9b.tar.gz markup-validator-cabfeaf84125e060e2f207a0c408cf12864dea9b.tar.bz2 |
implement locator and info/warning differentiation
-rwxr-xr-x | httpd/cgi-bin/check | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index ff279b5..c5a08e8 100755 --- a/httpd/cgi-bin/check +++ b/httpd/cgi-bin/check @@ -14,7 +14,7 @@ # This source code is available under the license at: # http://www.w3.org/Consortium/Legal/copyright-software # -# $Id: check,v 1.596 2008-08-15 19:29:27 ot Exp $ +# $Id: check,v 1.597 2008-08-18 14:32:32 ot Exp $ # # Disable buffering on STDOUT! @@ -191,7 +191,7 @@ Directory not readable (permission denied): @_r # # Strings - $VERSION = q$Revision: 1.596 $; + $VERSION = q$Revision: 1.597 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; # @@ -868,7 +868,6 @@ sub html5_validate (\$) { 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 @@ sub html5_validate (\$) { $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") { |