XmlNodeType 列舉

定義

指定節點的類型。

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

欄位

名稱 Description
None 0

XmlReader未呼叫某方法,則由 回傳Read

Element 1

一個元素(例如, <item> )。

Attribute 2

一個屬性(例如, id='123' )。

Text 3

節點的文字內容。

節點 Text 不能有任何子節點。 它可以作為 、 AttributeDocumentFragmentElement 和 節點的EntityReference子節點出現。

CDATA 4

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

EntityReference 5

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

Entity 6

實體聲明(例如, <!ENTITY...> )。

ProcessingInstruction 7

一個處理指令(例如, <?pi test?> )。

Comment 8

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

Document 9

作為文件樹根,提供完整 XML 文件存取權的文件物件。

DocumentType 10

文件類型聲明,由以下標籤表示(例如, <!DOCTYPE...> )。

DocumentFragment 11

一份文件碎片。

Notation 12

文件類型宣告中的符號(例如, <!NOTATION...> )。

Whitespace 13

標記之間留白。

SignificantWhitespace 14

混合內容模型標記間的空白,或作用波內 xml:space="preserve" 的空白區域。

EndElement 15

端元素標籤(例如, </item> )。

EndEntity 16

XmlReader 實體替換結束時,因呼叫 ResolveEntity()而回傳。

XmlDeclaration 17

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

節點 XmlDeclaration 必須是文件中的第一個節點。 它不能生育。 它是節點的子 Document 節點。 它可以有提供版本與編碼資訊的屬性。

備註

下表提供關於 XML 節點及其父節點與子節點的額外資訊。

Field Description 可以有子節點: 可以是 的子節點:
Attribute EntityReferenceText 沒有。 它不被視為 的 Element子節點。
CDATA CDATA 區段用於跳脫原本會被識別為標記的文字區塊。 沒有。 DocumentFragmentEntityReferenceElement
Comment 沒有。 DocumentDocumentFragmentEntityReference
Document XmlDeclaration,( Element 最大為一),ProcessingInstruction,, CommentDocumentType None
DocumentFragment 將節點或子樹與文件關聯,但實際上不包含在文件中。 ElementProcessingInstructionCommentTextCDATAEntityReference 沒有。
DocumentType NotationEntity None
Element ElementTextCommentProcessingInstructionCDATAEntityReference DocumentDocumentFragmentEntityReferenceElement
EndElement 當元素 XmlReader 結束時會回來。
EndEntity
Entity 代表擴展實體的子節點(例如, Text 以及 EntityReference 節點) DocumentType
EntityReference ElementProcessingInstructionCommentTextCDATAEntityReference AttributeDocumentFragmentElementEntityReference
None
Notation None DocumentType
ProcessingInstruction None DocumentDocumentFragmentElementEntityReference
SignificantWhitespace
Text None AttributeDocumentFragmentElementEntityReference
Whitespace
XmlDeclaration 必須是文件中的第一個節點。 它可以有提供版本與編碼資訊的屬性。 None Document

適用於