Bug 10848

Summary: context tag doesn't work
Product: Taglibs Reporter: Matt BenDaniel <bendaniel>
Component: XTags TaglibAssignee: Tomcat Developers Mailing List <dev>
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description Matt BenDaniel 2002-07-15 22:34:32 UTC
JSP below is modified version of XTags example and demonstrates non-working 
context tag.  The XTags I'm using are from Apache's July 15, 2002 build.  I 
think the version number is 1.1.
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0" prefix="xtags" %>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Periodic Table Demo</title>
<link rel="stylesheet" href="examples.css" type="text/css">

<h1>Periodic Table Demo</h1>

<p>This example demonstrates the direct use of the XPath tag library to format 
an XML document.</p>

<xtags:parse uri="/periodic_table.xml"/>

<xtags:forEach select="//ATOM">

  <h2><xtags:valueOf select="NAME"/> : <xtags:valueOf select="SYMBOL"/></h2>

    The atom has an atomic weight of 
    <b> <xtags:valueOf select="ATOMIC_WEIGHT"/> </b>

    and a boiling point of 
    <b> <xtags:valueOf select="BOILING_POINT"/> </b>
    <xtags:valueOf select="BOILING_POINT/@UNITS"/> 

again, boiling point is:
   <xtags:context select="BOILING_POINT"/>
   <xtags:valueOf select="@UNITS"/>

Comment 1 Sven Rottenbiller 2003-06-04 11:02:53 UTC
I'm not sure, but i think this will work:

   again, boiling point is:
   <xtags:context select="BOILING_POINT">
     <xtags:valueOf select="@UNITS"/>
Comment 2 Ray Hunter 2004-01-05 02:51:58 UTC
This tag needs to have the valueOf tag to access the data at the selected node.