You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stephan Coboos <cr...@gmx.net> on 2003/11/25 21:39:29 UTC

JXTemplate and postion()?

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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org