PyXML DOM question: adding the DOCTYPE

Martin von Loewis loewis at informatik.hu-berlin.de
Tue Aug 14 09:52:11 EDT 2001


pibble at yahoo.com (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.

Regards,
Martin



More information about the Python-list mailing list