cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thors...@apache.org>
Subject jx:when test does not match
Date Fri, 19 Nov 2004 18:05:34 GMT
Hello list I have following problem:

<jx:set var="anrede"><session:getxml context="authentication" 
path="/authentication/data/User/Salutation"/></jx:set>

I create a variable anrede (Herr|Frau). Then I want to test whether the 
variable value is Herr or Frau like the following, but the first 
condition is always true (and I do not know why):

       <jx:choose>
         <jx:when test="${anrede != 'Herr'}">
           Sehr geehrte ${anrede} <session:getxml 
context="authentication" path="/authentication/data/User/LastName"/>,
         </jx:when>
         <jx:otherwise>
           Sehr geehrter ${anrede} <session:getxml 
context="authentication" path="/authentication/data/User/LastName"/>,
         </jx:otherwise>
       </jx:choose>.

1<jx:out value="${anrede.trim() == ' Herr '}"/>1
2<jx:out value="${anrede}.trim() == 'Herr'"/>2
3<jx:out value="${anrede.contain('Herr')}"/>3
4<jx:out value="${anrede}.equal('Herr')"/>4
1<jx:out value="${anrede != ' Herr '}"/>5

gives:
Sehr geehrte Herr Wechner,

1false1
2Herr2
33
4Herr4
1true5

Anybody has a clue why it is not matching?

TIA
-- 
thorsten

"Together we stand, divided we fall"
Hey you (Pink Floyd)


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


Mime
View raw message