XmlNodeType 枚举
定义
指定节点的类型。Specifies the type of node.
public enum class XmlNodeType
public enum XmlNodeType
type XmlNodeType =
Public Enum XmlNodeType
- 继承
字段
Attribute | 2 | 特性(例如, |
CDATA | 4 | CDATA 部分(例如, |
Comment | 8 | 注释(例如, |
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 | 由以下标记指示的文档类型声明(例如, |
Element | 1 | 元素(例如, |
EndElement | 15 | 末尾元素标记(例如, |
EndEntity | 16 | 由于调用 ResolveEntity() 而使 |
Entity | 6 | 实体声明(例如, |
EntityReference | 5 | 实体引用(例如, |
None | 0 | 如果未调用 |
Notation | 12 | 文档类型声明中的表示法(例如, |
ProcessingInstruction | 7 | 处理指令(例如, |
SignificantWhitespace | 14 | 混合内容模型中标记间的空格或 |
Text | 3 | 节点的文本内容。The text content of a node. |
Whitespace | 13 | 标记间的空白。White space between markup. |
XmlDeclaration | 17 | XML 声明(例如, |
注解
下表提供了有关 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 |
EntityReference ,Text EntityReference , Text |
无。None. 它不被视为的子节点 Element 。It 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. | DocumentFragment 、 EntityReference 和 Element DocumentFragment , EntityReference , and Element |
Comment |
无。None. | Document , DocumentFragment , EntityReference Document , DocumentFragment , EntityReference |
|
Document |
XmlDeclaration , Element (最多1个)、 ProcessingInstruction 、 Comment 、DocumentType XmlDeclaration , 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 , EntityReference Element , ProcessingInstruction , Comment , Text , CDATA , EntityReference |
无。None. |
DocumentType |
Notation ,Entity Notation , Entity |
NoneNone | |
Element |
Element , Text , Comment , ProcessingInstruction , CDATA , EntityReference Element , Text , Comment , ProcessingInstruction , CDATA , EntityReference |
Document , DocumentFragment , EntityReference , Element Document , DocumentFragment , EntityReference , Element |
|
EndElement |
当 XmlReader 获取到元素末尾时返回。Returned when the XmlReader gets to the end of an element. | ||
EndEntity |
|||
Entity |
表示展开的实体(例如 Text 和节点)的子节点 EntityReference Child nodes that represent the expanded entity (for example, Text and EntityReference nodes) |
DocumentType |
|
EntityReference |
Element , ProcessingInstruction , Comment , Text , CDATA , EntityReference Element , ProcessingInstruction , Comment , Text , CDATA , EntityReference |
Attribute , DocumentFragment , Element , EntityReference Attribute , DocumentFragment , Element , EntityReference |
|
None |
|||
Notation |
NoneNone | DocumentType |
|
ProcessingInstruction |
NoneNone | Document , DocumentFragment , Element , EntityReference Document , DocumentFragment , Element , EntityReference |
|
SignificantWhitespace |
|||
Text |
NoneNone | Attribute , DocumentFragment , Element , EntityReference Attribute , DocumentFragment , Element , EntityReference |
|
Whitespace |
|||
XmlDeclaration |
必须是文档中的第一个节点。Must be the first node in the document. 它可以具有提供版本和编码信息的特性。It can have attributes that provide version and encoding information. | NoneNone | Document |