cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: Embedding esql:query within logic sheets.
Date Thu, 18 Oct 2001 14:39:17 GMT
Colm O'Riordan wrote:
> 
> Is this possible ? I have tried the code below but it seems to concat the
> two options rather than choose one.
> Do I need to have the logic outside the execute query tag ? I was hoping to
> avoid this as the results format is the same and I dont want to have to put
> it in twice in the same file.
> 
> Suggestions appreciated,
> 
> Thanks,
> Colm.
> 
> <xsp:logic>
>      if(getJock == null)
>      {
>     </xsp:logic>
>      <esql:query>
>         select
>          DJName, Intro, News, SlotDay, SlotTime, ImagePath
>         from
>          DJINFO where ID =<xsp:expr>getstatus</xsp:expr>
>      </esql:query>
>     <xsp:logic>
>         }
>     else
>     {
>     </xsp:logic>
>     <esql:query>
>        select
>         DJName, Intro, News, SlotDay, SlotTime, ImagePath
>        from
>         DJINFO where DJName like<xsp:expr>getJock</xsp:expr>
>      </esql:query>
>      <xsp:logic>
>      }
>     </xsp:logic>


In this case, I would rather see something like this:

<esql:query>
  select
    DJName, Intro, News, SlotDay, SlotTime, ImagePath
  from
    DJINFO where DJName like <xsp:expr>(getJock == null) ? getstatus : getJock</xsp:expr>
</esql:query>

See how much less typing there is, and you get predictable results.
Otherwise, you would have to place the whole <esql:execute-query/>
block within the if/else statements.

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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


Mime
View raw message