Node class

Node class

The Node class is the primary datatype for the entire Document object Model. It represents a single node in the document tree.

The Node type exposes the following members:

Properties

PropertyDescription
node_typeGets the node type.
parent_nodeGets the parent node.
base_uriGets the absolute base URI of this node or null if the implementation wasn’t able to obtain an absolute URI.
owner_documentGets the document object associated with this node.
child_nodesGets the child nodes.
node_nameGets the node name, depending on its type.
node_valueGets or sets the value of this node, depending on its type.
text_contentGets or sets the the text content of this node and its descendants.
local_nameGets the local part of the qualified name of this node.
prefixGets or sets the namespace prefix of this node.
namespace_uriGets the namespace URI of this node.
has_child_nodesGets whether this node has any children.
previous_siblingGets the node immediately preceding this node. If there is no such node, this returns null.
next_siblingGets the node immediately following this node. If there is no such node, this returns null.
first_childGets the first child of this node. If there is no such node, this returns null.
last_childGets the last child of this node. If there is no such node, this returns null.
COMMENT_NODE
DOCUMENT_NODE
DOCUMENT_TYPE_NODE
ELEMENT_NODE
PROCESSING_INSTRUCTION_NODE
TEXT_NODE

Methods

MethodDescription
append_child(node)
remove_child(node)
replace_child(node, child)

See Also