python xml.dom.minidom.Attr question
Posted
by rudy
on Stack Overflow
See other posts from Stack Overflow
or by rudy
Published on 2010-05-07T01:52:49Z
Indexed on
2010/05/07
1:58 UTC
Read the original article
Hit count: 335
Getting attributes using minidom in Python, one uses the "attributes" property. e.g. node.attributes["id"].value
So if I have <a id="foo"></a>
, that should give me "foo"
. node.attributes["id"]
does not return the value of the named attribute, but an xml.dom.minidom.Attr
instance.
But looking at the help for Attr
, by doing help('xml.dom.minidom.Attr')
, nowhere is this magic "value"
property mentioned. I like to learn APIs by looking at the type hierarchy, instance methods etc. Where did this "value"
property come from?? Why is it not listed in the Attr
class' page? The only data descriptors mentioned are isId
, localName
and schemaType
. Its also not inherited from any superclasses. Since I'm new to Python, would some of the Python gurus enlighten?
© Stack Overflow or respective owner