- From: Ville Skytta via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 14 Dec 2009 21:18:35 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/validator/httpd/cgi-bin In directory hutz:/tmp/cvs-serv2816/httpd/cgi-bin Modified Files: check Log Message: Do not filter out undefined entity errors for standalone XML docs (#7007). Index: check =================================================================== RCS file: /sources/public/validator/httpd/cgi-bin/check,v retrieving revision 1.752 retrieving revision 1.753 diff -u -d -r1.752 -r1.753 --- check 14 Dec 2009 20:44:49 -0000 1.752 +++ check 14 Dec 2009 21:18:33 -0000 1.753 @@ -627,6 +627,15 @@ ([^>].*\?>) /$1encoding="UTF-8"$4/sx; + # Is the document standalone? Need to check with a regex because + # the parser may fail to return a document we could use for this. + my $standalone = ( + $xml_string =~ /^<\?xml\b[^>]*[\x20\x09\x0D\x0A] + standalone[\x20\x09\x0D\x0A]*=[\x20\x09\x0D\x0A]* + (["'])yes\1 + /sx + ); + eval { $xmlparser->parse_string($xml_string); }; $xml_string = undef; my $xml_parse_errors_line = undef; @@ -656,8 +665,11 @@ $err->{msg} = $err_obj->message(); # The validator will sometimes fail to dereference entities - # files; we're filtering the resulting bogus error - if ($err->{msg} =~ /Entity '\w+' not defined/) { + # files; we're filtering the resulting bogus error for + # non-standalone documents. @@@TODO: is this still needed? + if (!$standalone && + $err->{msg} =~ /Entity '\w+' not defined/) + { $err = undef; next; } @@ -752,8 +764,11 @@ $err->{msg} = $xmlwf_error_msg; # The validator will sometimes fail to dereference entities - # files; we're filtering the resulting bogus error - if ($err->{msg} =~ /Entity '\w+' not defined/) { + # files; we're filtering the resulting bogus error for + # non-standalone documents. @@@TODO: is this still needed? + if (!$standalone && + $err->{msg} =~ /Entity '\w+' not defined/) + { $xmlwf_error_line = undef; $xmlwf_error_col = undef; $xmlwf_error_msg = undef;
Received on Monday, 14 December 2009 21:18:43 UTC