I have a two x:when statements and x:otherwise inside a x:choose . Though the XPath expression that I use evalutes correctly ( i used x:out to determine this ) However the first block of x:when is evaluated everytime. Seems like a basic issue : Just want to make sure that I am doing it correctly. ===================================================================== <%@taglib uri="http://java.sun.com/jstl/ea/core" prefix="c" %> <%@taglib uri="http://java.sun.com/jstl/ea/xml" prefix="x" %> <%@page import="javax.xml.transform.stream.*,java.io.*" session="true" %> <jsp:include page="menu.jsp" /> <c:import url="activity.xml" varReader="xmlImport" > <x:parse xml="${xmlImport}" varDom="txDom" /> </c:import> <x:forEach select="$txDom//activities/activity" > <x:out select="status" /> <x:out select="status='WIP'" /> <table border="1"> <x:choose> <x:when select="status='Completed'" > <b>These are the activities that are In progress </b> <tr> <td><x:out select="@id" /></td> <td><x:out select="description" /></td> <td><x:out select="resp_engr" /></td> </tr> </x:when> <x:when select="status='WIP'" > <b>These are the activities that are Completed </b> <table> <tr> <td><x:out select="@id" /></td> <td><x:out select="name" /></td> <td><x:out select="resp_engr" /></td> </tr> </table> </x:when> <x:otherwise> <b>These are the activities that are Planned </b> <table> <tr> <td><x:out select="@id" /></td> <td><x:out select="name" /></td> <td><x:out select="resp_engr" /></td> </tr> </table> </x:otherwise> </x:choose> </table> </x:forEach>
Thanks - this is a known bug, though it wasn't noted in Bugzilla. It's a problem with Jaxen that has been fixed by an updated release; the problem should go away as we move to the new Jaxen version.
Fixed as promised in current CVS head via integration with new FCS 1.0 versions of Jaxen and SAXPath.