XmlReaderSettings.IgnoreWhitespace Proprietà

Definizione

Ottiene o imposta un valore che indica se ignorare 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à

true per ignorare lo spazio vuoto; in caso contrario false, . Il valore predefinito è false.

Esempio

Di seguito viene creato un oggetto impostazioni che può essere utilizzato per costruire un lettore che rimuove istruzioni di elaborazione, commenti e spazi vuoti non significativi.

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

Gli spazi vuoti non considerati significativi includono spazi, tabulazioni e righe vuote usate per separare il markup per una maggiore leggibilità. Un esempio è costituito da spazi vuoti nel contenuto dell'elemento.

Questa impostazione della proprietà non influisce sugli spazi vuoti tra markup in modalità contenuto misto o spazi vuoti che si verificano all'interno dell'ambito di un xml:space='preserve' attributo.

Si applica a

Vedi anche