1. For each variablesThis will be the new variable ( be it forVar ) that will be used to hold xml parsed value for each iteration.
2. xpathThis is the existing xpath location(under $request) where the iteration is to be performed.
3. In VariableThis is the variable ( request) which holds the request payload.
4.Index VariableThe variable (currIndex) will hold the current iteration count of For loop( Used in dynamic assignment of payload depending upon the index value)
5. Count VariableThis is the existing variable (Count) to be pre assigned which hold the count of payload elements under variable request.
How do I do this ? any examples ?Let assume the payload received in vairable ( request ) is as below and you want to iterate over company elements
how to I pass 4.Index Variable value to the caller ?You must use [xs:int($currIndex)] as xquery predicates expression while passing value to caller.
You can use an assign action to count the company nodes in company collectionI have use asigne on this
fn:count($request/company) and assign it to user context variable Count
you can explicitly define that above expression inside for each action for total count of fn:count($request/company)
how to I pass 4.Index Variable value to the caller ?but [xs:int($currIndex)] I have never found out how to use
You must use [xs:int($currIndex)] as xquery predicates expression while passing value to caller.