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 = gcnew XmlReaderSettings;
settings->IgnoreComments = true;
settings->IgnoreProcessingInstructions = true;
settings->IgnoreWhitespace = true;
// 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 可能会导致从读取器返回多个连续的文本节点。 这不会影响验证。

适用于

另请参阅