W3C home > Mailing lists > Public > www-validator-cvs@w3.org > November 2004

validator/httpd/cgi-bin check,1.354,1.355

From: Ville Skytta <ville@dev.w3.org>
Date: Sat, 13 Nov 2004 10:31:20 +0000
To: www-validator-cvs@w3.org
Message-ID: <E1CSvBg-00083M-Ey@lionel-hutz.w3.org>

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

Modified Files:
	check 
Log Message:
Make doctype override work again (#941).  Somewhat ugly, yes.

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.354
retrieving revision 1.355
diff -u -d -r1.354 -r1.355
--- check	12 Nov 2004 18:04:40 -0000	1.354
+++ check	13 Nov 2004 10:31:18 -0000	1.355
@@ -1472,11 +1472,16 @@
 # Suppress any existing DOCTYPE by commenting it out.
 sub override_doctype {
   no strict 'vars';
-  my $File    = shift;
-  my $pubid = $CFG->{Types}->{$File->{Opt}->{DOCTYPE}}->{PubID};
-  my $sysid = $CFG->{Types}->{$File->{Opt}->{DOCTYPE}}->{SysID};
-  my $name  = $CFG->{Types}->{$File->{Opt}->{DOCTYPE}}->{Name};
-  local $dtd  = qq(<!DOCTYPE $name PUBLIC "$pubid"\n  "$sysid">);
+  my $File  = shift;
+  my ($dt)  =
+    grep { $_->{Display} eq $File->{Opt}->{DOCTYPE} } values %{$CFG->{Types}};
+  # @@@ TODO: abort/whine about unrecognized doctype if $dt is undef.
+  my $pubid = $dt->{PubID};
+  my $sysid = $dt->{SysID};
+  my $name  = $dt->{Name};
+  local $dtd = qq(<!DOCTYPE $name PUBLIC "$pubid");
+  $dtd .= qq(\n  "$sysid") if $sysid; # We don't have one for all types.
+  $dtd .= '>';
   local $org_dtd = '';
   local $HTML = '';
   local $seen = FALSE;
Received on Saturday, 13 November 2004 10:31:20 UTC

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