Use this function to create a new syntax element and insert it before the specified syntax element. The new element becomes the previous sibling of the specified element, and shares the same parent element.
DO not use cniCreateElementBefore when creating a message body folder (such as XML, XMLNS, MRM, BLOB), because it does not associate an owning parser with the folder. To create a message body folder, you can use one of the following functions:
When the message body folder has been created, cniCreateElementBefore can be used to create elements under the folder. cniCreateElementBefore can be used because the parser, which is associated with the message body folder, is inherited.
CciElement* cniCreateElementBefore(
int* returnCode,
CciElement* targetElement);
If successful, the address of the new element object is returned. Otherwise, a value of zero (CCI_NULL_ADDR) is returned, and the returnCode parameter indicates the reason for the error.