XmlReaderSettings 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 XmlReaderSettings 類別的新實例。
多載
| XmlReaderSettings() |
初始化 XmlReaderSettings 類別的新實例。 |
| XmlReaderSettings(XmlResolver) |
已淘汰.
初始化 XmlReaderSettings 類別的新實例。 |
XmlReaderSettings()
初始化 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 設為預設值,true 將 DtdProcessing 設為 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 解析程式。
- 屬性