XmlReaderSettings.IgnoreWhitespace プロパティ

定義

重要でない空白を無視するかどうかを示す値を取得または設定します。

public:
 property bool IgnoreWhitespace { bool get(); void set(bool value); };
public bool IgnoreWhitespace { get; set; }
member this.IgnoreWhitespace : bool with get, set
Public Property IgnoreWhitespace As Boolean

プロパティ値

true 空白を無視する場合。それ以外の場合は false。 既定値は false です。

次の例では、処理命令、コメント、および重要でない空白を削除するリーダーを作成するために使用できる設定オブジェクトを作成します。

// 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

注釈

重要と見なされない空白には、マークアップを区別して読みやすくするために使用されるスペース、タブ、空白行が含まれます。 その例として、要素コンテンツの空白があります。

このプロパティ設定は、混合コンテンツ モードのマークアップ間の空白、または xml:space='preserve' 属性のスコープ内で発生する空白には影響しません。

適用対象

こちらもご覧ください