|
Re: [JET] <c:iterate> , arithmetic questions [message #516891 is a reply to message #515419] |
Thu, 25 February 2010 13:18 |
Paul Elder Messages: 849 Registered: July 2009 |
Senior Member |
|
|
Samira:
Some answers...
Samira wrote:
> Hi Every one :)
>
> I have some questions..
>
> 1) how to start an iteration with zero instead of 1.
I assume you are doing a numerical iteration. Something like:
<c:iterate select="5" var="i">
... i will have values 1, 2, 3, 4, 5
</c:iterate>
There is no way start at a different number, but you can do arithmetic
with i:
<c:iterate select="5" var="i">
someCArray[<c:get select="$i - 1"/>] = ...
// or, with JET 1.0 compact replacement expressions:
someCArray[${$i - 1}] = ...
</c:iterate>
>
> 2)can I loop on children of a certain node and have an Iterator @ the
> same time?
I don't understand your question. Can you give me an example of what you
would like to do?
>
> 3) are any arithmetic operations are allowed?
>
Yes. XPath has four basic types: nodes (i.e. elements, attributes, ...),
strings, numbers and booleans. You can do standard arithmetic operations
on numbers, plus, there is the number() function to convert other types
to numbers.
>
> note: I use jet to generate .c files ... ie. i dont use jet2 java tags.
|
|
|
Powered by
FUDForum. Page generated in 0.03719 seconds