XmlReaderSettings.IgnoreComments Właściwość

Definicja

Pobiera lub ustawia wartość wskazującą, czy ignorować komentarze.

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

Wartość właściwości

true ignorować komentarze; w przeciwnym razie false. Wartość domyślna to false.

Przykłady

Poniżej przedstawiono sposób tworzenia obiektu ustawień, który może służyć do konstruowania czytnika, który usuwa instrukcje przetwarzania, komentarze i nieistotne odstępy.

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

Uwagi

Ustawienie tej właściwości może spowodować true zwrócenie przez czytnik wielu ciągłych węzłów tekstowych. Nie ma to wpływu na walidację.

Dotyczy

Zobacz też