Upraviť

Zdieľať cez


XmlReaderSettings.IgnoreComments Property

Definition

Gets or sets a value indicating whether to ignore comments.

public:
 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

Property Value

true to ignore comments; otherwise false. The default is false.

Examples

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

Remarks

Setting this property to true can result in multiple contiguous text nodes being returned from the reader. This does not affect validation.

Applies to

See also