XmlReaderSettings.IgnoreComments Proprietà

Definizione

Ottiene o imposta un valore che indica se ignorare i commenti.

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

Valore della proprietà

true per ignorare i commenti; 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

L'impostazione di questa proprietà su true può comportare la restituzione di più nodi di testo contigui dal lettore. Ciò non influisce sulla convalida.

Si applica a

Vedi anche