XmlReaderSettings.IgnoreComments Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET