다음을 통해 공유


data Property (IXMLDOMProcessingInstruction)

 

Retrieves and sets the content of the processing instruction, excluding the target.

Script Syntax

strValue = oXMLDOMProcessingInstruction.data;  
objXMLDOMProcessingInstruction.data = strValue;  

Example

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

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");  
var pi;  
xmlDoc.load("books.xml");  
if (xmlDoc.parseError.errorCode != 0) {  
   var myErr = xmlDoc.parseError;  
   WScript.Echo("You have error " + myErr.reason);  
} else {  
   for (var i=0; i<xmlDoc.childNodes.length; i++) {  
      if (xmlDoc.childNodes.item(i).nodeType == 7) {  
         pi = xmlDoc.childNodes.item(i);  
         WScript.Echo(pi.data);  
      }  
   }  
}  

Visual Basic Syntax

strValue = oXMLDOMProcessingInstruction.data  
objXMLDOMProcessingInstruction.data = strValue  

C/C++ Syntax

HRESULT get_data(  
    BSTR *value);  
HRESULT put_data(  
    BSTR value);  

Parameters

value [out, retval][in]
The content of the processing instruction for this target. The data has the same value as the nodeValue property.

C/C++ Return Values

S_OK
The value returned if successful.

Remarks

String. This property is read/write. The data has the same value as the nodeValue property.

Versioning

Implemented in:

MSXML 3..0, MSXML 6.0

Applies to

IXMLDOMProcessingInstruction

See Also

nodeValue Property