data Property (IXMLDOMProcessingInstruction)

 

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

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);  
      }  
   }  
}  

strValue = oXMLDOMProcessingInstruction.data  
objXMLDOMProcessingInstruction.data = strValue  

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.

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

Implemented in:

MSXML 3..0, MSXML 6.0

IXMLDOMProcessingInstruction

nodeValue Property

Show: