cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jcplerm" <jcpl...@ameritech.net>
Subject Re: How to use "if" expressions with JX template transformer (2)
Date Tue, 30 Sep 2003 18:05:29 GMT
Thanks, that worked!

----- Original Message ----- 
From: "Christopher Oliver" <res1cf5x@verizon.net>
To: <users@cocoon.apache.org>
Sent: Tuesday, September 30, 2003 12:02 PM
Subject: Re: How to use "if" expressions with JX template transformer (2)


> Try this:
>
> <t:template xmlns:t="http://apache.org/cocoon/templates/jx/1.0">
>         <if
> test="#{'1'='1'}">#{getParameter($parameters,'contextPath')}</if>
>  </t:template>
>
>
> Note the use of curly braces (not parentheses) in #{1=1}.
>
>
> Chris
>
> jcplerm wrote:
>
> > Correction below...
> >
> >     ----- Original Message -----
> >     From: jcplerm <mailto:jcplerm@ameritech.net>
> >     To: users@cocoon.apache.org <mailto:users@cocoon.apache.org>
> >     Sent: Tuesday, September 30, 2003 11:37 AM
> >     Subject: How to use "if" expressions with JX template transformer
> >
> >     I'm trying to use an "<if>" tag with the JX template transformer,
> >     but can't figure out exactly the required syntax from what is
> >     explained on
> >     http://cocoon.apache.org/2.1/userdocs/flow/jxtemplate.html#if.
> >
> >     I am able to access values of objects with expressions such as
> >     "#{getParameter($parameters,'contextPath')}" but it's with tags
> >     like "<if>" that I am having problems.
> >
> >     I tried:
> >
> >           <if
> >     test="#('1'='1')">#{getParameter($parameters,'contextPath')}</if>
> >     and
> >
> >           <t:if xmlns:t="http://apache.org/cocoon/templates/jx/1.0"
> >     test="#('1'='1')">#{getParameter($parameters,'contextPath')}</t:if>
> >     and
> >
> >           <t:template
xmlns:t="http://apache.org/cocoon/templates/jx/1.0">
> >             <if
> >     test="#('1'='1')">#{getParameter($parameters,'contextPath')}</if>
> >           </t:template>
> >
> >     and
> >
> >           <t:template
xmlns:t="http://apache.org/cocoon/templates/jx/1.0">
> >            <t:if
> >     test="#('1'='1')">#{getParameter($parameters,'contextPath')}</t:if>
> >           </t:template>
> >
> >     In the first and thrid cases the <if> tag is ignored by the JX
> >     transformer, and is simply copied to the output.
> >     The second and third examples produce on output at all.
> >
> >
> > I meant "second and fourth".
>
>
>
>
> ---------------------------------------------------------------------
> 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