XmlReader.Settingsとは? わかりやすく解説

XmlReader.Settings プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

この XmlReader インスタンス作成するために使用した XmlReaderSettings オブジェクト取得します

名前空間: System.Xml
アセンブリ: System.Xml (system.xml.dll 内)
構文構文

Public Overridable ReadOnly
 Property Settings As XmlReaderSettings
Dim instance As XmlReader
Dim value As XmlReaderSettings

value = instance.Settings
public virtual XmlReaderSettings Settings { get;
 }
public:
virtual property XmlReaderSettings^ Settings {
    XmlReaderSettings^ get ();
}
/** @property */
public XmlReaderSettings get_Settings ()
public function get Settings
 () : XmlReaderSettings

プロパティ
このリーダーインスタンス作成するために使用した XmlReaderSettings オブジェクトCreate メソッド使用しないでこのリーダー作成した場合、このプロパティnull 参照 (Visual Basic では Nothing) を返します

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

XmlReaderSettings イベント


XmlReaderSettings クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

Create メソッド作成されXmlReader オブジェクトサポートする一連の機能指定します

名前空間: System.Xml
アセンブリ: System.Xml (system.xml.dll 内)
構文構文

Public NotInheritable Class
 XmlReaderSettings
Dim instance As XmlReaderSettings
public sealed class XmlReaderSettings
public ref class XmlReaderSettings sealed
public final class XmlReaderSettings
public final class XmlReaderSettings
解説解説

Microsoft .NET Framework version 2.0 リリースXmlReader インスタンス取得する場合は、Create メソッド使用お勧めます。Create メソッドは、XmlReaderSettings クラス使用して作成されXmlReader オブジェクト実装する機能指定します

詳細については、「XML リーダー作成」を参照してください

セキュリティについての考慮事項

XmlReaderSettings クラス使用する際の考慮事項次に示します

使用例使用例

必要な資格情報で XmlUrlResolver を使用する XmlReader作成する例を次に示します

' Create an XmlUrlResolver with the credentials necessary to access
 the Web server.
Dim resolver As New XmlUrlResolver()
Dim myCred As System.Net.NetworkCredential
myCred = New System.Net.NetworkCredential(UserName, SecurelyStoredPassword,
 Domain)
resolver.Credentials = myCred

Dim settings As New XmlReaderSettings()
settings.XmlResolver = resolver

' Create the reader.
Dim reader As XmlReader = XmlReader.Create("http://serverName/data/books.xml",
 settings)
// Create an XmlUrlResolver with the credentials necessary to access
 the Web server.
XmlUrlResolver resolver = new XmlUrlResolver();
System.Net.NetworkCredential myCred;
myCred  = new System.Net.NetworkCredential(UserName,SecurelyStoredPassword,Domain);
  
resolver.Credentials = myCred;

XmlReaderSettings settings = new XmlReaderSettings();
settings.XmlResolver = resolver;

// Create the reader.
XmlReader reader = XmlReader.Create("http://serverName/data/books.xml",
 settings);
継承階層継承階層
System.Object
  System.Xml.XmlReaderSettings
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

XmlReaderSettings コンストラクタ

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

XmlReaderSettings クラス新しインスタンス初期化します。

名前空間: System.Xml
アセンブリ: System.Xml (system.xml.dll 内)
構文構文

Dim instance As New XmlReaderSettings
public XmlReaderSettings ()
public:
XmlReaderSettings ()
public XmlReaderSettings ()
public function XmlReaderSettings ()
解説解説

XmlReaderSettingsインスタンス初期プロパティ値を次の表に示します

プロパティ

初期値

CheckCharacters

true

ConformanceLevel

Document

IgnoreComments

false

IgnoreProcessingInstructions

false

IgnoreWhitespace

false

LineNumberOffset

0

LinePositionOffset

0

NameTable

null 参照 (Visual Basic では Nothing)

ProhibitDtd

true

Schemas

空の XmlSchemaSet オブジェクト

ValidationFlags

ProcessIdentityConstraints

ValidationType

None

XmlResolver

新しい XmlUrlResolver オブジェクト

使用例使用例

処理命令コメント、および意味のない空白取り除くリーダー構築するために使用できる設定オブジェクトの作成方法次に示します

' Set the reader settings.
Dim settings as XmlReaderSettings = new
 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.
XmlReaderSettings^ settings = gcnew XmlReaderSettings;
settings->IgnoreComments = true;
settings->IgnoreProcessingInstructions = true;
settings->IgnoreWhitespace = true;

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

XmlReaderSettings プロパティ


XmlReaderSettings メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

XmlReaderSettings メンバ

Create メソッド作成されXmlReader オブジェクトサポートする一連の機能指定します

XmlReaderSettings データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド XmlReaderSettings XmlReaderSettings クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ XmlResolver 外部ドキュメントへのアクセス使用する XmlResolver を設定します
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
パブリック イベントパブリック イベント
  名前 説明
パブリック イベント ValidationEventHandler リーダー検証エラー検出する発生します
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「XmlReader.Settings」の関連用語

XmlReader.Settingsのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



XmlReader.Settingsのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS