XmlReaderSettings.IgnoreWhitespace Właściwość

Definicja

Pobiera lub ustawia wartość wskazującą, czy ignorować nieistotne białe znaki.

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

Wartość właściwości

Boolean

true ignorowanie białych znaków; w przeciwnym razie false. Wartość domyślna to false.

Przykłady

Poniżej przedstawiono tworzenie 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

Białe znaki, które nie są uważane za istotne, obejmują spacje, karty i puste wiersze używane do ustawiania znaczników w celu zwiększenia czytelności. Przykładem jest biały odstęp w zawartości elementu.

To ustawienie właściwości nie ma wpływu na odstęp między znacznikami w trybie mieszanej zawartości ani odstępem, który występuje w zakresie atrybutu xml:space='preserve' .

Dotyczy

Zobacz też