<loop item="item_var_name" index="index_var_name" maxloops="max_loops" filter="list_filter" empty="empty"> <list> body as list value </list> <body> body for each list item </body> </loop>
Name | Required | Default | Description |
---|---|---|---|
item | no | Name of the variable that takes the value of current list item. | |
index | no | Name of the index variable, initial value for the first loop is 1. | |
maxloops | no | Limits number of iterations. There is no limit if it is not specified. | |
filter | no |
Expression for filtering iteration list. It consists of arbitrary number of
restrictions separated by comma. There are the following types of restrictions:
1-20,1:2,unique .
|
|
empty | no | no |
Equal to surrounding body by empty element, producing empty result
of iteration.
|
<loop item="link" index="i" filter="unique"> <list> <xpath expression="//img/@src"> <html-to-xml> <http url="http://www.yahoo.com"/> </html-to-xml> </xpath> </list> <body> <file action="write" type="binary" path="images/${i}.gif"> <http url="${sys.fullUrl('http://www.yahoo.com', link)}"/> </file> </body> </loop>
Loop iterates over the all unique image URLs from www.yahoo.com and for each URL downloads the image and stores it to the file system.