DoWhile Example

Note that the expression parameter is evaluated after execution of the SXML enclosed by the macro.

Smartsite SXML CopyCode image Copy Code
<se:dowhile
    expression="buffer.get(a) LTE 10"
    rem="shows a list of numbers from 1 to 10, separated by a br-tag"
    error="{this.error()}"
>
    {buffer.get(a, default=1)}<br/>
    {buffer.set(a, buffer.get(a,default=1)+1)}
</se:dowhile>
Example Result CopyCode image Copy Code
1<br/>
2<br/>
3<br/>
4<br/>
5<br/>
6<br/>
7<br/>
8<br/>
9<br/>
10<br/>