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>
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>
This tag needs to have the valueOf tag to access the data at the selected node.