WebSphere Message Brokers
File: as08530_
Writer: Lorraine Waitt

Reference topic

This build: July 31, 2007 21:38:16

cpiSetElementValueValue

Purpose

Sets the value of the specified syntax element.

Syntax

void cpiSetElementValueValue(
  int*              returnCode,
  CciElement*       targetElement,
  CciElementValue*  value);

Parameters

returnCode
Receives the return code from the function (output).
Possible return codes are:
  • CCI_SUCCESS
  • CCI_EXCEPTION
  • CCI_INV_ELEMENT_OBJECT
  • CCI_INV_DATA_POINTER
targetElement
Specifies the address of the target syntax element object (input).
value
Specifies the address of the CciElementValue object that contains the value to be stored in the specified target element (input).

Return values

None. If an error occurs, returnCode indicates the reason for the error.

Sample

This example is taken from the sample parser file BipSampPluginParser.c (lines 675 to 698):

void cpiSetElementValue(
  CciParser*       parser,
  CciElement*      element,
  CciElementValue* value
){
  CciElement* newElement;
  int         rc;

  if ((cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_VALUE) ||
      (cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_NAME_VALUE))  {
    cpiSetElementValueValue(&rc, element, value);
  }
  else if (cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_NAME) {
    /* Create a new value element, add as a first child, and set the value */
    newElement = cpiCreateElement(&rc, parser);
    cpiSetElementType(&rc, newElement, CCI_ELEMENT_TYPE_VALUE);
    cpiSetElementValueValue(&rc, newElement, value);
    cpiAddAsFirstChild(&rc, element, newElement);
  }
  else {
  }

  return;
}
Related concepts
User-defined parsers
User-defined extensions overview
Related tasks
Creating a parser in C
Related reference
cpiSetElementName
cpiSetElementType
cpiSetElementValue group
C parser utility 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:38:16

as08530_ This topic's URL is: