cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Painter-Wakefield <paint...@mc.duke.edu>
Subject Re: XSP and looping elements
Date Wed, 12 Nov 2003 20:48:05 GMT




This should work fine, although you may need to put <xsp:logic> around your
for loop (inside <esql:connection>).  Are you finding that it doesn't work?
You could also put the for loop around your <esql:connection> node.

-Christopher



|---------+------------------------------------->
|         |           Joose Vettenranta         |
|         |           <joose.vettenranta@interte|
|         |           chnika.com>               |
|         |                                     |
|         |           11/12/2003 02:23 PM       |
|         |           Please respond to users   |
|         |                                     |
|---------+------------------------------------->
  >--------------------------------------------------------------------------------------------------------------|
  |                                                                                      
                       |
  |       To:       users@cocoon.apache.org                                              
                       |
  |       cc:                                                                            
                       |
  |       Subject:  Re: XSP and looping elements                                         
                       |
  >--------------------------------------------------------------------------------------------------------------|




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





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


Mime
View raw message