XmlNodeType 枚举


指定节点的类型。Specifies the type of node.

public enum class XmlNodeType
public enum XmlNodeType
type XmlNodeType = 
Public Enum XmlNodeType


Attribute 2

特性(例如,id='123')。An attribute (for example, id='123' ).


CDATA 部分(例如,<![CDATA[my escaped text]]>)。A CDATA section (for example, <![CDATA[my escaped text]]> ).

Comment 8

注释(例如,<!-- my comment -->)。A comment (for example, <!-- my comment --> ).

Document 9

作为文档树的根的文档对象提供对整个 XML 文档的访问。A document object that, as the root of the document tree, provides access to the entire XML document.

DocumentFragment 11

文档片段。A document fragment.

DocumentType 10

由以下标记指示的文档类型声明(例如,<!DOCTYPE...>)。The document type declaration, indicated by the following tag (for example, <!DOCTYPE...> ).

Element 1

元素(例如,<item>)。An element (for example, <item> ).

EndElement 15

末尾元素标记(例如,</item>)。An end element tag (for example, </item> ).

EndEntity 16

由于调用 ResolveEntity() 而使 XmlReader 到达实体替换的末尾时返回。Returned when XmlReader gets to the end of the entity replacement as a result of a call to ResolveEntity().

Entity 6

实体声明(例如,<!ENTITY...>)。An entity declaration (for example, <!ENTITY...> ).

EntityReference 5

实体引用(例如,&num;)。A reference to an entity (for example, &num; ).

None 0

如果未调用 Read 方法,则由 XmlReader 返回。This is returned by the XmlReader if a Read method has not been called.

Notation 12

文档类型声明中的表示法(例如,<!NOTATION...>)。A notation in the document type declaration (for example, <!NOTATION...> ).

ProcessingInstruction 7

处理指令(例如,<?pi test?>)。A processing instruction (for example, <?pi test?> ).

SignificantWhitespace 14

混合内容模型中标记间的空格或 xml:space="preserve" 范围内的空格。White space between markup in a mixed content model or white space within the xml:space="preserve" scope.

Text 3

节点的文本内容。The text content of a node.

Whitespace 13

标记间的空白。White space between markup.

XmlDeclaration 17

XML 声明(例如,<?xml version='1.0'?>)。The XML declaration (for example, <?xml version='1.0'?> ).


下表提供了有关 XML 节点及其父节点和子节点的其他信息。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 EntityReferenceTextEntityReference, Text 无。None. 它不被视为的子节点 ElementIt is not considered a child node of an Element.
CDATA CDATA 节用于转义文本块,否则这些文本块会被识别为标记。CDATA sections are used to escape blocks of text that would otherwise be recognized as markup. 无。None. DocumentFragmentEntityReferenceElementDocumentFragment, EntityReference, and Element
Comment 无。None. Document, DocumentFragment, EntityReferenceDocument, DocumentFragment, EntityReference
Document XmlDeclarationElement (最多1个)、 ProcessingInstructionCommentDocumentTypeXmlDeclaration, Element (a maximum of one), ProcessingInstruction, Comment, DocumentType NoneNone
DocumentFragment 将节点或子树与文档相关联,但实际上不包含在文档中。Associates a node or subtree with a document without actually being contained within the document. Element, ProcessingInstruction, Comment, Text, CDATA, EntityReferenceElement, ProcessingInstruction, Comment, Text, CDATA, EntityReference 无。None.
DocumentType NotationEntityNotation, Entity NoneNone
Element Element, Text, Comment, ProcessingInstruction, CDATA, EntityReferenceElement, Text, Comment, ProcessingInstruction, CDATA, EntityReference Document, DocumentFragment, EntityReference, ElementDocument, DocumentFragment, EntityReference, Element
EndElement XmlReader 获取到元素末尾时返回。Returned when the XmlReader gets to the end of an element.
Entity 表示展开的实体(例如 Text 和节点)的子节点 EntityReferenceChild nodes that represent the expanded entity (for example, Text and EntityReference nodes) DocumentType
EntityReference Element, ProcessingInstruction, Comment, Text, CDATA, EntityReferenceElement, ProcessingInstruction, Comment, Text, CDATA, EntityReference Attribute, DocumentFragment, Element, EntityReferenceAttribute, DocumentFragment, Element, EntityReference
Notation NoneNone DocumentType
ProcessingInstruction NoneNone Document, DocumentFragment, Element, EntityReferenceDocument, DocumentFragment, Element, EntityReference
Text NoneNone Attribute, DocumentFragment, Element, EntityReferenceAttribute, DocumentFragment, Element, EntityReference
XmlDeclaration 必须是文档中的第一个节点。Must be the first node in the document. 它可以具有提供版本和编码信息的特性。It can have attributes that provide version and encoding information. NoneNone Document