XmlReaderSettings.IgnoreComments Propriedade

Definição

Obtém ou define um valor que indica se os comentários devem ser ignorados.Gets or sets a value indicating whether to ignore comments.

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

Valor da propriedade

Boolean

true para ignorar comentários, caso contrário, false.true to ignore comments; otherwise false. O padrão é false.The default is false.

Exemplos

O seguinte cria um objeto de configurações que pode ser usado para construir um leitor que retira as instruções de processamento, os comentários e o espaço em branco insignificante.The following creates a settings object that can be used to construct a reader that strips processing instructions, comments, and insignificant white space.

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

Comentários

Definir essa propriedade como true pode resultar na retorno de vários nós de texto contíguos do leitor.Setting this property to true can result in multiple contiguous text nodes being returned from the reader. Isso não afeta a validação.This does not affect validation.

Aplica-se a

Confira também