Click to return to the XML (Extensible Markup Language) home page    
XML DOM Interfaces     XML DOM Objects     XML DOM Reference    
Web Workshop  |  XML (Extensible Markup Language)

DOMNodeType Enumeration


DOMNodeType enumerations specify valid settings for the DOM node type. The node type determines valid values and whether the node can have child nodes.

Values

The DOMNodeType enumeration defines the following valid values:

NODE_ELEMENT (1)
The node represents an element (its nodeTypeString property is "element"). An element node can have the following child node types: Element, Text, Comment, ProcessingInstruction, CDATASection, and EntityReference. An element node can be the child of the Document, DocumentFragment, EntityReference, and Element nodes.
NODE_ATTRIBUTE (2)
The node represents an attribute of an element (its nodeTypeString property is "attribute"). An attribute node can have the following child node types: Text and EntityReference. The attribute does not appear as the child node of any other node type; note that it is not considered a child node of an element.
NODE_TEXT (3)
The node represents the text content of a tag (its nodeTypeString property is "text"). A text node cannot have any child nodes. The text node can appear as the child node of the Attribute, DocumentFragment, Element, and EntityReference nodes.
NODE_CDATA_SECTION (4)
The node represents a CDATA section in the XML source (its nodeTypeString property is "cdatasection"). CDATA sections are used to escape blocks of text that would otherwise be recognized as markup. A CDATA section node cannot have any child nodes. The CDATA section node can appear as the child of the DocumentFragment, EntityReference, and Element nodes.
NODE_ENTITY_REFERENCE (5)
The node represents a reference to an entity in the XML document (its nodeTypeString property is "entityreference"). This applies to all entities, including character entity references. An entity reference node can have the following child node types: Element, ProcessingInstruction, Comment, Text, CDATASection, and EntityReference. The entity reference node can appear as the child of the Attribute, DocumentFragment, Element, and EntityReference nodes.
NODE_ENTITY (6)
The node represents an expanded entity (its nodeTypeString property is "entity"). An entity node can have child nodes that represent the expanded entity (for example, Text and EntityReference nodes). The entity node can appear as the child of the DocumentType node.
NODE_PROCESSING_INSTRUCTION (7)
The node represents a processing instruction (PI) from the XML document (its nodeTypeString property is "processinginstruction"). A PI node cannot have any child nodes. The PI node can appear as the child of the Document, DocumentFragment, Element, and EntityReference nodes.
NODE_COMMENT (8)
The node represents a comment in the XML document (its nodeTypeString property is "comment"). A comment node cannot have any child nodes. The comment node can appear as the child of the Document, DocumentFragment, Element, and EntityReference nodes.
NODE_DOCUMENT (9)
The node represents a document object, which, as the root of the document tree, provides access to the entire XML document (its nodeTypeString property is "document"). It is created using the ProgID "Microsoft.XMLDOM", or through a data island using <XML> or <SCRIPT LANGUAGE=XML>. The document node can have the following child node types: Element (maximum of one), ProcessingInstruction, Comment, and DocumentType. The document node cannot appear as the child of any node types.
NODE_DOCUMENT_TYPE (10)
The node represents the document type declaration, indicated by the <!DOCTYPE > tag (its nodeTypeString property is "documenttype"). The document type node can have the following child node types: Notation and Entity. The document type node can appear as the child of the Document node.
NODE_DOCUMENT_FRAGMENT (11)
The node represents a document fragment (its nodeTypeString property is "documentfragment"). The document fragment node associates a node or subtree with a document without actually being contained within the document. The document fragment node can have the following child node types: Element, ProcessingInstruction, Comment, Text, CDATASection, and EntityReference. The DocumentFragment node cannot appear as the child of any node types.
NODE_NOTATION (12)
A node represents a notation in the document type declaration (its nodeTypeString property is "notation"). The notation node cannot have any child nodes. The notation node can appear as the child of the DocumentType node.

Remarks

Note that built-in and numeric entities (such as &amp;) are exposed as text nodes, rather than as entity nodes.

See Also

IXMLDOMNode Interface (for C/C++ and Microsoft Visual Basic developers), XMLDOMNode Object (for script developers)



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.