XmlNodeType 列舉

定義

指定節點類型。

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

欄位

Attribute 2

屬性 (例如 id='123' )。

CDATA 4

CDATA 區段 (例如 <![CDATA[my escaped text]]> )。

Comment 8

註解 (例如 <!-- my comment --> )。

Document 9

文件物件 (作為文件樹狀結構的根) 可存取整個 XML 文件。

DocumentFragment 11

文件片段。

DocumentType 10

文件類型宣告,以下列標記指示 (例如 <!DOCTYPE...> )。

Element 1

項目 (例如 <item> )。

EndElement 15

結尾項目標記 (例如 </item> )。

EndEntity 16

XmlReader 到達實體取代的結尾 (由於呼叫 ResolveEntity() 所致) 時傳回。

Entity 6

實體宣告 (例如 <!ENTITY...> )。

EntityReference 5

實體參考 (例如 &num; )。

None 0

如果尚未呼叫 Read 方法,則由 XmlReader 傳回此項目。

Notation 12

文件類型宣告中的標記法 (例如 <!NOTATION...> )。

ProcessingInstruction 7

處理指示 (例如 <?pi test?> )。

SignificantWhitespace 14

混合內容模型中標記之間的空白字元,或 xml:space="preserve" 範圍中的空白字元。

Text 3

節點的文字內容。

節點 Text 不能有任何子節點。 它可以顯示為 、 DocumentFragment ElementEntityReference 節點的 Attribute 子節點。

Whitespace 13

標記之間的空白字元。

XmlDeclaration 17

XML 宣告 (例如 <?xml version='1.0'?> )。

節點 XmlDeclaration 必須是檔中的第一個節點。 它不能有子系。 它是節點的 Document 子系。 它可以有提供版本和編碼資訊的屬性。

備註

下表提供 XML 節點及其父節點和子節點的其他資訊。

欄位 描述 可以有子節點: 可以是的子節點:
Attribute EntityReference, Text 無。 它不會被視為 的 Element 子節點。
CDATA CDATA 區段是用來逸出會辨識為標記的文字區塊。 無。 DocumentFragmentEntityReferenceElement
Comment 無。 DocumentDocumentFragmentEntityReference
Document XmlDeclarationElement (最多一個) 、、 ProcessingInstructionComment``DocumentType None
DocumentFragment 將節點或子樹與檔建立關聯,而不會實際包含在檔中。 ElementProcessingInstructionCommentTextCDATAEntityReference 無。
DocumentType Notation, Entity None
Element ElementTextCommentProcessingInstructionCDATAEntityReference Document, DocumentFragment, EntityReference, Element
EndElement XmlReader 取得至專案結尾時傳回。
EndEntity
Entity 例如,代表展開實體的子節點 (, Text 以及 EntityReference 節點) DocumentType
EntityReference ElementProcessingInstructionCommentTextCDATAEntityReference Attribute, DocumentFragment, Element, EntityReference
None
Notation DocumentType
ProcessingInstruction Document, DocumentFragment, Element, EntityReference
SignificantWhitespace
Text Attribute, DocumentFragment, Element, EntityReference
Whitespace
XmlDeclaration 必須是檔中的第一個節點。 它可以有提供版本和編碼資訊的屬性。 None Document

適用於