createProcessingInstruction method
Creates a processing instruction for an XML parser.
![]() ![]() |
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]
- 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
Show:

