You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by pguillard <pg...@soociety.com> on 2004/11/22 07:07:02 UTC

JXTemplate test condition

Hi,

Basic question but i can't find the answer: how to write a more complex 
test condition in JXT exprerssion
 
        <jx:choose>
            <jx:when test="${value1=='1'} and ${value2=='2'}">
            or  <jx:when test="${value1=='1'} &amp;&amp; ${value2=='2'}">
            or <jx:when test="${value1=='1' &amp;&amp; value2=='2'}">

Regards,
Phil


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


Re: JXTemplate test condition

Posted by Jan Hoskens <jh...@schaubroeck.be>.
You need to set the complete jexl expression in the curly braces , and 
if working with strings, I prefer .equals():

<jx:when test="${value1.equals('1') and not(value2.equals('2'))}/>

use and/or/not as operators (more on this at: 
http://java.sun.com/webservices/docs/1.0/tutorial/doc/JSTL4.html#65865)

Kind Regards,
Jan

oceatoon wrote:

>pguillard wrote:
>
>  
>
>>Hi,
>>
>>Basic question but i can't find the answer: how to write a more complex
>>test condition in JXT exprerssion
>> 
>>        <jx:choose>
>>            <jx:when test="${value1=='1'} and ${value2=='2'}">
>>            or  <jx:when test="${value1=='1'} &amp;&amp; ${value2=='2'}">
>>            or <jx:when test="${value1=='1' &amp;&amp; value2=='2'}">
>>
>>Regards,
>>Phil
>>    
>>
>This might simply be a syntax problem Phil, once you're in a ${} you can
>manipulate all jx variable from the context
>I haven't tried this but don't see why it wouldn't run   
><jx:choose>
><jx:when test="${(value1=='1' &amp;&amp; value2=='2') || (value1=='1' and
>$value2=='2')} ">
>            ...etc
>
>Tibor
>
>
>---------------------------------------------------------------------
>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


Re: JXTemplate test condition

Posted by oceatoon <t....@systheo.com>.
pguillard wrote:

> Hi,
> 
> Basic question but i can't find the answer: how to write a more complex
> test condition in JXT exprerssion
>  
>         <jx:choose>
>             <jx:when test="${value1=='1'} and ${value2=='2'}">
>             or  <jx:when test="${value1=='1'} &amp;&amp; ${value2=='2'}">
>             or <jx:when test="${value1=='1' &amp;&amp; value2=='2'}">
> 
> Regards,
> Phil
This might simply be a syntax problem Phil, once you're in a ${} you can
manipulate all jx variable from the context
I haven't tried this but don't see why it wouldn't run   
<jx:choose>
<jx:when test="${(value1=='1' &amp;&amp; value2=='2') || (value1=='1' and
$value2=='2')} ">
            ...etc

Tibor


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


Re: JXTemplate test condition

Posted by Upayavira <uv...@upaya.co.uk>.
pguillard wrote:

> Right. Thanks a lot, 

You're welcome.

> thanks for the photo album too !

Huh?

Regards, Upayavira

> Upayavira wrote:
>
>> pguillard wrote:
>>
>>> Hi,
>>>
>>> Basic question but i can't find the answer: how to write a more 
>>> complex test condition in JXT exprerssion
>>>
>>>        <jx:choose>
>>>            <jx:when test="${value1=='1'} and ${value2=='2'}">
>>>            or  <jx:when test="${value1=='1'} &amp;&amp; 
>>> ${value2=='2'}">
>>>            or <jx:when test="${value1=='1' &amp;&amp; value2=='2'}">
>>
>>
>>
>> <jx:when test="${value1=='1' and value2=='2'}">
>> should do it, I believe.
>



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


Re: JXTemplate test condition

Posted by pguillard <pg...@soociety.com>.
Right. Thanks a lot, thanks for the photo album too !

Upayavira wrote:

> pguillard wrote:
>
>> Hi,
>>
>> Basic question but i can't find the answer: how to write a more 
>> complex test condition in JXT exprerssion
>>
>>        <jx:choose>
>>            <jx:when test="${value1=='1'} and ${value2=='2'}">
>>            or  <jx:when test="${value1=='1'} &amp;&amp; ${value2=='2'}">
>>            or <jx:when test="${value1=='1' &amp;&amp; value2=='2'}">
>
>
> <jx:when test="${value1=='1' and value2=='2'}">
> should do it, I believe.
>
> Regards, Upayavira
>
>
> ---------------------------------------------------------------------
> 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


Re: JXTemplate test condition

Posted by Upayavira <uv...@upaya.co.uk>.
pguillard wrote:

> Hi,
>
> Basic question but i can't find the answer: how to write a more 
> complex test condition in JXT exprerssion
>
>        <jx:choose>
>            <jx:when test="${value1=='1'} and ${value2=='2'}">
>            or  <jx:when test="${value1=='1'} &amp;&amp; ${value2=='2'}">
>            or <jx:when test="${value1=='1' &amp;&amp; value2=='2'}">

<jx:when test="${value1=='1' and value2=='2'}">
 should do it, I believe.

Regards, Upayavira


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