AddComment method: Incoming Business Interlink class
Syntax
AddComment(comment)
Description
The AddComment method adds an XML comment after the beginning tag of an XML element referenced by a BiDoc object.
Parameters
| Parameter | Description |
|---|---|
|
comment |
String. The comment. |
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, &error, &errorcode, &errortext;
Local string &blob;
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