XmlReaderSettingsとは? わかりやすく解説

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 リーダーが検証エラーを検出すると発生します。
参照参照



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「XmlReaderSettings」の関連用語

XmlReaderSettingsのお隣キーワード
検索ランキング

   

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



XmlReaderSettingsのページの著作権

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

©2026 GRAS Group, Inc.RSS