Creates a new syntax element tree as the last child of the specified syntax element, and associates it with the specified parser. The new syntax element tree is populated by parsing the specified bit stream. During the execution of this function, the bit stream is copied, so the caller can free or reuse the memory allocated to hold the original bit stream. You can use this function only to create a message body, that is, the last child of the message root. An output message should already exist. The root element of this output message should be passed in as the target element parameter. Because this call is only designed to be used to create a message body, you cannot use it to build successive elements. For example, it should not be used to create an RFH2 as the last child of root and then an XML message as the last child of root, after the RFH2.
CciElement* cniCreateElementAsLastChildFromBitstream ( int* returnCode, CciElement* targetElement, const struct CciByteArray* value, const CciChar* parserClassName, CciChar* messageType, CciChar* messageSet, CciChar* messageFormat, int encoding, int ccsid, int options);
If successful, the address of the new element object is returned. Otherwise, a value zero (CCI_NULL_ADDR) is returned and the return code parameter indicates the reason for the error. If an exception occurs during execution, returnCode is set to CCI_EXCEPTION
outMQMD = cniCreateElementAsFirstChildUsingParser(&rc, outRootElement, CciString("MQHMD",BIP_DEF_COMP_CCSID)); checkRC(rc); cniCopyElementTree(&rc, inMQMD, outMQMD); checkRC(rc); outBlobRoot = cniCreateElementAsLastChildFromBitstream( &rc, outRootElement, &bitstream, inParserClassName, messageType, messageSet, messageFormat, encoding, ccsid, 0); checkRC(rc); ... return; }