literal CDATA XML (Visual Basic)

A literal representing an XCData object.

<![CDATA[content]]>

Parts

  • <![CDATA[
    Required. Denotes the start of the XML CDATA section.

  • content
    Required. Text content to appear in the XML CDATA section.

  • ]]>
    Required. Denotes the end of the section.

Valor de retorno

An XCData object.

Comentários

XML CDATA sections contain raw text that should be included, but not parsed, with the XML that contains it. A XML CDATA section can contain any text. This includes reserved XML characters. The XML CDATA section ends with the sequence "]]>". This implies the following points:

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

  • XML CDATA sections cannot be nested, because content cannot contain the value "]]>".

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

ObservaçãoObservação

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

O Visual Basic compilador converte o CDATA de XML literal para uma chamada para o XCData construtor.

Exemplo

The following example creates a CDATA section that contains the text "Can contain literal <XML> tags".

Dim cdata As XCData = <![CDATA[Can contain literal <XML> tags]]>

Consulte também

Referência

Literal de elemento XML (Visual Basic)

XCData

Outros recursos

Literais XML (Visual Basic)

Criando XML em Visual Basic