Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

DOMNodeTypeenumerations specify valid settings for the Document Object Model (DOM) node type. The node type determines valid values and whether the node can have child nodes.

Syntax

enum tagDOMNodeType {
  NODE_INVALID,
  NODE_ELEMENT, 1
  NODE_ATTRIBUTE,
  NODE_TEXT,
  NODE_CDATA_SECTION,
  NODE_ENTITY_REFERENCE,
  NODE_ENTITY,
  NODE_PROCESSING_INSTRUCTION,
  NODE_COMMENT,
  NODE_DOCUMENT,
  NODE_DOCUMENT_TYPE,
	NODE_DOCUMENT_FRAGMENT,
	NODE_NOTATION
} DOMNodeType;

Elements

The DOMNodeTypeenumeration defines the following valid values.

NODE_ELEMENT (1)

The node represents an element (its nodeTypeString Propertyproperty is "element"). An Element node can have the following child node types: Element, Text, Comment, ProcessingInstruction, CDATASection, and EntityReference. The 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 nodeTypeStringproperty is "attribute"). An Attribute node can have the following child node types: Text and EntityReference. The Attribute node does not appear as the child node of any other node type; it is not considered a child node of an Element.

NODE_TEXT (3)

The node represents the text content of a tag (its nodeTypeStringproperty 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 nodeTypeStringproperty is "cdatasection"). CDATA sections are used to escape blocks of text that would otherwise be recognized as markup. A CDATASection node cannot have any child nodes. The CDATASection 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 nodeTypeStringproperty is "entityreference"). This applies to all entities, including character entity references. An EntityReference node can have the following child node types: Element, ProcessingInstruction, Comment, Text, CDATASection, and EntityReference. The EntityReference node can appear as the child of the Attribute, DocumentFragment, Element, and EntityReference nodes.

NODE_ENTITY (6)

The node represents an expanded entity (its nodeTypeStringproperty 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 from the XML document (its nodeTypeStringproperty is "processinginstruction"). A ProcessingInstruction node cannot have any child nodes. The ProcessingInstruction 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 nodeTypeStringproperty 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 nodeTypeStringproperty is "document"). It is created using the progID "Microsoft.XMLDOM" or through a data island using <XML> or <SCRIPT LANGUAGE=XML>. A 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 nodeTypeStringproperty is "documenttype"). A DocumentType node can have the following child node types: Notation and Entity. The DocumentType node can appear as the child of the Document node.

NODE_DOCUMENT_FRAGMENT (11)

The node represents a document fragment (its nodeTypeStringproperty is "documentfragment"). The DocumentFragment node associates a node or subtree with a document without actually being contained within the document. A DocumentFragment 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)

The node represents a notation in the document type declaration (its nodeTypeStringproperty is "notation"). A 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.

Requirements

Header msxml2.h, msxml2.idl
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also