For Each Statements

For Each statements enable you to execute one or more statements once for each data element in a list.

When you choose this option, a For Each statement appears before the selected data component, and you must place an XPath expression in the For Each statement that evaluates to a list of zero or more items. This is useful when you want to manipulate sequences or repeating elements.

Example of For Each statement


In this example, the requestor sends a list of ticker symbols and the stock exchanges on which they are traded. The mediation flow routes the request to different services for each stock exchange. The For Each statement takes the list of ticker symbols and executes the remaining statements once for each symbol in the list. The If statement examines the exchange element and outputs only the ticker symbols for the "NYSE" stock exchange.