XmlReaderSettings.IgnoreComments XmlReaderSettings.IgnoreComments XmlReaderSettings.IgnoreComments XmlReaderSettings.IgnoreComments Property


コメントを無視するかどうかを示す値を取得または設定します。Gets or sets a value indicating whether to ignore comments.

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


コメントを無視する場合は true。それ以外の場合は falsetrue to ignore comments; otherwise false. 既定値は、false です。The default is false.

次の例では、処理命令、コメント、および意味のない空白を除去するリーダーを構築するために使用できる設定オブジェクトを作成します。The following creates a settings object that can be used to construct a reader that strips processing instructions, comments, and insignificant white space.

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


このプロパティをにtrue設定すると、リーダーから複数の連続するテキストノードが返される可能性があります。Setting this property to true can result in multiple contiguous text nodes being returned from the reader. これは検証には影響しません。This does not affect validation.