Hello,

I need to get the actual index within an iteration. I'm using a Flowscript and the JXTemplateTransformer to transform the following lines:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<html xmlns:jx="http://apache.org/cocoon/templates/jx/1.0";>
<header><title>Test</title></header>
<body>

<jx:forEach select="#{myArray}">
<jx:set var="index" value="#{position()}"/>

  Value: #{.}
  Index: #{$index}

</jx:forEach>

</body>
</html>

This works fine but #{$index} has always the same value: 0. Why? Does <jx:set/> not pointing to the actual node or position() not working correct? Is there another way, to get the index within the forEach iteration? With Jexl?

Thank you very much!

Regards
Stephan


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to