Literal de comentário XML (Visual Basic)

A literal representing an XComment object.

<!-- content -->

Parts

Term

Definition

<!--

Required. Denotes the start of the XML comment.

content

Required. Text to appear in the XML comment. Cannot contain a series of two hyphens (--) or end with a hyphen adjacent to the closing tag.

-->

Required. Denotes the end of the XML comment.

Valor de retorno

An XComment object.

Comentários

XML comment literals do not contain document content; they contain information about the document. The XML comment section ends with the sequence "-->". This implies the following points:

  • You cannot use an embedded expression in an XML comment literal because the embedded expression delimiters are valid XML comment content.

  • XML comment sections cannot be nested, because content cannot contain the value "-->".

You can assign an XML comment literal to a variable, or you can include it in an XML element literal.

ObservaçãoObservação

An XML literal can span multiple lines without using line continuation characters. This feature enables you to copy content from an XML document and paste it directly into a Visual Basic program.

O Visual Basic compilador converte o comentário XML literal em uma chamada para o XComment construtor.

Exemplo

The following example creates an XML comment that contains the text "This is a comment".

Dim com As XComment = <!-- This is a comment -->

Consulte também

Referência

Literal de elemento XML (Visual Basic)

XComment

Outros recursos

Literais XML (Visual Basic)

Criando XML em Visual Basic