Mozilla Skin
Translate this page


Loop Node

From Moving Pictures

The loop node is what you would use to iterate through an array variable such as what is returned by the parse node. Please see the table below for additional information.

Attribute Description
name This defines the variable used internal to the loop node for the variable being looped. This is a required attribute.
on This defines the variable to be looped. This is also a required attribute.
limit This is an optional attribute to define the maximum amount of times this loop will run. By default it will run once for each index of the variable.


Variable Description
${count} This variable will contain the current loop number. Zero based.

Example

The following is an actual in script example that finishes up the building of an alternate titles list. The parse loop returns an array variable 'akaListFinal'. The loop node iterates through this variable where each value of the akaListFinal[X] = titleAka.

<parse name="akaListFinal" input="${akaList[0][0]}" regex="${rx_search_titles}"/>
<loop name="titleAka" on="akaListFinal">
    <set name='alternate_titles' value='${movie[0].alternate_titles}'/>
    <set name="movie[0].alternate_titles" value="${alternate_titles}|${titleAka[0]:htmldecode}" />
</loop>