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
cniSearchElementInNamespace group
Use this element to search for an element that matches the specified criteria.
The search starts at the syntax element specified in the
element argument, and each of the four functions provides a search
in a different tree direction:
- cniSearchFirstChildInNamespace 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.
- cniSearchLastChildInNamespace 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.
- cniSearchNextSiblingInNamespace searches from the starting element to the next siblings, until either a match is found, or the end of the sibling chain is reached.
- cniSearchPreviousSiblingInNamespace searches from the starting element to the previous siblings, until either a match is found, or the start of the sibling chain is reached.
Use this function when you search a message that belongs to a namespace-aware domain.
Syntax
void cniSearchFirstChildInNamespace(
int* returnCode,
CciElement* targetElement,
CciCompareMode mode,
const CciChar* nameSpace,
const CciChar* name,
CciElementType type)
void cniSearchLastChildInNamespace(
int* returnCode,
CciElement* targetElement,
CciCompareMode mode,
const CciChar* nameSpace,
const CciChar* name,
CciElementType type)
void cniSearchNextSiblingInNamespace(
int* returnCode,
CciElement* targetElement,
CciCompareMode mode,
const CciChar* nameSpace,
const CciChar* name,
CciElementType type)
void cniSearchPreviousSiblingInNamespace(
int* returnCode,
CciElement* targetElement,
CciCompareMode mode,
CciElementType type,
const CciChar* nameSpace,
const CciChar* name)
Parameters
- returnCode
- The return code from the function (output). Specifying a NULL
pointer signifies that the node does not want to deal with errors.
If input is not NULL, the output signifies the success status of the
call. All exceptions thrown during the execution of this call are
re-thrown to the next upstream node in the flow. Call cciGetLastExceptionData for
details of the exception. 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 namespace, element name, and element type is
to be searched for. The possible values are:
- CCI_COMPARE_MODE_SPACE
- CCI_COMPARE_MODE_SPACE_FULL_TYPE
- CCI_COMPARE_MODE_SPACE_GENERIC_TYPE
- CCI_COMPARE_MODE_SPACE_SPECIFIC_TYPE
- CCI_COMPARE_MODE_SPACE_NAME
- CCI_COMPARE_MODE_SPACE_NAME_FULL_TYPE
- CCI_COMPARE_MODE_SPACE_NAME_GENERIC_TYPE
- CCI_COMPARE_MODE_SPACE_NAME_SPECIFIC_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.
- nameSpace
- The namespace to search (input). Use this parameter only if the search mode involves a match on the namespace.
- name
- The name to search for (input). Use this parameter only if the search mode involves a match on the name.
Return values
None. If an error occurs, the returnCode parameter indicates the reason for the error.
Example
mode=CCI_COMPARE_MODE_SPACE ;
...
if (forward) {
firstChild = cniSearchFirstChildInNamespace(&rc, element, mode, space, 0,0);
}else{
firstChild = cniSearchLastChildInNamespace(&rc, element, mode, space, 0,0);
}
if (firstChild) {
depth++;
traceElement(firstChild,forward,space);
depth--;
}
currentElement = firstChild;
do{
if (forward) {
nextSibling = cniSearchNextSiblingInNamespace(&rc, currentElement,mode,space,0,0);
}else{
nextSibling = cniSearchPreviousSiblingInNamespace(&rc, currentElement,mode,space,0,0);
}
if (nextSibling) {
traceElement(nextSibling,forward,space);
currentElement=nextSibling;
}
}while (nextSibling) ;
}