You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Marco Spinetti <m....@pisa.iol.it> on 2000/11/14 11:38:44 UTC

LOGIC IN ESQL

Hi all,
I have read that I can insert my logic inside the Tag Esql. I have tried to do that (I must do some elaborations on the results) but I obtain some mistakes as if the logic was not elaborated.
 In my file I write:

<esql:results>
    <header>Example</header> 
    <esql:row-results>
    <xsp:logic>
    for(int i=1; i&lt;=12; i++) {
     <ResultElement>
     <Name><xsp:expr>nomi[i-1]</xsp:expr></Name>
     <Value>
     if( i==2 | i==3 |i==4 | i==11 ) {
      <esql:get-int column="i"/>
     }
     else { 
      <esql:get-string column="i"/>
     }
     </Value>
     </ResultElement>
    }
    </xsp:logic>
    </esql:row-results>
   </esql:results> 

Where is the error?
Can you help me?
Thanks many 
Marco
m.spinetti@pisa.iol.it


Re: LOGIC IN ESQL

Posted by Donald Ball <ba...@webslingerZ.com>.
On Tue, 14 Nov 2000, Marco Spinetti wrote:

> Hi all,
> I have read that I can insert my logic inside the Tag Esql. I have tried to do that (I must do some elaborations on the results) but I obtain some mistakes as if the logic was not elaborated.
>  In my file I write:
> 
> <esql:results>
>     <header>Example</header> 
>     <esql:row-results>
>     <xsp:logic>
>     for(int i=1; i&lt;=12; i++) {
>      <ResultElement>
>      <Name><xsp:expr>nomi[i-1]</xsp:expr></Name>
>      <Value>

i believe you'll want another <xsp:logic> element here to indicate that
you're beginning to do java logic again - otherwise the xsp processor is
going to assume this is text you're spitting out.

>      if( i==2 | i==3 |i==4 | i==11 ) {

you'l need to surround these expressions with <xsp:expr> if you want them
to to appear standalone like this.

>       <esql:get-int column="i"/>
>      }
>      else { 
>       <esql:get-string column="i"/>
>      }
>      </Value>
>      </ResultElement>
>     }
>     </xsp:logic>
>     </esql:row-results>
>    </esql:results> 

- donald