This function adds a new (and currently unattached) syntax element to the syntax element tree as the last child of the specified target element.
void cpiAddAsLastChild(
int* returnCode,
CciElement* targetElement,
CciElement* newElement);
None. If an error occurs, returnCode indicates the reason for the error.
This example is taken from the sample parser file BipSampPluginParser.c:
/* Convert the attribute value into integration node form */
data = CciNString((char *)startMarker, markedSize, pc->iCcsid);
/* Create a new name-value element for the attribute */
newElement = cpiCreateElement(&rc, parser);
cpiSetElementType(&rc, newElement, CCI_ELEMENT_TYPE_NAME_VALUE);
cpiSetElementName(&rc, newElement, data);
/* Free the memory created in CciNString() */
free((void *)data);
/* Add the element */
cpiAddAsLastChild(&rc, element, newElement);