Condividi tramite


XML Processing Instruction Literal (Visual Basic)

A literal representing an XProcessingInstruction object.

<?piName [ = piData ] ?>

Parts

  • <?
    Required. Denotes the start of the XML processing instruction literal.

  • piName
    Required. Name indicating which application the processing instruction targets. Cannot begin with "xml" or "XML".

  • piData
    Optional. String indicating how the application targeted by piName should process the XML document.

  • ?>
    Required. Denotes the end of the processing instruction.

Return Value

An XProcessingInstruction object.

Remarks

XML processing instruction literals indicate how applications should process an XML document. When an application loads an XML document, the application can check the XML processing instructions to determine how to process the document. The application interprets the meaning of piName and piData.

The XML document literal uses syntax that is similar to that of the XML processing instruction. For more information, see XML Document Literal (Visual Basic).

Note

The piName element cannot begin with the strings "xml" or "XML", because the XML 1.0 specification reserves those identifiers.

You can assign an XML processing instruction literal to a variable or include it in an XML document literal.

Note

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

The Visual Basic compiler converts the XML processing instruction literal to a call to the XProcessingInstruction constructor.

Example

The following example creates a processing instruction identifying a style-sheet for an XML document.

Dim pi As XProcessingInstruction = 
  <?xml-stylesheet type="text/xsl" href="show_book.xsl"?>

See Also

Reference

XML Document Literal (Visual Basic)

XProcessingInstruction

Other Resources

XML Literals (Visual Basic)

Creating XML in Visual Basic