xml.dom.minidom help!

Paulo Pinto paulo.pinto at cern.ch
Thu Jun 10 09:39:41 EDT 2004


pxdom doesn't work either.

It fails to read the DTD declarations inside the files. :(

I'll have to look for alternative ways of manipulating
the files.

Thanks anyway,
Paulo

Andrew Clover wrote:
> 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.
> 



More information about the Python-list mailing list