A bug was reported on the W3C Mobile BP checker [1] that triggered a
bogus ill-formedness error on pages with a doctype of the form of:
<!DOCTYPE html>

This bug originated from xmlproc.py, part of the python-xml package in
Debian; the code in there assumes that you need a whitespace after the
Name part of the DTD, but that isn't so according to the XML spec:
http://www.w3.org/TR/2006/REC-xml-20060816/#NT-doctypedecl

The attached patch applies to xmlproc.py v 1.25 and fixes that bug. (I'm
sending this to www-archive rather than the bug system for that package,
since that project seems to be no longer maintained).

Dom
--- xmlproc.py	2007-06-14 12:42:07.000000000 +0000
+++ /usr/lib/python2.4/site-packages/_xmlplus/parsers/xmlproc/xmlproc.py	2002-08-13 09:28:51.000000000 +0000
@@ -481,9 +481,7 @@
 
         self.skip_ws(1)
         rootname = self._get_name()
-
-        # whitespace here is not required per XML spec
-        self.skip_ws()
+        self.skip_ws(1)
 
         (pub_id, sys_id) = self.parse_external_id()
         self.skip_ws()

Reply via email to