Bug 10848 - context tag doesn't work
Summary: context tag doesn't work
Status: RESOLVED INVALID
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
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-15 22:34 UTC by Matt BenDaniel
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

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