Xml.XMLIntf.TNodeType

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

TNodeType = (ntReserved, ntElement, ntAttribute, ntText, ntCData,
ntEntityRef, ntEntity, ntProcessingInstr, ntComment, ntDocument,
ntDocType, ntDocFragment, ntNotation);

C++

enum DECLSPEC_DENUM TNodeType : unsigned char { ntReserved, ntElement, ntAttribute, ntText, ntCData, ntEntityRef, ntEntity, ntProcessingInstr, ntComment, ntDocument, ntDocType, ntDocFragment, ntNotation };

Properties

Type Visibility Source Unit Parent
enum public
Xml.XMLIntf.pas
Xml.XMLIntf.hpp
Xml.XMLIntf Xml.XMLIntf

Description

TNodeType identifies the type of a node in an XML document.

TNodeType identifies the type of a node in an XML document. The following table lists the possible values:



Value Meaning

ntReserved

Not used

ntElement

The node represents an element. Element nodes represent simple tags that have child nodes. (Note that sometimes these child nodes do not appear when using IXMLNode. For example child nodes of type ntText are typically hidden by IXMLNode and appear only as the value of the Text property). The child nodes of an element node can have the following node types: ntElement, ntText, ntCData, ntEntityRef, ntProcessingInstr, and ntComment. Element nodes can also have attributes (ntAttribute). Element nodes can be the child of a node of type ntDocument, ntDocFragment, ntEntityRef, and ntElement.

ntAttribute

The node represents an attribute of an element. It is not the child of another node, but its value can be accessed using the Attribute property of the element node's IXMLNode interface. An attribute node can have child nodes of type ntText and ntEntityRef.

ntText

The node represents the text content of a tag. A text node cannot have any child nodes, but can appear as the child node of a node of type ntAttribute, ntDocFragment, ntElement, or ntEntityRef.

ntCData

The node represents a CDATA section in the XML source. CDATA sections identify blocks of text that would otherwise be interpreted as markup. An ntCData node can't have any child nodes. They can appear as the child of an ntDocFragment, ntEntityRef, or ntElement node.

ntEntityRef

The node represents a reference to an entity in the XML document. This can be any type of entity, including character entity references. The children of an entity reference node can be of the following types: ntElement, ntProcessingInstr, ntComment, ntText, ntCData, and ntEntityRef. The entity reference node can appear as the child of an ntAttribute, ntDocFragment, ntElement, or ntEntityRef node.

ntEntity

The node represents an expanded entity. Entity nodes can have child nodes that represent the expanded entity (for example, ntText and ntEntityRef nodes). Entity nodes only appear as the child of an ntDocType node.

ntProcessingInstr

The node represents a processing instruction (PI) from the XML document. A PI node cannot have any child nodes, but can appear as the child node of a node of type ntDocument, ntDocFragment, ntElement, or ntEntityRef.

ntComment

The node represents a comment in the XML document. Comment nodes do not have child nodes. They appear as the child of an ntDocument, ntDocFragment, ntElement, or ntEntityRef node.

ntDocument

The node represents a document object, which is the root of the entire XML document. Document nodes have a single ntElement node as a child (the DocumentElement). In addition, they can have child nodes of type ntProcessingInstr, ntComment, and ntDocType. Because the document is the root of the XML document, it never appears as a child node.

ntDocType

The node represents the document type declaration, indicated by the <!DOCTYPE > tag. The document type node can child nodes of type ntNotation and ntEntity. It always appears as the child of the document node.

ntDocFragment

The node represents a document fragment. A document fragment node associates a node or subtree with a document without actually being contained in the document. Document fragment nodes can have child nodes of type ntElement, ntProcessingInstr, ntComment, ntText, ntCData, and ntEntityRef. It never appears as the child of another node.

ntNotation

A node represents a notation in the document type declaration. It always appears as the child of an ntDocType node and never has any child nodes.