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
cniSearchElement group
Use one or more of the functions in this group to search previous siblings of the specified element for an element that matches the 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:
- 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.
- 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.
- 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.
- 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 performed only on those elements whose namespace is an empty string. If you want to perform a search for elements in all namespaces, use one of the cniSearchElementNamespace functions.
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 parameter 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). Use this parameter only if the search mode involves a match on the type.
- name
- The element name to search for (input). Use this parameter 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.