Bug 10848 - context tag doesn't work
Summary: context tag doesn't work
Alias: None
Product: Taglibs
Classification: Unclassified
Component: XTags Taglib (show other bugs)
Version: 1.0
Hardware: PC All
: P3 normal with 1 vote (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2002-07-15 22:34 UTC by Matt BenDaniel
Modified: 2005-03-20 17:06 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
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.