Version 0.9  What is XML4Ada95?  Installation  How-To  API  Download 

COUNTER
counter


Interface Node

The 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 (for example, 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.

NodeType is a constant indicating which type of node it is, as defined in the node Interface according to the following table.

ValueConstants nameType of node
1Element_NodeElement
2Attribute_NodeAttribute
3Text_NodeText
4CDATA_Section_NodeCDATASection
5Entity_Reference_NodeEntityReference
6Entity_NodeEntity
7Processing_Instruction_NodeProcessingInstruction
8Comment_NodeComment
9Document_NodeDocument
10Document_Type_NodeDocumentType
11Document_Fragment_NodeDocumentFragment
12Notation_NodeNotation


The values of NodeName and NodeValue vary according to the node type as defined in the following table.

InterfaceNodeNameNodeValue
ElementtagName""
Attrname of attributevalue of attribute
Text"text"content of the text node
CDATASection"cdata-section"content of the CDATA Section
EntityReferencename of entity referenced""
Entityentity name""
ProcessingInstructiontargetentire content excluding the target
Comment"comment"content of the comment
Document"document"""
DocumentTypedocument type name""
DocumentFragment"document-fragment"""
Notationnotation name""


If the node is of the node type Element, get_Attributes returns a NamedNodeMap. All other node types have no Attributes, thus returning null.


get_nodeName get_nodeValue set_nodeValue get_nodeType get_parentNode get_childNodes get_firstChild get_lastChild get_previousSibling get_nextSibling get_attributes get_ownerDocument insertBefore replaceChild removeChild appendChild hasChildNodes cloneNode normalize isSupported get_namespaceURI get_prefix set_prefix get_localName hasAttributes

e-Mail: denny@nodix.de

design shareright © 2002 Phlash  
inhalt © 2003-04 Zdenko Denny Vrandecic  
last update: 14.01.2004 website created by XML4Ada95 DocGen