You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by js...@apache.org on 2001/06/25 20:02:59 UTC

cvs commit: jakarta-taglibs/xtags/examples/web/test test_variable.jsp

jstrachan    01/06/25 11:02:59

  Added:       xtags/examples/web/test test_variable.jsp
  Log:
  Added new test case for the use of numeric variables
  
  Revision  Changes    Path
  1.1                  jakarta-taglibs/xtags/examples/web/test/test_variable.jsp
  
  Index: test_variable.jsp
  ===================================================================
  <%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0" prefix="xtags" %>
  <html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>Test &lt;xtags:variable&gt;</title>
  <link rel="stylesheet" href="../examples.css" type="text/css">
  </head>
  
  <body>
  
  <h1>Test &lt;xtags:variable&gt;</h1>
  
  <xtags:parse uri="tree.xml"/>
  
  <table>
    <tr>
      <td>valueOf</td>
      <td>
        <xtags:valueOf select="count(//folder)"/>
      </td>
    </tr>
    <tr>
      <td>format-number</td>
      <td>
        <xtags:valueOf select="format-number(count(//folder))"/>
      </td>
    </tr>
    <tr>
      <td>variable</td>
      <td>
        <xtags:variable id="foo" select="count(//folder)"/>
        <%= foo %>
      </td>
    </tr>
    <tr>
      <td>number variable</td>
      <td>
        <xtags:variable id="foo2" type="number" select="count(//folder)"/>
        <%= foo2.intValue() %>
      </td>
    </tr>
    <tr>
      <td>java.lang.Double variable</td>
      <td>
        <xtags:variable id="foo3" type="java.lang.Double" select="count(//folder)"/>
        <%= foo3.intValue() %>
      </td>
    </tr>
  </table>
  
  <hr>
  
  </body>
  </html>