iTP Active Transaction Pages (iTP ATP) Programmer's Guide

XML for ATP Add-On Module
iTP Active Transaction Pages (iTP ATP) Programmer’s Guide522292-002
5-27
Methods
Although this method creates the new object in the context of this document, it does
not automatically add the new object to the document tree.
Syntax
objInstruction = doc.createProcessingInstruction(target, data);
Parameters
targetThe target part of the processing instruction.
data – The data for the node.
Return Value
objInstructionXMLDOMProcessingInstruction Object
.
ATPException
The following list shows the possible error-detail codes for the ATPException,
where error code is equal to ATP_ERR_DOM_EXCEPTION.
INVALID_CHARACTER_ ERR(5): Raised if the specified qualified name
contains an invalid character.
Example
The following example generates the processing instruction
<?XML version="1.0"?>, in which the target string is XML and the data string
is version="1.0":
var doc = new XML.DOMDocument;
doc.load("sample.xml");
var instruction = doc.createProcessingInstruction("xml",
"version=\"1.0\"");
println(instruction.xml);
Output
<?xml version="1.0"?>
createTextNode
Creates a XMLDOMText Object node that contains the supplied data. Creating a
text node with this method is the same as using createNode where the type
parameter value is NODE_TEXT and no namespace is specified. Although this
method creates the new object in the context of this document, it does not
automatically add the new object to the document tree.
Syntax
objText = doc.createTextNode(data);
Parameters
data – String specifying the value to be supplied to the new XMLDOMText
object’s nodeValue property.