XmlReaderSettings.IgnoreWhitespace Proprietà

Definizione

Ottiene o imposta un valore che indica se ignorare gli spazi vuoti non significativi.

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

Valore della proprietà

Boolean

true per ignorare gli spazi vuoti; in caso contrario, false. Il valore predefinito è false.

Esempio

Di seguito viene creato un oggetto impostazioni che può essere usato per costruire un lettore che striscia le istruzioni di elaborazione, i commenti e lo spazio vuoto insignificante.

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

Commenti

Lo spazio vuoto non considerato significativo include spazi, schede e righe vuote usate per impostare il markup per una maggiore leggibilità. Un esempio di questo è spazio vuoto nel contenuto dell'elemento.

Questa impostazione della proprietà non influisce sullo spazio vuoto tra il markup in modalità contenuto misto o lo spazio vuoto che si verifica nell'ambito di un xml:space='preserve' attributo.

Si applica a

Vedi anche