validator/httpd/cgi-bin check,1.679,1.680

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

Modified Files:
	check 
Log Message:
Another stab at fixing confusing "did you mean foo" hints in error messages.

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.679
retrieving revision 1.680
diff -u -d -r1.679 -r1.680
--- check	11 Aug 2009 11:04:12 -0000	1.679
+++ check	13 Aug 2009 15:33:05 -0000	1.680
@@ -3148,9 +3148,11 @@
           $err->{msg} = "Attribute \"".$bogus_elt_attr."\" is not a valid attribute";
       }
 
-      if((exists $self->{CFG}->{Attributes}->{lc($bogus_elt_attr)}) and ($err->{num} eq '108')) {
+      if(($err->{num} eq '108') and
+         (exists $self->{CFG}->{Attributes}->{lc($bogus_elt_attr)}) and
+         (!$is_xml || $bogus_elt_attr eq lc($bogus_elt_attr))) {
           # attribute not available in this context.
-          $err->{msg} = 'Attribute "'.lc($bogus_elt_attr).'" can not be used for this element.';
+          $err->{msg} = "Attribute \"$bogus_elt_attr\" can not be used for this element.";
       }
       elsif ( (
              ((exists $self->{CFG}->{Attributes}->{lc($bogus_elt_attr)}) and ($err->{num} eq '108'))

Received on Thursday, 13 August 2009 15:33:16 UTC