[XML-SIG] DOCTYPEs question with 4DOM (4DOM bug?)

Mike Brown mike at skew.org
Wed Jul 7 11:45:54 CEST 2004


Derek Fountain wrote:
> Replying to myself, it seems to be a problem specific to 4DOM. The serialiser 
> in dom/ext/Printer.py is quite clear:
> 
>     def visitDocumentType(self, doctype):
>         if not doctype.systemId and not doctype.publicId: return

Definitely a bug.

> 
> Both the sax/saxutils.py serialiser and the dom/minidom.py serialiser print 
> the "<DOCTYPE" part of the line before considering if a system or public id 
> is known about.
> 
> That visitDocumentType() method is pretty straightforward, but it doesn't look 
> right. The XML-1.1 spec, which I'm not really familiar with, but which isn't 
> too hard to read, seems to say that a doctype with neither an External ID nor 
> an internal subset is valid, so shouldn't the serialiser be able to produce 
> it?

I don't think there has been any effort in PyXML to support XML 1.1, which is 
only 5 months old and doesn't have many advocates in this corner of the net, 
AFAIK.

However PyXML does of course support XML 1.0, which is not deprecated (the W3C 
encourages people to use 1.0 if they don't need the features of 1.1), and all 
3 editions of XML 1.0 agree with XML 1.1 on the almost-empty doctype issue, so 
it should be filed as a bug if you generated one but can't serialize it 
properly.

File it at http://sourceforge.net/tracker/?group_id=6473&atid=106473
and mention this thread, which starts at
http://mail.python.org/pipermail/xml-sig/2004-July/010334.html
and if you feel adventurous, include a patch.

-Mike


More information about the XML-SIG mailing list