Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forums[JET] <c:iterate> , arithmetic questions
https://www.eclipse.org/forums/index.php/mv/msg/162912/515419/#msg_515419
I have some questions..
1) how to start an iteration with zero instead of 1.
2)can I loop on children of a certain node and have an Iterator @ the same time?
3) are any arithmetic operations are allowed?
note: I use jet to generate .c files ... ie. i dont use jet2 java tags.]]>Samira 2010-02-18T17:47:35-00:00Re: [JET] <c:iterate> , arithmetic questions
https://www.eclipse.org/forums/index.php/mv/msg/162912/516891/#msg_516891
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:
>
> 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.]]>Paul Elder2010-02-25T13:18:55-00:00