WebSphere Message Brokers
File: as07740_
Writer: Lorraine Waitt

Reference topic

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

cniSearchElement group

Searches previous siblings of the specified element for an element matching specified criteria. The search is performed starting at the syntax element specified in the targetElement parameter, and each of the four functions provides a search in a different tree direction:
  1. cniSearchFirstChild searches the immediate child elements of the starting element from the first child, until either a match is found, or the end of the child element chain is reached.
  2. cniSearchLastChild searches the immediate child elements of the starting element from the last child, until either a match is found, or the end of the child element chain is reached.
  3. cniSearchNextSibling searches from the starting element to the next siblings, until either a match is found, or the end of the sibling chain is reached.
  4. cniSearchPreviousSibling searches from the starting element to the previous siblings, until either a match is found, or the start of the sibling chain is reached.

If you use this command to search for an element within a message that belongs to a namespace-aware domain, the search is only performed on those elements whose namespace is an empty string. If you want to perform a search for elements in any namespace, use one of the cniSearchElementNamespace commands.

Syntax

CciElement* cniSearchFirstChild(
  int*            returnCode,
  CciElement*     targetElement,
  CciCompareMode* mode,
  CciElementType  type,
  CciChar         name);
CciElement* cniSearchLastChild(
  int*            returnCode,
  CciElement*     targetElement,
  CciCompareMode* mode,
  CciElementType  type,
  CciChar         name);
CciElement* cniSearchNextSibling(
  int*            returnCode,
  CciElement*     targetElement,
  CciCompareMode* mode,
  CciElementType  type,
  CciChar         name);
CciElement* cniSearchPreviousSibling(
  int*            returnCode,
  CciElement*     targetElement,
  CciCompareMode* mode,
  CciElementType  type,
  CciChar         name);

Parameters

returnCode
The return code from the function (output).
Possible return codes are:
  • CCI_SUCCESS
  • CCI_EXCEPTION
  • CCI_INV_ELEMENT_OBJECT
targetElement
The address of the syntax element object from which the search starts (input).
mode
The search mode to use (input). This indicates what combination of element type and element name is to be searched for. The possible values are:
  • CCI_COMPARE_MODE_FULL
  • CCI_COMPARE_MODE_FULL_TYPE
  • CCI_COMPARE_MODE_GENERIC_TYPE
  • CCI_COMPARE_MODE_SPECIFIC_TYPE
  • CCI_COMPARE_MODE_NAME
  • CCI_COMPARE_MODE_NAME_SPECIFIC_TYPE
  • CCI_COMPARE_MODE_NAME_GENERIC_TYPE
  • CCI_COMPARE_MODE_NAME_FULL_TYPE
  • CCI_COMPARE_MODE_NULL
type
The element type to search for (input). This is used only if the search mode involves a match on the type.
name
The element name to search for (input). This is used only if the search mode involves a match on the name.

Example

  int rc;
  CciElement* firstChild = cniSearchFirstChild(
                                              &rc, 
                                               inRootElement, 
                                               CCI_COMPARE_MODE_NAME, 
                                               elementName, 
                                               0);

Return values

  • If successful, the address of the requested syntax element object is returned.
  • If there is no matching element, zero is returned.
  • If an error occurs, zero (CCI_NULL_ADDR) is returned, and the returnCode parameter indicates the reason for the error.
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:27

as07740_ This topic's URL is: