Microsoft XML SDK 2.6 - XML Reference

IXMLDOMProcessingInstruction::target Method

Specifies the target—the application to which this processing instruction is directed.

strValue = oXMLDOMProcessingInstruction.target

Remarks

String. The property is read-only. XML defines the target as the first token following the markup that begins the processing instruction. For example, the target has the value "xml" in the processing instruction <?xml version="1.0">.

The target method has the same value as the nodeName method.

Example

The following VBScript example iterates through the document's child nodes. If it finds a node of type NODE_PROCESSING_INSTRUCTION (7), it displays the node's target:

Dim xmlDoc
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.load("c:\books.xml")
For i = 0 TO (xmlDoc.childNodes.length -1)
  If xmlDoc.childNodes.item(i).nodeType = 7 Then
    msgBox xmlDoc.childNodes.item(i).target
  End If
Next

See Also

IXMLDOMProcessingInstruction Interface

IXMLDOMProcessingInstruction::get_target Method

Specifies the target—the application to which this processing instruction is directed.

Visual Basic Syntax

strValue = oXMLDOMProcessingInstruction.target

C/C++ Syntax

HRESULT get_target(
    BSTR *name);

Parameters

name [out]
Application to which this processing instruction is directed (the target).

C/C++ Return Values

Returns S_OK if successful, or an error code otherwise.

Remarks

XML defines the target as the first token following the markup that begins the processing instruction. For example, the target has the value "xml" in the processing instruction <?xml version="1.0">.

The target method has the same value as the nodeName method.

See Also

IXMLDOMProcessingInstruction Interface