The Node class is the base class for all nodes in the plasTeX DOM inluding elements, text, etc.
a list of the nodes that are contained by this one. In plasTeX, this generally contains the contents of a LaTeX environment.
the name of the node. This is either the special node name as specified in the XML DOM (e.g. #document-fragment, #text, etc.), or, if the node corresponds to an element, it is the name of the element.
integer indicating the type of the node. The node types are defined as:
Node.ELEMENT_NODE
Node.ATTRIBUTE_NODE
Node.TEXT_NODE
Node.CDATA_SECTION_NODE
Node.ENTITY_REFERENCE_NODE
Node.ENTITY_NODE
Node.PROCESSING_INSTRUCTION_NODE
Node.COMMENT_NODE
Node.DOCUMENT_NODE
Node.DOCUMENT_TYPE_NODE
Node.DOCUMENT_FRAGMENT_NODE
Node.NOTATION_NODE
Note: These are defined by the XML DOM, not all of them are used by plasTeX.
the node in the document that is adjacent to and immediately before this node. If one does not exist, the value is None.
the node in the document that is adjacent to and immediately after this node. If one does not exist, the value is None.
specifies a unicode string that could be used in place of the node. This unicode string will be converted into tokens in the plasTeX output stream.
create a new node that is the sum of self and other. This allows you to use nodes in Python statements like: node + other.
create a clone of the current node. If deep is true, then the attributes and child nodes are cloned as well. Otherwise, all references to attributes and child nodes will be shared between the nodes.
same as isEqualNode, but allows you to compare nodes using the Python statement: node == other.
returns the child node at the index given by i. This allows you to use Python’s slicing syntax to retrieve child nodes: node[i].
same as extend. This allows you to use nodes in Python statements like: node += other.
inserts newChild before refChild in this node. If refChild is not found, a NotFoundErr exception is raised.
returns an iterator that iterates over the child nodes. This allows you to use Python’s iter() function on nodes.
returns the number of child nodes. This allows you to use Python’s len() function on nodes.
removes child node and the index given by index. If no index is specified, the last child is removed.
create a new node that is the sum of other and self. This allows you to use nodes in Python statements like: other + node.
replaces oldChild with newChild in this node. If oldChild is not found, a NotFoundErr exception is raised.
removes oldChild from this node. If oldChild is not found, a NotFoundErr exception is raised.
sets the item at index i to node. This allows you to use Python’s slicing syntax to insert child nodes; see the example below.
mynode[5] = othernode mynode[6:10] = [node1, node2]
put data specified in data into the userdata dictionary under the name given by key