Anode is a basic unit of adata structure, such as alinked list ortree data structure. Nodes containdata and also may link to other nodes. Links between nodes are often implemented bypointers.


Nodes are often arranged into tree structures. A node represents the information contained in a single data structure. These nodes may contain a value or condition, or possibly serve as another independent data structure. Nodes are represented by a single parent node. The highest point on a tree structure is called a root node, which does not have a parent node, but serves as the parent or 'grandparent' of all of the nodes below it in the tree. The height of a node is determined by the total number of edges on the path from that node to the furthest leaf node, and the height of the tree is equal to the height of the root node.[1] Node depth is determined by the distance between that particular node and the root node. The root node is said to have a depth of zero.[2] Data can be discovered along these network paths.[3]AnIP address uses this kind of system of nodes to define its location in a network.
Another common use of node trees is inweb development. In programming,XML is used to communicate information between computer programmers and computers alike. For this reason XML is used to create commoncommunication protocols used inoffice productivity software, and serves as the base for the development of modern webmarkup languages likeXHTML. Though similar in how it is approached by a programmer,HTML andCSS is typically the language used to develop website text and design. While XML, HTML and XHTML provide the language and expression, theDOM serves as a translator.[4]
Different types of nodes in a tree are represented by specific interfaces. In other words, the node type is defined by how it communicates with other nodes. Each node has a node type property, which specifies the type of node, such as sibling or leaf.For example, if the node type property is the constant properties for a node, this property specifies the type of the node. So if a node type property is the constant nodeELEMENT_NODE, one can know that this node object is an objectElement. This object uses theElement interface to define all the methods and properties of that particular node.
Different W3CWorld Wide Web Consortium node types and descriptions:
Document represents the entire document (the root-node of the DOM tree)DocumentFragment represents a "lightweight"Document object, which can hold a portion of a documentDocumentType provides an interface to the entities defined for the documentProcessingInstruction represents a processing instructionEntityReference represents an entity referenceElement represents an elementAttr represents an attributeText represents textual content in an element or attributeCDATASection represents aCDATA section in a document (text that will NOT be parsed by a parser)Comment represents a commentEntity represents an entityNotation represents a notation declared in the DTDNodeType | Named constant |
|---|---|
| 1 | ELEMENT_NODE |
| 2 | ATTRIBUTE_NODE |
| 3 | TEXT_NODE |
| 4 | CDATA_SECTION_NODE |
| 5 | ENTITY_REFERENCE_NODE |
| 6 | ENTITY_NODE |
| 7 | PROCESSING_INSTRUCTION_NODE |
| 8 | COMMENT_NODE |
| 9 | DOCUMENT_NODE |
| 10 | DOCUMENT_TYPE_NODE |
| 11 | DOCUMENT_FRAGMENT_NODE |
| 12 | NOTATION_NODE |
A node object is represented by a single node in a tree. It can be an element node, attribute node, text node, or any type that is described in section "node type". All objects can inherit properties and methods for dealing with parent and child nodes, but not all of the objects have parent or child nodes. For example, with text nodes that cannot have child nodes, trying to add child nodes results in aDOM error.
Objects in the DOM tree may be addressed and manipulated by using methods on the objects. The public interface of a DOM is specified in itsapplication programming interface (API). The history of the Document Object Model is intertwined with the history of the "browser wars" of the late 1990s betweenNetscape Navigator andMicrosoft Internet Explorer, as well as with that ofJavaScript andJScript, the firstscripting languages to be widely implemented in thelayout engines ofweb browsers.