xml.dom.minidom help!

Andrew Clover and-google at doxdesk.com
Thu Jun 10 12:38:17 CEST 2004


Paulo Pinto <paulo.pinto at cern.ch> wrote:

> When I read the file the parser builds the DOM nodes
> with those default values. So when I write the file
> I get those default values inside the tags!

> I don't want this behaviour. Is it possible to change?

Not AFAIK, short of deleting the attributes manually. minidom does not
support Attr.specified. (See:

  http://pyxml.sourceforge.net/topics/compliance.html

though actually minidom/4DOM are actually broken in a slightly more
involved way than described here, should update that really.)

pxdom will do it OK, if the DOM Level 3 LS 'discard-default-content'
property is set True on LSSerializer.domConfig, which it is by
default.

-- 
Andrew Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/



More information about the Python-list mailing list