Re: using minidom

Andrew Clover <[email protected]>
Newsgroups gmane.comp.python.xml
Message-ID <[email protected]>
Alexandro Colorado wrote:

> I joined yet I don't see many user-driven question which makes me
> think that maybe I am on the wrong list.

Nope, you're fine - apart from the mailspew (if that's not at my end).

This list is quiet of late as the PyXML project sees little development 
these days. minidom, for all its flaws, is a pretty stable target, and 
4DOM use is in decline.

> I want to change the toolbar:visible atribute from false to true  
> preffering to use minidom.

That's pretty trivial:

     OONS= 'http://openoffice.org/2001/toolbar'
     doc= minidom.parse(PATH)

     item= doc.getElementsByTagNameNS(OONS, 'toolbaritem')[0]
     item.setAttributeNS(OONS, 'toolbar:visible', 'true')

     fp= open(PATH, 'wb')
     doc.writexml(fp)
     fp.close()

minidom's documentation isn't that in-depth, but then it doesn't need to 
be, as most of the manipulation methods are standard ones documented by 
W3C DOM Level 2 Core.

-- 
And Clover
mailto:[email protected]
http://www.doxdesk.com/
_______________________________________________
XML-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/xml-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.