[XML-SIG] using minidom
Andrew Clover
and-xml at doxdesk.com
Tue Jun 26 04:52:10 CEST 2007
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:and at doxdesk.com
http://www.doxdesk.com/
More information about the XML-SIG
mailing list