Bug 10848

Summary: context tag doesn't work
Product: Taglibs Reporter: Matt BenDaniel <bendaniel>
Component: XTags TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED INVALID    
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">
<html>
<%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0" prefix="xtags" %>
<head>
<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">
</head>
<body>

<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>

  <p>
    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"/> 
  </p>

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

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

  <p>
   again, boiling point is:
   <xtags:context select="BOILING_POINT">
     <xtags:valueOf select="@UNITS"/>
   </xtags:context>
  </p>
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.