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.
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 。 如果您已將 設定 ProhibitDtdfalseDtdProcessingParse
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 解析器。

屬性

另請參閱

適用於