XmlNodeType Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies the type of node.
public enum class XmlNodeType
public enum XmlNodeType
type XmlNodeType =
Public Enum XmlNodeType
- Inheritance
Fields
Name | Value | Description |
---|---|---|
None | 0 | This is returned by the XmlReader if a |
Element | 1 | An element (for example, |
Attribute | 2 | An attribute (for example, |
Text | 3 | The text content of a node. A Text node cannot have any child nodes. It can appear as the child node of the Attribute, DocumentFragment, Element, and EntityReference nodes. |
CDATA | 4 | A CDATA section (for example, |
EntityReference | 5 | A reference to an entity (for example, |
Entity | 6 | An entity declaration (for example, |
ProcessingInstruction | 7 | A processing instruction (for example, |
Comment | 8 | A comment (for example, |
Document | 9 | A document object that, as the root of the document tree, provides access to the entire XML document. |
DocumentType | 10 | The document type declaration, indicated by the following tag (for example, |
DocumentFragment | 11 | A document fragment. |
Notation | 12 | A notation in the document type declaration (for example, |
Whitespace | 13 | White space between markup. |
SignificantWhitespace | 14 | White space between markup in a mixed content model or white space within the |
EndElement | 15 | An end element tag (for example, |
EndEntity | 16 | Returned when |
XmlDeclaration | 17 | The XML declaration (for example, The XmlDeclaration node must be the first node in the document. It cannot have children. It is a child of the Document node. It can have attributes that provide version and encoding information. |
Remarks
The following table provides additional information about XML nodes, as well as their parent and child nodes.
Field | Description | Can have child nodes: | Can be a child node of: |
---|---|---|---|
Attribute |
EntityReference , Text |
None. It is not considered a child node of an Element . |
|
CDATA |
CDATA sections are used to escape blocks of text that would otherwise be recognized as markup. | None. | DocumentFragment , EntityReference , and Element |
Comment |
None. | Document , DocumentFragment , EntityReference |
|
Document |
XmlDeclaration , Element (a maximum of one), ProcessingInstruction , Comment , DocumentType |
None | |
DocumentFragment |
Associates a node or subtree with a document without actually being contained within the document. | Element , ProcessingInstruction , Comment , Text , CDATA , EntityReference |
None. |
DocumentType |
Notation , Entity |
None | |
Element |
Element , Text , Comment , ProcessingInstruction , CDATA , EntityReference |
Document , DocumentFragment , EntityReference , Element |
|
EndElement |
Returned when the XmlReader gets to the end of an element. | ||
EndEntity |
|||
Entity |
Child nodes that represent the expanded entity (for example, Text and EntityReference nodes) |
DocumentType |
|
EntityReference |
Element , ProcessingInstruction , Comment , Text , CDATA , EntityReference |
Attribute , DocumentFragment , Element , EntityReference |
|
None |
|||
Notation |
None | DocumentType |
|
ProcessingInstruction |
None | Document , DocumentFragment , Element , EntityReference |
|
SignificantWhitespace |
|||
Text |
None | Attribute , DocumentFragment , Element , EntityReference |
|
Whitespace |
|||
XmlDeclaration |
Must be the first node in the document. It can have attributes that provide version and encoding information. | None | Document |