System.Xml.XmlNodeType Enum

public enum XmlNodeType

Base Types

Object
  ValueType
    Enum
      XmlNodeType

Assembly

System.Xml

Library

XML

Summary

Specifies the type of node.

Description

A given set of XML data is modeled as a tree of nodes. This enumeration specifies the different node types.

See Also

System.Xml Namespace

Members

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


XmlNodeType.Attribute Field

Attribute = 2;

Summary

An attribute.

Example XML: id="123"

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 .

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.CDATA Field

CDATA = 4;

Summary

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 the DocumentFragment , EntityReference , and Element nodes.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.Comment Field

Comment = 8;

Summary

A comment.

Example XML: <!-- comment -->

A Comment node cannot have any child nodes. It can appear as the child of the Document , DocumentFragment , Element , and EntityReference nodes.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.Document Field

Document = 9;

Summary

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 , and DocumentType . It cannot appear as the child of any node types.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.DocumentFragment Field

DocumentFragment = 11;

Summary

A document fragment.

The DocumentFragment node associates a node or sub-tree with a document without actually being contained within the document. A DocumentFragment node can have the following child node types: Element , ProcessingInstruction , Comment , Text , CDATA , and EntityReference . It cannot appear as the child of any node types.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.DocumentType Field

DocumentType = 10;

Summary

The document type declaration, indicated by the following tag.

Example XML: &lt;!DOCTYPE ...>

A DocumentType node can have the following child node types: Notation and Entity . It can appear as the child of the Document node.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.Element Field

Element = 1;

Summary

An element.

Example XML: &lt;name>

An Element node can have the following child node types: Element , Text , Comment , ProcessingInstruction , CDATA , and EntityReference . It can be the child of the Document , DocumentFragment , EntityReference , and Element nodes.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.EndElement Field

EndElement = 15;

Summary

An end element.

Example XML: &lt;/name>

Returned when XmlReader gets to the end of an element.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.EndEntity Field

EndEntity = 16;

Summary

Returned when XmlReader gets to the end of the entity replacement as a result of a call to System.Xml.XmlReader.ResolveEntity .

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.Entity Field

Entity = 6;

Summary

An entity declaration.

Example XML: &lt;!ENTITY ...>

An Entity node can have child nodes that represent the expanded entity (for example, Text and EntityReference nodes). It can appear as the child of the DocumentType node.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.EntityReference Field

EntityReference = 5;

Summary

A reference to an entity.

Example XML: &amp;num;

An EntityReference node can have the following child node types: Element , ProcessingInstruction , Comment , Text , CDATA , and EntityReference . It can appear as the child of the Attribute , DocumentFragment , Element , and EntityReference nodes.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.None Field

None = 0;

Summary

This is returned by the XmlReader if a read method has not been called or if no more nodes are available to be read.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.Notation Field

Notation = 12;

Summary

A notation in the document type declaration.

Example XML: &lt;!NOTATION ...>

A Notation node cannot have any child nodes. It can appear as the child of the DocumentType node.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.ProcessingInstruction Field

ProcessingInstruction = 7;

Summary

A processing instruction.

Example XML: &lt;?pi test?>

A ProcessingInstruction node cannot have any child nodes. It can appear as the child of the Document , DocumentFragment , Element , and EntityReference nodes.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.SignificantWhitespace Field

SignificantWhitespace = 14;

Summary

White space between markup in a mixed content model or white space within the xml:space="preserve" scope.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.Text Field

Text = 3;

Summary

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.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.Whitespace Field

Whitespace = 13;

Summary

White space between markup.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.XmlDeclaration Field

XmlDeclaration = 17;

Summary

The XML declaration.

Example XML: &lt;?xml version="1.0"?>

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.

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace

XmlNodeType.value__ Field

value__;

See Also

System.Xml.XmlNodeType Enum, System.Xml Namespace