cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Coboos <cromo...@gmx.net>
Subject JXTemplate and postion()?
Date Tue, 25 Nov 2003 20:39:29 GMT
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


Mime
View raw message