Export (0) Print
Expand All
go
Expand Minimize

createProcessingInstruction method

Creates a processing instruction for an XML parser.

Document Object Model (DOM) Level 3 Core Specification, Section 1.4Internet Explorer 9

 

Syntax

var newProcessingInstruction = document.createProcessingInstruction(bstrTarget, bstrData);

Parameters

bstrTarget [in]

Type: BSTR

A String value that contains the name of the processing instruction.

bstrData [in]

Type: BSTR

A String value that contains the data for the processing instruction.

newProcessingInstruction [out, retval]

Type: IDOMProcessingInstruction

Returns a reference to the processing instruction.

Return value

Type: IDOMProcessingInstruction

Returns a reference to the processing instruction.

Standards information

Remarks

The createProcessingInstruction method is supported only for XML documents.

Examples

The following code example demonstrates how to create an XML processing instruction.


// This example creates the following processing instruction:
//   <?xml-stylesheet type="text/css" href="style.css">
var sTarget = 'xml-stylesheet';
var sData = 'type="text/css" href="style.css"';'
var obj = document.createProcessingInstruction( sTarget, sData );


See also

document

 

 

Show:
© 2014 Microsoft