W3C home > Mailing lists > Public > www-validator-cvs@w3.org > May 2008

validator/httpd/cgi-bin check,1.587,1.588

From: Olivier Thereaux via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 05 May 2008 03:30:20 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1JsrPA-0006No-Ad@lionel-hutz.w3.org>

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

Modified Files:
	check 
Log Message:
configuring the default doctype for HTML and XHTML modes. Should be in config file?

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.587
retrieving revision 1.588
diff -u -d -r1.587 -r1.588
--- check	5 May 2008 02:46:07 -0000	1.587
+++ check	5 May 2008 03:30:18 -0000	1.588
@@ -271,6 +271,8 @@
 
 # By default, doctype-less documents can not be valid
 $File->{"DOCTYPEless OK"} = FALSE;
+$File->{"Default DOCTYPE"}->{"HTML"} = 'HTML 4.01 Transitional';
+$File->{"Default DOCTYPE"}->{"XHTML"} = 'XHTML 1.0 Transitional';
 
 ###############################################################################
 #### Generate Template for Result. ############################################
@@ -1127,7 +1129,9 @@
 
     # @@TODO@@ we should try falling back on other version
     # info, such as the ones stored in Version_ESIS
-    $T->param(file_version => '(no Doctype found)');
+    my $default_doctype = ($File->{Mode} eq 'XML' ?
+                 $File->{"Default DOCTYPE"}->{"XHTML"} : $File->{"Default DOCTYPE"}->{"HTML"});
+    $T->param(file_version => "$default_doctype");
   }
   else {
     $T->param(file_version => $File->{Version});
@@ -2760,7 +2764,7 @@
   if ($err->{msg} =~ m(prolog can\'t be omitted)) {
     if (lc($File->{Root}) eq 'html') { 
       my $dtd = ($File->{Mode} eq 'XML' ?
-                 'XHTML 1.0 Transitional' : 'HTML 4.01 Transitional' );      
+                 $File->{"Default DOCTYPE"}->{"XHTML"} : $File->{"Default DOCTYPE"}->{"HTML"} );      
       W3C::Validator::MarkupValidator::add_warning('W09', {W09_dtd => $dtd});
     }
     else { # not html root element, we are not using fallback
Received on Monday, 5 May 2008 03:30:53 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:02:28 UTC