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
Attributenode can have the following child node types:TextandEntityReference. TheAttributenode 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
CDATAnode cannot have any child nodes. It can appear as the child of theDocumentFragment,EntityReference, andElementnodes.
System.Xml.XmlNodeType Enum, System.Xml Namespace
Comment = 8;
A comment.Example XML:
<!-- comment -->A
Commentnode cannot have any child nodes. It can appear as the child of theDocument,DocumentFragment,Element, andEntityReferencenodes.
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
Documentnode 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
DocumentFragmentnode associates a node or sub-tree with a document without actually being contained within the document. ADocumentFragmentnode 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
DocumentTypenode can have the following child node types:NotationandEntity. It can appear as the child of theDocumentnode.
System.Xml.XmlNodeType Enum, System.Xml Namespace
Element = 1;
An element.Example XML:
<name>An
Elementnode can have the following child node types:Element,Text,Comment,ProcessingInstruction,CDATA, andEntityReference. It can be the child of theDocument,DocumentFragment,EntityReference, andElementnodes.
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
Entitynode can have child nodes that represent the expanded entity (for example,TextandEntityReferencenodes). It can appear as the child of theDocumentTypenode.
System.Xml.XmlNodeType Enum, System.Xml Namespace
EntityReference = 5;
A reference to an entity.Example XML:
&num;An
EntityReferencenode can have the following child node types:Element,ProcessingInstruction,Comment,Text,CDATA, andEntityReference. It can appear as the child of theAttribute,DocumentFragment,Element, andEntityReferencenodes.
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
Notationnode cannot have any child nodes. It can appear as the child of theDocumentTypenode.
System.Xml.XmlNodeType Enum, System.Xml Namespace
ProcessingInstruction = 7;
A processing instruction.Example XML:
<?pi test?>A
ProcessingInstructionnode cannot have any child nodes. It can appear as the child of theDocument,DocumentFragment,Element, andEntityReferencenodes.
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
Textnode cannot have any child nodes. It can appear as the child node of theAttribute,DocumentFragment,Element, andEntityReferencenodes.
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
XmlDeclarationnode must be the first node in the document. It cannot have children. It is a child of theDocumentnode. 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