processingInstruction Method

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - SAX2 Reference

processingInstruction Method

Receives notification of a processing instruction. The reader invokes the processingInstruction method once for each processing instruction found. Processing instructions can occur before or after the main document element.

[Visual Basic]

Implementation Syntax

Sub processingInstruction(strTarget As String, strData As String)

Parameters

strTarget
The target for the processing instruction. The target is the first piece of the processing instruction. For example, xml-stylesheet is the target for the following processing instruction: <?xml–stylesheet type="text/css" href="sample.css"?>.
strData
The processing instruction data, or Null (if none is supplied). For example, type="text/css" href="sample.css" is the data for the following processing instruction: <?xml–stylesheet type="text/css" href="sample.css"?>

Return Values

If failed, the ContentHandler raises a trappable error.

Example

The following example shows how to use the processingInstruction method to pass a processing instruction, unchanged, into a text box (Text1) on the application form (Form1) that is used to display the output of the reader.

Private Sub IVBSAXContentHandler_processingInstruction(strTarget As String, strData As String)
    Form1.Text1.Text = Form1.Text1.Text & _
        "<?" & strTarget & " " & strData & "?>" & vbCrLf
End Sub
[C/C++]

Syntax

HRESULT processingInstruction(
   [in] const wchar_t * pwchTarget,
   [in] int cchTarget,
   [in] const wchar_t * pwchData,
   [in] int cchData);

Parameters

pwchTarget [in]
The target for the processing instruction. The target is the first piece of the processing instruction. For example, xml-stylesheet is the target for the following processing instruction: <?xml–stylesheet href="sample.css" type="text/css" title="Sample" ?>.
cchTarget [in]
The length of the target string.
pwchData [in]
The processing instruction data, or Null (if none is supplied).
cchData [in]
The length of the processing instruction string.

Return Values

S_OK
The value returned if no errors occur.
E_FAIL
The value returned if the parse operation should be aborted.

To view reference information for Visual Basic or C/C++ only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

Applies to: ISAXContentHandler/IVBSAXContentHandler Interface