XPages – For … Loop issue

While working on some XPages app dev, I encountered a problem with for … loops in an output script block when the loop is used together with other XPages elements in the block.

There are two ways of filling the content of the script block. The picture below shows both ways and in both cases I get an error message and the code does not compile.

The only way to get rid of the error in the second sample was to replace the “<” with a special character substitution codeĀ  &lt; or &#60; .