I think the last error has to do with your definition of the cnt variable. Integer is not a valid datatype for EMML variables, so the Mashup Engine is treating it as a string. Valid variable types are string, number, date, boolean and document (meaning complex object and well-formed XML document).
So change this to:
<variable name="cnt" type="number"/>
and it should work.
<!--Session data-->
Sara, technical writer/jackbe
Hi,
This seems a bug. The workaround is to initialize the 'cnt' variable explcitly i.e.,
<variable name="cnt" type="integer" default="0" />
Now, the output should be as ...
[java] while-loop: 0
[java] while-loop: 1.0
[java] while-loop: 2.0
[java] while-loop: 3.0
[java] while-loop: 4.0
[java] while-loop: 5.0
[java] while-loop: 6.0
[java] while-loop: 7.0
[java] while-loop: 8.0
[java] while-loop: 9.0
[java] while-loop: 10.0
[java] enough already...
raj. chief masher @ jackbe




I am new to EMML. I tired to break from a loop. I experimented with the code from the help file but failed.
First, it complained on variable 'cnt' not found. I added definition for cnt and it gave an error on: Unsuitable operands for arithmetic operation (xs:string, xs:integer)
Can someone teach me how to make this work?
Thanks.
<mashup xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jackbe.com/2008-03-01/EMMLSchema/ ../src/schemas/EMMLSpec.xsd"
xmlns="http://www.jackbe.com/2008-03-01/EMMLSchema"
xmlns:macro="http://www.jackbe.com/2008-03-01/EMMLMacro"
name = "looptest">
<variables>
<variable name="cnt" type="integer" />
</variables>
<while condition="true()">
<display message="while-loop: " expr="$cnt"/>
<assign fromexpr="$cnt + 1" outputvariable="cnt"/>
<if condition="$cnt > 10">
<display message="enough already..." />
<break/>
</if>
</while>
</mashup>