WebSphere Message Broker, Version 8.0.0.7
Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS
See information about the latest product version
See information about the latest product version
cpiSetElementNamespace
Use this function to set the namespace attribute for the specified syntax element.
Defined In | Type | Member |
---|---|---|
CPI_VFT | Optional | iFpSetElementValue |
Syntax
void cpiSetElementNamespace( int* returnCode, CciElement* targetElement, const CciChar* nameSpace);
Parameters
- returnCode
- A NULL pointer input value indicates that the user-defined node
does not want to deal with errors. All exceptions thrown during the
execution of this call are rethrown to the next upstream node in the
flow. If the input value is not NULL, output signifies the success
status of the call. If an exception occurs during execution, *returnCode
is set to CCI_EXCEPTION on output. Call CciGetLastExceptionData to
obtain details of the exception. (input). Possible return codes are:
- CCI_SUCCESS
- CCI_EXCEPTION
- CCI_INV_ELEMENT_OBJECT
- CCI_INV_DATA_POINTER
- currentElement
- The address of the current syntax element (input).
- targetElement
- Specifies the address of the target syntax element object.
- value
- Specifies the address of a null terminated string of CciChars that represents the namespace value. An empty string is a valid value for namespace; elements are created in the empty string namespace by default, therefore if you specify an empty string as the namespace by using this call, the call is effective only if the element was previously in another namespace, and the required effect is to change the namespace value to empty string.
Return values
None.
Sample
/* Convert the attribute value into broker 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);
cpiSetElementNamespace(&rc, newElement, data);
if (pc->trace) {
const char * mbData = mbString(data, pc->iCcsid);
fprintf(pc->tracefile, "PLUGIN: Created new NAMESPACEVALUE element;
object=0x%x type=0x%x name=",
newElement, CCI_ELEMENT_TYPE_NAME_VALUE);
fprintf(pc->tracefile, "%s\n", mbData);
fflush(pc->tracefile);
free((void *)mbData);
}
/* Free the memory created in CciNString() */
free((void *)data);
/* Add the element */
cpiAddAsLastChild(&rc, element, newElement);