tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <k...@dotech.com>
Subject Re: XPath function not() not working.
Date Fri, 28 Apr 2006 18:07:00 GMT
Is "bookId" a request parameter? If so, what happens with this:

<x:when select="not($xml/books/book[id=$param:bookId])">

S├ębastien Brodeur wrote:
> S├ębastien Brodeur <brodseba <at> gmail.com> writes:
> 
> I want to clarify my post.
> 
> I check the JSTL 1.1 Specification Maintenance Release, but I found nothing
> helpful (except the change in <x:forEach> having now a varStatus attribute and
> the fact that the <c:forEach> can no longer use a X tags select to iterate.  A
> change not highlight into the Appendix A by the way.)
> 
> This code work fine using JSTL 1.0, but not with JSTL 1.1.  The expression
> ($xml/books/book[id=$param.bookId]) ALWAYS return false, so I ALWAYS got
> not(false())
> 
> <x:choose>
>   <x:when select="not($xml/books/book[id=$param.bookId])">
>     <%-- There is no valid node in the xml --%>
>   </x:when>
>   <x:otherwise>
>     <%-- Do something with the xml. --%>
>   </x:otherwise>
> </x:choose>
> 
> The easies solution seem obvious.  I should remore the not() and swap the code
> segment from when to otherwise.  But not() should work God d**m it.
> 
> We have also problem using the AND and OR operator in XPath expression.

-- 
Kris Schneider <mailto:kris@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message