DOM implementation

Emanuele D'Arrigo manu3d at
Wed May 13 18:08:13 CEST 2009

Hi everybody,

I just spent the past hour or so trying to have a better understanding
of how the various DOM-supporting libraries (xml.dom, xml.dom.minidom)
work. I've used etree and lxml successfully before but I wanted to
understand how close I can get to the W3C DOM standards. Ok, I  think
more or less I got it all. A few questions emerged:

1) classes in xml.dom.minidom (i.e. Element) seem to be old style
classes. Is there a good reason they are kept that way or simply
nobody had the time/will to update the library to use new-style

2) for a lightweight implementation xml.dom.minidom comes with a lot
of methods that aren't part of the W3C standards. I'm referring to
toxml, toprettyxml, writxml and the _get_* family. Would it be better
if there was a package offering W3C-faithful classes only, on top of
which convenience and compatibility methods are added by another
package (or two!) through subclassing?


More information about the Python-list mailing list