AddProcessInstruction method: Incoming Business Interlink class
Syntax
AddProcessInstruction(instruction)
Description
The AddProcessInstruction method adds an XML processing instruction to a BiDocs object. Use this method at the root level of the BiDocs object for Incoming Business Interlinks before you add anything else to the BiDocs object.
Parameters
| Parameter | Description |
|---|---|
|
instruction |
String. The processing instruction. |
Returns
Number. The return status. NoError, or 0, means the method succeeded.
Example
Here is a set of XML response code.
<?xml version="1.0"?>
<postreqresponse>
<error>
<!--this is a comment line-->
<errorcode>1</errorcode>
<errortext></errortext>
</error>
</postreqresponse>
Here is the PeopleCode that builds it.
Local BIDocs &rootDoc, &postreqresponse;
Local BIDocs &error, &errorcode, &errortext;
Local number &ret;
&rootDoc = GetBiDoc("");
/* add a processing instruction*/
&ret = &rootDoc.AddProcessInstruction("<?xml version=""1.0""?>");
/* create an element and add text*/
&postreqresponse = &rootDoc.CreateElement("postreqresponse");
&error = &postreqresponse.CreateElement("error");
&ret = &error.AddComment("this is a comment line");
&errorcode = &error.CreateElement("errorcode");
&ret = &errorcode.AddText("1");
&errortext = &error.CreateElement("errortext");
Related Topics