how to use method in node(xml)

Martin von Loewis loewis at
Tue Jul 31 08:10:38 EDT 2001

"sdf" <wqh-2 at> writes:

> I am a newbie to python with xml.  there is a appendchild method in
> Node(I know this from python Document),

> but when I use 
> >>>dir(Node)
> the result is 
> and no appendchild accur,
> it is right to use Node.__doc__
> but how can I use appendchild (wrong appear when 
> use Nod.appendchild).please post an example,better in detail

Where did you get Node from? It works for me:

>>> from xml.dom.minidom import Node
>>> dir(Node)
['__doc__', '__getattr__', '__init__', '__module__', '__nonzero__', '_debug', '_get_firstChild', '_get_lastChild', '_makeParentNodes', 'allnodes', 'appendChild', 'childNodeTypes', 'cloneNode', 'debug', 'hasChildNodes', 'insertBefore', 'isSameNode', 'namespaceURI', 'normalize', 'removeChild', 'replaceChild', 'toprettyxml', 'toxml', 'unlink']

xml.dom.Node is a base class of xml.dom.minidom.Node.


More information about the Python-list mailing list