PyXML DOM question: adding the DOCTYPE

Martin von Loewis loewis at
Tue Aug 14 15:52:11 CEST 2001

pibble at (Preston Landers) writes:

> Everything is peachy keen with the output except one thing: I need a
> <!DOCTYPE> meta-element at the top of the document, and I can't seem
> to get minidom to include this.  The scanty documentation provides few
> clues for this puzzle.

In short, the W3C DOM does not support doctypes in any reasonable way
and minidom implements just the required minimum.

I would recommend that you write the <?xml header and the DOCTYPE
declaration yourself, and then invoke writexml on the documentElement,
instead of invoking toxml.


More information about the Python-list mailing list