Re: XPath function not() not working.

Sébastien Brodeur <[email protected]>
Newsgroups gmane.comp.jakarta.taglibs.user
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.