Bug 7849 - xpath evaluator doesn't use scoped variable in select
Summary: xpath evaluator doesn't use scoped variable in select
Status: CLOSED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.0B1
Hardware: Sun Solaris
: P3 blocker (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-08 19:14 UTC by Stephanie Bodoff
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephanie Bodoff 2002-04-08 19:14:09 UTC
When provide a scoped variable to a select, abook has all empty values. If I use
a constant to select a particular id, it works. 

<x:parse var="booklist" >
<books>
  <book id="201">
    <lastname>Duke</lastname>
    <firstname></firstname>
    <title>My Early Years: Growing up on *7</title>
    <price>10.75</price>
    <year>1995</year>
    <description>What a cool book.</description>
    <inventory>20</inventory>
  </book>
  <book id="202">
    <lastname>Jeeves</lastname>
    <firstname></firstname>
    <title>Web Servers for Fun and Profit</title>
    <price>10.75</price>
    <year>2000</year>
    <description>What a cool book.</description>
    <inventory>20</inventory>
  </book>
  <book id="203">
    <lastname>Masterson</lastname>
    <firstname>Webster</firstname>
    <title>Web Components for Web Developers</title>
    <price>17.75</price>
    <year>2000</year>
    <description>What a cool book.</description>
    <inventory>20</inventory>
  </book>
</books>
</x:parse>
	
<c:if test="${param.bookId != null}">
<x:set var="abook" select="$booklist/books/book[@id=$param:bookId]" />
<h2><x:out select="$abook/title"/></h2>
</c:if>
Comment 1 Shawn Bayern 2002-04-08 19:28:57 UTC
Thanks for the report, Stephanie.  This works now; there may have been a bug 
immediately post-Beta1, or perhaps in Beta1 itself.

By the way, 'param' indicates a request parameter, not a scoped variable.  Just 
wanted to make sure we're talking about the same thing.  If I load your test 
page with a query string of "?bookId=203" (leading to "$param:bookId=203"), I 
get the correct book title.

Also, how much would it cost my publisher in promotional dollars to add my 
books to your list?  :-)