XmlReaderSettings.IgnoreProcessingInstructions 屬性

定義

取得或設定一個值,指示是否忽略處理指令。

public:
 property bool IgnoreProcessingInstructions { bool get(); void set(bool value); };
public bool IgnoreProcessingInstructions { get; set; }
member this.IgnoreProcessingInstructions : bool with get, set
Public Property IgnoreProcessingInstructions As Boolean

屬性值

true 忽略處理指令;否則 false。 預設值為 false

範例

下列會建立設定物件,可用來建構讀取器,以去除處理指令、批注和微不足道的空格符。

// Set the reader settings.
XmlReaderSettings settings = new XmlReaderSettings();
settings.IgnoreComments = true;
settings.IgnoreProcessingInstructions = true;
settings.IgnoreWhitespace = true;
' Set the reader settings.
Dim settings as XmlReaderSettings = new XmlReaderSettings()
settings.IgnoreComments = true
settings.IgnoreProcessingInstructions = true
settings.IgnoreWhitespace = true

備註

將此屬性設為 時 true ,讀取器會回傳多個連續的文字節點。 這不影響驗證。

適用於

另請參閱