XML DOM - The Node Object
The Node object represents a node in the document tree.
The Node Object
The Node object is the primary data type for the entire DOM.
The Node object represents a
single node in the document tree.
A node can be an
element node, an attribute node, a text node, or any other of the node types explained in the
"Node
types" chapter.
Notice that while all objects inherits the Node properties / methods for
dealing with parents and children, not all objects can have parents or children.
For example, Text nodes may not have children, and adding children to such nodes
results in a DOM error.
IE: Internet Explorer, F: Firefox, O: Opera, W3C:
World Wide Web Consortium (Internet Standard)
Node Object Properties
| Property |
Description |
IE |
F |
O |
W3C |
| baseURI |
Returns the absolute base URI of a node |
No |
1 |
No |
Yes |
| childNodes |
Returns a NodeList of child nodes for a node |
5 |
1 |
9 |
Yes |
| firstChild |
Returns the first child of a node |
5 |
1 |
9 |
Yes |
| lastChild |
Returns the last child of a node |
5 |
1 |
9 |
Yes |
| localName |
Returns the local part of the name of a node |
No |
1 |
9 |
Yes |
| namespaceURI |
Returns the namespace URI of a node |
No |
1 |
9 |
Yes |
| nextSibling |
Returns the node immediately following a node |
5 |
1 |
9 |
Yes |
| nodeName |
Returns the name of a node, depending on its type |
5 |
1 |
9 |
Yes |
| nodeType |
Returns the type of a node |
5 |
1 |
9 |
Yes |
| nodeValue |
Sets or returns the value of a node, depending on its
type |
5 |
1 |
9 |
Yes |
| ownerDocument |
Returns the root element (document object) for a node |
5 |
1 |
9 |
Yes |
| parentNode |
Returns the parent node of a node |
5 |
1 |
9 |
Yes |
| prefix |
Sets or returns the namespace prefix of a node |
No |
1 |
9 |
Yes |
| previousSibling |
Returns the node immediately before a node |
5 |
1 |
9 |
Yes |
| textContent |
Sets or returns the textual content of a node and its
descendants |
No |
1 |
No |
Yes |
| text |
Returns the text of a node and its descendants.
IE-only property |
5 |
No |
No |
No |
| xml |
Returns the XML of a node and its descendants. IE-only
property |
5 |
No |
No |
No |
Node Object Methods
| Method |
Description |
IE |
F |
O |
W3C |
| appendChild() |
Adds a new child node to the end of the list of children of
a
node |
5 |
1 |
9 |
Yes |
| cloneNode() |
Clones a node |
5 |
1 |
9 |
Yes |
| compareDocumentPosition() |
Compares the document position of two nodes |
No |
1 |
No |
Yes |
| getFeature(feature,version) |
Returns a DOM object which implements the specialized APIs
of the specified feature and version |
|
|
No |
Yes |
| getUserData(key) |
Returns the object associated to a key on a this node. The
object must first have been set to this node by calling setUserData with the
same key |
|
|
No |
Yes |
| hasAttributes() |
Returns true if a node has any attributes, otherwise it
returns false |
No |
1 |
9 |
Yes |
| hasChildNodes() |
Returns true if a node has any child nodes, otherwise it
returns false |
5 |
1 |
9 |
Yes |
| insertBefore() |
Inserts a new child node before an existing child node |
5 |
1 |
9 |
Yes |
| isDefaultNamespace(URI) |
Returns whether the specified namespaceURI is the default |
|
|
No |
Yes |
| isEqualNode() |
Checks if two nodes are equal |
No |
No |
No |
Yes |
| isSameNode() |
Checks if two nodes are the same node |
No |
1 |
No |
Yes |
| isSupported(feature,version) |
Returns whether a specified feature is supported on a node |
|
|
9 |
Yes |
| lookupNamespaceURI() |
Returns the namespace URI matching a specified prefix |
No |
1 |
No |
Yes |
| lookupPrefix() |
Returns the prefix matching a specified namespace URI |
No |
1 |
No |
Yes |
| normalize() |
Puts all text nodes underneath a node (including
attributes) into a "normal" form where only structure (e.g., elements,
comments, processing instructions, CDATA sections, and entity references)
separates Text nodes, i.e., there are neither adjacent Text nodes nor empty
Text nodes |
5 |
1 |
9 |
Yes |
| removeChild() |
Removes a child node |
5 |
1 |
9 |
Yes |
| replaceChild() |
Replaces a child node |
5 |
1 |
9 |
Yes |
| setUserData(key,data,handler) |
Associates an object to a key on a node |
|
|
No |
Yes |
The Ektron Intranet
lets you do everything you need to do on your corporate intranet and everything you want to do... all with just one application.
What can you do with the Ektron Intranet? |

|
Navigate through content, documents, assets, colleagues and workgroups quickly and intuitively with enterprise search |

|
Communicate with friends and colleagues with forums, message boards and corporate blogging using the new Social Networking Platform |

|
Promote collaboration among coworkers in your organization through project workspaces where others can efficiently find information and work together |

|
Personalize your company profile by bookmarking and organizing favorite content, uploading assets, posting photos, blogging, and more |

|
Interact with features like tagging, flagging, wikis and ratings found in the Web 2.0 Toolbox |
 |
Author/edit content, manage navigation, menus, audit trails, workflow and approvals with the best in breed Content Management |
|
|
|
|
See why there are 20,000+ Ektron integrations worldwide. Request an
INSTANT DEMO or download a
FREE TRIAL today. |
|