You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joose Vettenranta <jo...@intertechnika.com> on 2003/11/12 20:23:31 UTC
Re: XSP and looping elements
ma, 2003-10-27 kello 14:01, John L. Webber kirjoitti:
> for (int i = 0; i < 10; ++i) {
> <xsp:element name="elements"/>
> }
Ok, this works, but, What if I want to loop ESQL-commands?
<xsp:page ....>
<test>
<xsp:logic>
<esql:connection>
<esql:database>x</esql:database>
for (int i = 0; i < 10; i++) {
<esql:execute-query>
<esql:query>SELECT NEXTVAL('list_id_seq') as id</esql:query>
</esql:execute-query>
}
</esql:connection>
</xsp:logic>
</test>
</xsp:page>
Will make:
<test xmlns:xspdoc="http://apache.org/cocoon/XSPDoc/v1"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
xmlns:xsp="http://apache.org/xsp">
<esql:database>x</esql:database>
for (int i = 0; i < 10; i++) {
</test>
And no SELECT-clauses to SQL-server..
So, howto loop SELECT-clause?
- Joose
>
> Joose Vettenranta wrote:
>
> >Hi,
> >
> >how can I do this in XSP:
> >
> ><xsp:logic>
> >for (int i=0; i<10; ++i) {
> > <elements />
> >}
> ></xsp:logic>
> >
> >so that <elements /> would be 10 times in XML-file.
> >
> >Using cocoon 2.1
> >
> >- Joose
> >
> >
> >
--
Joose Vettenranta, Intertechnika Oy
E-Mail: joose.vettenranta@intertechnika.com
WWW: http://www.intertechnika.com/
GSM: 044 561 0270
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org