public enum XmlNodeType
Object
ValueType
Enum
XmlNodeType
System.Xml
XML
Specifies the type of node.
A given set of XML data is modeled as a tree of nodes. This enumeration specifies the different node types.
System.Xml Namespace
XmlNodeType Fields
XmlNodeType.Attribute Field
XmlNodeType.CDATA Field
XmlNodeType.Comment Field
XmlNodeType.Document Field
XmlNodeType.DocumentFragment Field
XmlNodeType.DocumentType Field
XmlNodeType.Element Field
XmlNodeType.EndElement Field
XmlNodeType.EndEntity Field
XmlNodeType.Entity Field
XmlNodeType.EntityReference Field
XmlNodeType.None Field
XmlNodeType.Notation Field
XmlNodeType.ProcessingInstruction Field
XmlNodeType.SignificantWhitespace Field
XmlNodeType.Text Field
XmlNodeType.Whitespace Field
XmlNodeType.XmlDeclaration Field
XmlNodeType.value__ Field
Attribute = 2;
An attribute.Example XML:
id="123"
An
Attribute
node can have the following child node types:Text
andEntityReference
. TheAttribute
node does not appear as the child node of any other node type. It is not considered a child node of anElement
.
System.Xml.XmlNodeType Enum, System.Xml Namespace
CDATA = 4;
A CDATA section.Example XML:
<![CDATA[escaped text]]>
CDATA sections are used to escape blocks of text that would otherwise be recognized as markup. A
CDATA
node cannot have any child nodes. It can appear as the child of theDocumentFragment
,EntityReference
, andElement
nodes.
System.Xml.XmlNodeType Enum, System.Xml Namespace
Comment = 8;
A comment.Example XML:
<!-- comment -->
A
Comment
node cannot have any child nodes. It can appear as the child of theDocument
,DocumentFragment
,Element
, andEntityReference
nodes.
System.Xml.XmlNodeType Enum, System.Xml Namespace
Document = 9;
A document object that, as the root of the document tree, provides access to the entire XML document.A
Document
node can have the following child node types:XmlDeclaration
,Element
(maximum of one),ProcessingInstruction
,Comment
, andDocumentType
. It cannot appear as the child of any node types.
System.Xml.XmlNodeType Enum, System.Xml Namespace
DocumentFragment = 11;
A document fragment.The
DocumentFragment
node associates a node or sub-tree with a document without actually being contained within the document. ADocumentFragment
node can have the following child node types:Element
,ProcessingInstruction
,Comment
,Text
,CDATA
, andEntityReference
. It cannot appear as the child of any node types.
System.Xml.XmlNodeType Enum, System.Xml Namespace
DocumentType = 10;
The document type declaration, indicated by the following tag.Example XML:
<!DOCTYPE ...>
A
DocumentType
node can have the following child node types:Notation
andEntity
. It can appear as the child of theDocument
node.
System.Xml.XmlNodeType Enum, System.Xml Namespace
Element = 1;
An element.Example XML:
<name>
An
Element
node can have the following child node types:Element
,Text
,Comment
,ProcessingInstruction
,CDATA
, andEntityReference
. It can be the child of theDocument
,DocumentFragment
,EntityReference
, andElement
nodes.
System.Xml.XmlNodeType Enum, System.Xml Namespace
EndElement = 15;
An end element.Example XML:
</name>
Returned when XmlReader gets to the end of an element.
System.Xml.XmlNodeType Enum, System.Xml Namespace
EndEntity = 16;
Returned when XmlReader gets to the end of the entity replacement as a result of a call to System.Xml.XmlReader.ResolveEntity .
System.Xml.XmlNodeType Enum, System.Xml Namespace
Entity = 6;
An entity declaration.Example XML:
<!ENTITY ...>
An
Entity
node can have child nodes that represent the expanded entity (for example,Text
andEntityReference
nodes). It can appear as the child of theDocumentType
node.
System.Xml.XmlNodeType Enum, System.Xml Namespace
EntityReference = 5;
A reference to an entity.Example XML:
&num;
An
EntityReference
node can have the following child node types:Element
,ProcessingInstruction
,Comment
,Text
,CDATA
, andEntityReference
. It can appear as the child of theAttribute
,DocumentFragment
,Element
, andEntityReference
nodes.
System.Xml.XmlNodeType Enum, System.Xml Namespace
None = 0;
This is returned by the XmlReader if a read method has not been called or if no more nodes are available to be read.
System.Xml.XmlNodeType Enum, System.Xml Namespace
Notation = 12;
A notation in the document type declaration.Example XML:
<!NOTATION ...>
A
Notation
node cannot have any child nodes. It can appear as the child of theDocumentType
node.
System.Xml.XmlNodeType Enum, System.Xml Namespace
ProcessingInstruction = 7;
A processing instruction.Example XML:
<?pi test?>
A
ProcessingInstruction
node cannot have any child nodes. It can appear as the child of theDocument
,DocumentFragment
,Element
, andEntityReference
nodes.
System.Xml.XmlNodeType Enum, System.Xml Namespace
SignificantWhitespace = 14;
White space between markup in a mixed content model or white space within thexml:space="preserve"
scope.
System.Xml.XmlNodeType Enum, System.Xml Namespace
Text = 3;
The text content of a node.A
Text
node cannot have any child nodes. It can appear as the child node of theAttribute
,DocumentFragment
,Element
, andEntityReference
nodes.
System.Xml.XmlNodeType Enum, System.Xml Namespace
Whitespace = 13;
White space between markup.
System.Xml.XmlNodeType Enum, System.Xml Namespace
XmlDeclaration = 17;
The XML declaration.Example XML:
<?xml version="1.0"?>
The
XmlDeclaration
node must be the first node in the document. It cannot have children. It is a child of theDocument
node. It can have attributes that provide version and encoding information.
System.Xml.XmlNodeType Enum, System.Xml Namespace
value__;
System.Xml.XmlNodeType Enum, System.Xml Namespace