Bug 8486 - x:when does not seem to work as defined
Summary: x:when does not seem to work as defined
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2002-04-24 19:24 UTC by Prasad Subramanian
Modified: 2004-11-16 19:05 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Prasad Subramanian 2002-04-24 19:24:36 UTC
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" />


<x:forEach select="$txDom//activities/activity" >
<x:out select="status" />
<x:out select="status='WIP'" />
<table border="1">
		<x:when select="status='Completed'" >
		<b>These are the activities that are In progress </b>
			<td><x:out select="@id" /></td>
			<td><x:out select="description" /></td>
			<td><x:out select="resp_engr" /></td>
		<x:when select="status='WIP'" >
		<b>These are the activities that are Completed </b>
			<td><x:out select="@id" /></td>
			<td><x:out select="name" /></td>
			<td><x:out select="resp_engr" /></td>
		<b>These are the activities that are Planned </b>
			<td><x:out select="@id" /></td>
			<td><x:out select="name" /></td>
			<td><x:out select="resp_engr" /></td>

Comment 1 Shawn Bayern 2002-04-24 20:23:12 UTC
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.
Comment 2 Shawn Bayern 2002-04-29 16:37:34 UTC
Fixed as promised in current CVS head via integration with new FCS 1.0 versions
of Jaxen and SAXPath.