XmlReaderSettings 构造函数

定义

初始化 XmlReaderSettings 类的新实例。

重载

XmlReaderSettings()

初始化 XmlReaderSettings 类的新实例。

XmlReaderSettings(XmlResolver)
已过时.

初始化 XmlReaderSettings 类的新实例。

XmlReaderSettings()

Source:
XmlReaderSettings.cs
Source:
XmlReaderSettings.cs
Source:
XmlReaderSettings.cs

初始化 XmlReaderSettings 类的新实例。

public:
 XmlReaderSettings();
public XmlReaderSettings ();
Public Sub New ()

示例

下面创建一个设置对象,该对象可用于构造一个读取器,用于去除处理指令、注释和微不足道的空白。

// 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

注解

下表显示了 XmlReaderSettings实例的初始属性值。

财产 初始值
Async false
CheckCharacters true
CloseInput false
ConformanceLevel Document
DtdProcessing Prohibit
IgnoreComments false
IgnoreProcessingInstructions false
IgnoreWhitespace false
LineNumberOffset 0.
LinePositionOffset 0.
MaxCharactersFromEntities 0(扩展实体导致的字符数没有限制)。
MaxCharactersInDocument 0(XML 文档的大小没有限制)。
NameTable null
ProhibitDtd true。 此属性已过时。 请改用 DtdProcessing。 如果已将 ProhibitDtd 设置为其默认值,trueDtdProcessing 设置为 Prohibit。 如果已将 ProhibitDtd 设置为 falseDtdProcessing 设置为 Parse
Schemas XmlSchemaSet 对象。
ValidationFlags ProcessIdentityConstraints
ValidationType None
XmlResolver 新的 XmlUrlResolver 对象。

另请参阅

适用于

XmlReaderSettings(XmlResolver)

注意

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

初始化 XmlReaderSettings 类的新实例。

public:
 XmlReaderSettings(System::Xml::XmlResolver ^ resolver);
[System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
public XmlReaderSettings (System.Xml.XmlResolver resolver);
[<System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)>]
new System.Xml.XmlReaderSettings : System.Xml.XmlResolver -> System.Xml.XmlReaderSettings
Public Sub New (resolver As XmlResolver)

参数

resolver
XmlResolver

XML 解析程序。

属性

另请参阅

适用于