Inheritance diagram for DOM_Node:
Equality and Inequality operators. | |
enum | NodeType { ELEMENT_NODE = 1, ATTRIBUTE_NODE = 2, TEXT_NODE = 3, CDATA_SECTION_NODE = 4, ENTITY_REFERENCE_NODE = 5, ENTITY_NODE = 6, PROCESSING_INSTRUCTION_NODE = 7, COMMENT_NODE = 8, DOCUMENT_NODE = 9, DOCUMENT_TYPE_NODE = 10, DOCUMENT_FRAGMENT_NODE = 11, NOTATION_NODE = 12, XML_DECL_NODE = 13 } |
bool | operator== (const DOM_Node &other) const |
bool | operator== (const DOM_NullPtr *other) const |
bool | operator!= (const DOM_Node &other) const |
bool | operator!= (const DOM_NullPtr *other) const |
Public Types | |
Public Methods | |
Constructors and assignment operators | |
DOM_Node () | |
DOM_Node (const DOM_Node &other) | |
DOM_Node & | operator= (const DOM_Node &other) |
DOM_Node & | operator= (const DOM_NullPtr *val) |
Destructor. | |
~DOM_Node () | |
Get functions. | |
DOMString | getNodeName () const |
DOMString | getNodeValue () const |
short | getNodeType () const |
DOM_Node | getParentNode () const |
DOM_NodeList | getChildNodes () const |
DOM_Node | getFirstChild () const |
DOM_Node | getLastChild () const |
DOM_Node | getPreviousSibling () const |
DOM_Node | getNextSibling () const |
DOM_NamedNodeMap | getAttributes () const |
DOM_Document | getOwnerDocument () const |
void * | getUserData () const |
Cloning function. | |
DOM_Node | cloneNode (bool deep) const |
Functions to modify the DOM Node. | |
DOM_Node | insertBefore (const DOM_Node &newChild, const DOM_Node &refChild) |
DOM_Node | replaceChild (const DOM_Node &newChild, const DOM_Node &oldChild) |
DOM_Node | removeChild (const DOM_Node &oldChild) |
DOM_Node | appendChild (const DOM_Node &newChild) |
Query functions. | |
bool | hasChildNodes () const |
bool | isNull () const |
Set functions. | |
void | setNodeValue (const DOMString &nodeValue) |
void | setUserData (void *p) |
Functions introduced in DOM Level 2. | |
void | normalize () |
bool | isSupported (const DOMString &feature, const DOMString &version) const |
DOMString | getNamespaceURI () const |
DOMString | getPrefix () const |
DOMString | getLocalName () const |
void | setPrefix (const DOMString &prefix) |
bool | hasAttributes () const |
Protected Methods | |
DOM_Node (NodeImpl *) | |
Protected Attributes | |
NodeImpl * | fImpl |
Friends | |
class | DOM_Document |
class | DocumentImpl |
class | TreeWalkerImpl |
class | NodeIteratorImpl |
class | DOM_NamedNodeMap |
class | DOM_NodeList |
class | DOMParser |
class | DOM_Entity |
class | RangeImpl |
class | CharacterDataImpl |
class | XUtil |
Node
interface is the primary datatype for the entire Document Object Model.
It represents a single node in the document tree. While all objects implementing the Node
interface expose methods for dealing with children, not all objects implementing the Node
interface may have children. For example, Text
nodes may not have children, and adding children to such nodes results in a DOMException
being raised.
The attributes nodeName
, nodeValue
and attributes
are included as a mechanism to get at node information without casting down to the specific derived interface. In cases where there is no obvious mapping of these attributes for a specific nodeType
(e.g., nodeValue
for an Element or attributes
for a Comment), this returns null
. Note that the specialized interfaces may contain additional and more convenient mechanisms to get and set the relevant information.
|
Default constructor for DOM_Node. The resulting object does not refer to an actual node; it will compare == to 0, and is similar to a null object reference variable in Java. It may subsequently be assigned to refer to an actual node. "Acutal Nodes" will always be of some derived type, such as Element or Attr. |
|
Copy constructor.
|
|
Destructor for DOM_Node. The object being destroyed is the reference object, not the underlying node itself. |
|
Adds the node
If the
|
|
Returns a duplicate of this node. This function serves as a generic copy constructor for nodes.
The duplicate node has no parent (
|
|
Gets a |
|
Gets a
If there are no children, this is a Reimplemented in DOM_Entity. |
|
Gets the first child of this node.
If there is no such node, this returns Reimplemented in DOM_Entity. |
|
Gets the last child of this node.
If there is no such node, this returns Reimplemented in DOM_Entity. |
|
Returns the local part of the qualified name of this node.
For nodes created with a DOM Level 1 method, such as |
|
Get the namespace URI of this node, or This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time.
For nodes of any type other than |
|
Gets the node immediately following this node.
If there is no such node, this returns Reimplemented in DOM_Entity. |
|
The name of this node, depending on its type; see the table above. |
|
An enum value representing the type of the underlying object. |
|
Gets the value of this node, depending on its type.
|
|
Gets the
This is also the |
|
Gets the parent of this node.
All nodes, except |
|
Get the namespace prefix of this node, or |
|
Gets the node immediately preceding this node.
If there is no such node, this returns Reimplemented in DOM_Entity. |
|
Return the user data pointer.
User data allows application programs to attach extra data to DOM nodes, and can be set using the function
|
|
Returns whether this node (if it is an element) has any attributes.
Reimplemented in DOM_Element. |
|
This is a convenience method to allow easy determination of whether a node has any children.
Reimplemented in DOM_Entity. |
|
Inserts the node
If
|
|
Test whether this node is null.
This C++ class, Operator == provides another way to perform this null test on a DOM_Node. |
|
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.
|
|
Puts all
Note: In cases where the document contains |
|
Compare with a pointer. Intended only to allow a convenient comparison with null. |
|
The inequality operator. See operator ==. |
|
Assignment operator. This overloaded variant is provided for the sole purpose of setting a DOM_Node reference variable to zero. Nulling out a reference variable in this way will decrement the reference count on the underlying Node object that the variable formerly referenced. This effect is normally obtained when reference variable goes out of scope, but zeroing them can be useful for global instances, or for local instances that will remain in scope for an extended time, when the storage belonging to the underlying node needs to be reclaimed.
Reimplemented in DOM_Attr, DOM_CDATASection, DOM_CharacterData, DOM_Comment, DOM_Document, DOM_DocumentFragment, DOM_DocumentType, DOM_Element, DOM_Entity, DOM_EntityReference, DOM_Notation, DOM_ProcessingInstruction, DOM_Text, and DOM_XMLDecl. |
|
Assignment operator.
|
|
Compare with a pointer. Intended only to allow a convenient comparison with null. |
|
The equality operator. This compares to references to nodes, and returns true if they both refer to the same underlying node. It is exactly analogous to Java's operator == on object reference variables. This operator can not be used to compare the values of two different nodes in the document tree.
|
|
Removes the child node indicated by
|
|
Replaces the child node
If
If the
|
|
Sets the value of the node. Any node which can have a nodeValue (
|
|
Set the namespace prefix of this node.
Note that setting this attribute, when permitted, changes the
Note also that changing the prefix of an attribute, that is known to have a default value, does not make a new attribute with the default value and the original prefix appear, since the
|
|
Set the user data for a node.
User data allows application programs to attach extra data to DOM nodes, and can be retrieved using the function Deletion of the user data remains the responsibility of the application program; it will not be automatically deleted when the nodes themselves are reclaimed. Because DOM_Node is not designed to be subclassed, userdata provides an alternative means for extending the the information kept with nodes by an application program.
|