Search Predicates

An XPath expression can have a search predicate. The search predicate is used to locate a specific element of a repeating schema item. For example, the $GetOrderInformation/OrderDetails/OrderItem item is a repeating element. If you wish to select only the first item in the repeating element, you would specify the following:

$GetOrderInformation/OrderDetails/OrderItem[1]

The [1] specifies the first element of a repeating item.

Sub-items can also be examined and used in a search predicate. For example, to select the element whose ProductId is equal to "3A54", you would specify the following:

$GetOrderInformation/OrderDetails/OrderItem[ProductId="3A54"]

You can also use functions and expressions in the search predicate. For example, if you wish to find all elements after the first, you would specify the following:

$GetOrderInformation/OrderDetails/OrderItem[position()>1]

See the online documentation available in the XPath formula builder for a list of the available operators and functions in XPath.

You can also build custom Java functions and make them available in XPath by using the Java Custom Function shared resource. For more information about creating custom functions and making them available in XPath, see the description of the Java Custom Function shared configuration resource in TIBCO ActiveMatrix BusinessWorks Palette Reference.