WebSphere Message Brokers
File: as08090_
Writer: Lorraine Waitt

Reference topic

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

cpiParseLastChild

Purpose

Parses the last child of a specified syntax element. It is invoked by the broker when the last child element of the current syntax element is required.
Defined In Type Member
CPI_VFT Mandatory iFpParseLastChild

Syntax

void cpiParseLastChild(
  CciParser*   parser,
  CciContext*  context,
  CciElement*  currentElement);

Parameters

parser
The address of the parser object (input).
context
The address of the context owned by the parser object (input).
currentElement
The address of the current syntax element (input).

Return values

None.

Sample

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

void cpiParseLastChild(
  CciParser*  parser,
  CciContext* context,
  CciElement* element
){
  PARSER_CONTEXT_ST* pc = (PARSER_CONTEXT_ST *)context ;
  int                rc;

  if ((cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_NAME)) {

    while ((!cpiElementCompleteNext(&rc, element))     &&
           (pc->iCurrentElement))
    {
      pc->iCurrentElement = parseNextItem(parser, context, pc->iCurrentElement);
    }
  }

  if (pc->trace) {
    fprintf(pc->tracefile, "PLUGIN: <- cpiParseLastChild()\n");
    fflush(pc->tracefile);
  }

  return;
}

The purpose of this code is to parse children of an element until the last child is reached. You can use this kind of structure in a parser that does not already know the exact offset in the bit stream of the last child of an element.

Related concepts
User-defined parsers
User-defined extensions overview
Related tasks
Creating a parser in C
Related reference
cpiParseFirstChild
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:51

as08090_ This topic's URL is: