WebSphere Message Brokers
File: as08105_
Writer: Lorraine Waitt

Reference topic

This build: July 31, 2007 21:37:53

cpiElementNameSpace

Purpose

Gets the value of the "namespace" attribute for the specified syntax element

Defined In Type Member
CPI_VFT Optional iFpElementValue

Syntax

CciSize cpiElementNamespace(
   int*           returnCode,
   CciElement*    targetElement,
   const CciChar* value,
   CciSize        length);

Parameters

returnCode
A NULL pointer input signifies that the user-defined node does not want to deal with errors. Any exceptions thrown during the execution of this call will be re-thrown to the next upstream node in the flow. If input is not NULL, output will signify the success status of the call. If an exception occurs during execution, *returnCode will be set to CCI_EXCEPTION on output. A call to CciGetLastExceptionData will provide details of the exception. If the caller did not allocate enough memory to hold the namespace value, *returncode is set to CCI_BUFFER_TOO_SMALL.
Possible return codes are:
  • CCI_SUCCESS
  • CCI_EXCEPTION
  • CCI_INV_ELEMENT_OBJECT
  • CCI_INV_DATA_POINTER
  • CCI_INV_DATA_BUFLEN
  • CCI_INV_BUFFER_TOO_SMALL
targetElement
Specifies the address of the target syntax element object.
value
Specifies the address of a buffer into which the element namespace value will be copied. A string of characters (including a NULL terminator) representing the namespace value is copied into this buffer. The buffer should be a portion of memory previously allocated by the caller
length
The length in CciChars of the buffer specified by the value parameter.

Return values

If successful, the number of CciChars copied into the buffer is returned.

If the buffer is not large enough to contain the attribute value, returnCode is set to CCI_BUFFER_TOO_SMALL, and the number of bytes CciChars required is returned.

Sample

elementNamespace=(CciChar*)malloc(sizeof(CciChar) * elementNamespaceLength);
    elementNamespaceLength = cpiElementNamespace(&rc;,
                        element,
                        elementNamespace,
                        elementNamespaceLength);
    
    if (rc==CCI_BUFFER_TOO_SMALL){
      free(elementNamespace);
      elementNamespace=(CciChar*)malloc(sizeof(CciChar) * elementNamespaceLength);
      elementNamespaceLength = cpiElementNamespace(&rc;,
                        element,
                        elementNamespace,
                        elementNamespaceLength);
    }
    checkRC(rc);
Related concepts
User-defined parsers
User-defined extensions overview
Related tasks
Creating a parser in C
Related reference
cpiSetElementNamespace
C parser implementation functions
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:37:53

as08105_ This topic's URL is: