Message145156
The behavior can be verified as follows. Notice that despite changing the value, the output XML does not change
>>> from xml.dom import minidom, Node
>>> a = minidom.parseString("<a href=\"http://asd.com\">asd</a>")
>>> a
<xml.dom.minidom.Document instance at 0x22d7c68>
>>> a.childNodes
[<DOM Element: a at 0x22d7d88>]
>>> a.childNodes[0]
<DOM Element: a at 0x22d7d88>
>>> a.childNodes[0].attributes
<xml.dom.minidom.NamedNodeMap object at 0x21caa70>
>>> a.childNodes[0].attributes.item(0)
<xml.dom.minidom.Attr instance at 0x22d7f38>
>>> a.childNodes[0].attributes.item(0).name
u'href'
>>> attr = a.childNodes[0].attributes.item(0)
>>> attr.name = "ad"
>>> a.toxml()
u'<?xml version="1.0" ?><a href="http://asd.com">asd</a>'
>>> attr.value = "asd"
>>> a.toxml()
u'<?xml version="1.0" ?><a href="asd">asd</a>' |
|
Date |
User |
Action |
Args |
2011-10-08 04:19:35 | dillona | set | recipients:
+ dillona, docs@python |
2011-10-08 04:19:35 | dillona | set | messageid: <1318047575.12.0.0784977708118.issue13127@psf.upfronthosting.co.za> |
2011-10-08 04:19:34 | dillona | link | issue13127 messages |
2011-10-08 04:19:34 | dillona | create | |
|