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...@iki.fi> on 2003/10/27 12:25:05 UTC

XSP and looping elements

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 <jo...@iki.fi>  GSM: 044 561 0270
* Always remember that you are unique.
                          Just like everyone else.*


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XSP and looping elements

Posted by Joose Vettenranta <jo...@intertechnika.com>.
ma, 2003-10-27 kello 14:01, John L. Webber kirjoitti:
> for (int i = 0; i &lt; 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 &lt; 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 &lt; 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


Re: XSP and looping elements

Posted by "John L. Webber" <Jo...@jentro.com>.
for (int i = 0; i &lt; 10; ++i) {
  <xsp:element name="elements"/>
}

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
>
>  
>

-- 
---------------------------------------------------------
 Jentro Technologies GmbH
 John L. Webber, Software Development
---------------------------------------------------------
 Rosenheimer Str. 145e	    81671 München
 Tel. +49 700 881 199 88    mailto:John.Webber@jentro.com 
 Fax  +49 700 881 199 88    http://www.jentro.com
---------------------------------------------------------
NOTICE: The information contained in this e-mail is confidential or may otherwise be legally privileged. It is intended for the named recipient only. If you have received it in error, please notify us immediately by reply or by calling the telephone number above and delete this message and all its attachments without any use or further distribution of its contents. Please note that any unauthorised review, copying, disclosing or otherwise making use of the information is strictly prohibited. Thank you. 
---------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XSP and looping elements

Posted by Gianluca Sartori <g....@elis.org>.
Try using "&lt;" instead of "<". Your code seems to be correct.

Gianluca

Il lun, 2003-10-27 alle 12:25, Joose Vettenranta ha scritto:
> 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


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org