XmlReaderSettings 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 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 . |
ConformanceLevel | Document. |
IgnoreComments | false . |
IgnoreProcessingInstructions | false . |
IgnoreWhitespace | false . |
LineNumberOffset | 0。 |
LinePositionOffset | 0。 |
MaxCharactersFromEntities | 0 (扩展实体) 的字符数没有限制。 |
MaxCharactersInDocument | 0 (XML 文档) 没有大小限制。 |
NameTable | null . |
DtdProcessing | Prohibit |
ProhibitDtd | true . 此属性已过时。 请改用 DtdProcessing。 如果已将 设置为 ProhibitDtd 其默认值 true ,则设置为 DtdProcessingProhibit 。 如果已将 ProhibitDtd 设置为 false DtdProcessingParse 。 |
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 解析器。
- 属性
另请参阅
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈