An integer representing the node type. Symbolic constants for the
types are on the Node object:
ELEMENT_NODE, ATTRIBUTE_NODE,
TEXT_NODE, CDATA_SECTION_NODE,
ENTITY_NODE, PROCESSING_INSTRUCTION_NODE,
COMMENT_NODE, DOCUMENT_NODE,
DOCUMENT_TYPE_NODE, NOTATION_NODE.
This is a read-only attribute.
The parent of the current node, or None for the document node.
The value is always a Node object or None. For
Element nodes, this will be the parent element, except for the
root element, in which case it will be the Document object.
For Attr nodes, this is always None.
This is a read-only attribute.
The node that immediately precedes this one with the same parent. For
instance the element with an end-tag that comes just before the
self element's start-tag. Of course, XML documents are made
up of more than just elements so the previous sibling could be text, a
comment, or something else. If this node is the first child of the
parent, this attribute will be None.
This is a read-only attribute.
The node that immediately follows this one with the same parent. See
also previousSibling. If this is the last child of the
parent, this attribute will be None.
This is a read-only attribute.
This has a different meaning for each node type; see the DOM
specification for details. You can always get the information you
would get here from another property such as the tagName
property for elements or the name property for attributes.
For all node types, the value of this attribute will be either a
string or None. This is a read-only attribute.
This has a different meaning for each node type; see the DOM
specification for details. The situation is similar to that with
nodeName. The value is a string or None.
Returns true if other refers to the same node as this node.
This is especially useful for DOM implementations which use any sort
of proxy architecture (because more than one object can refer to the
same node).
Note:
This is based on a proposed DOM Level 3 API which is
still in the ``working draft'' stage, but this particular interface
appears uncontroversial. Changes from the W3C will not necessarily
affect this method in the Python DOM interface (though any new W3C
API for this would also be supported).
Insert a new child node before an existing child. It must be the case
that refChild is a child of this node; if not,
ValueError is raised. newChild is returned.
Remove a child node. oldChild must be a child of this node; if
not, ValueError is raised. oldChild is returned on
success. If oldChild will not be used further, its
unlink() method should be called.
Join adjacent text nodes so that all stretches of text are stored as
single Text instances. This simplifies processing text from a
DOM tree for many applications.
New in version 2.1.