You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by jv...@apache.org on 2002/06/03 07:14:30 UTC

cvs commit: jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/xml example.jelly testForEach.jelly

jvanzyl     2002/06/02 22:14:30

  Modified:    jelly/src/test/org/apache/commons/jelly example2.jelly
                        example3.jelly hello_world.jelly run_all.jelly
                        show_args.jelly show_properties.jelly
                        testFindVariable.jelly test_args.jelly
               jelly/src/test/org/apache/commons/jelly/define
                        babelfishTaglib.jelly example.jelly
               jelly/src/test/org/apache/commons/jelly/jsl example.jelly
               jelly/src/test/org/apache/commons/jelly/sql example.jelly
                        example2.jelly testSql.jelly
               jelly/src/test/org/apache/commons/jelly/xml example.jelly
                        testForEach.jelly
  Log:
  Trying to fix all the line endings and get rid of the tabs.
  
  Revision  Changes    Path
  1.5       +16 -8     jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/example2.jelly
  
  Index: example2.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/example2.jelly,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- example2.jelly	21 May 2002 16:53:26 -0000	1.4
  +++ example2.jelly	3 Jun 2002 05:14:29 -0000	1.5
  @@ -1,6 +1,9 @@
  -<?xml version="1.0"?>
  -<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml">
  -  <x:parse var="doc">
    <web-app>
  +<?xml version="1.0"?>
  +
  +<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml">
  +
  +  <x:parse var="doc">
  +    <web-app>
         <servlet>
           <servlet-name>snoop</servlet-name>
           <servlet-class>SnoopServlet</servlet-class>
  @@ -21,12 +24,17 @@
           <url-pattern>/foo/snoop</url-pattern>
         </servlet-mapping>
       </web-app>
  -  </x:parse>
  +  </x:parse>
  +
     <x:set var="count" select="count($doc//servlet)"/>
     <x:forEach var="s" select="$doc//servlet">
       name: <x:expr select="$s/servlet-name"/>
       class: <x:expr select="$s/servlet-class"/>
  -  </x:forEach>
  -  There are <x:expr select="$count"/> servlet(s)
  -</j:jelly>
  -
  +  </x:forEach>
  +
  +  There are <x:expr select="$count"/> servlet(s)
  +
  +</j:jelly>
  +
  +
  +
  
  
  
  1.5       +12 -4     jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/example3.jelly
  
  Index: example3.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/example3.jelly,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- example3.jelly	21 May 2002 16:53:26 -0000	1.4
  +++ example3.jelly	3 Jun 2002 05:14:29 -0000	1.5
  @@ -1,5 +1,11 @@
  -<?xml version="1.0"?>
<jelly xmlns="jelly:core">
  -  <!-- a really silly way to do this but -->
  <!-- this should test the choose/when/otherwise tags -->
  <forEach var="iter" items="System.getProperties()">
    <choose>
      <when test='iter.key.equals( "java.home" )'>
  +<?xml version="1.0"?>
  +<jelly xmlns="jelly:core">
  +
  +  <!-- a really silly way to do this but -->
  +  <!-- this should test the choose/when/otherwise tags -->
  +  <forEach var="iter" items="System.getProperties()">
  +    <choose>
  +      <when test='iter.key.equals( "java.home" )'>
           Java Home = <expr value="iter.value"/>
         </when>
         <when test='iter.key.equals( "java.version" )'>
  @@ -10,5 +16,7 @@
         </otherwise>
       </choose>
     </forEach>
  -</jelly>
  -
  +</jelly>
  +
  +
  +
  
  
  
  1.4       +6 -3      jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/hello_world.jelly
  
  Index: hello_world.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/hello_world.jelly,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- hello_world.jelly	25 Apr 2002 16:35:55 -0000	1.3
  +++ hello_world.jelly	3 Jun 2002 05:14:29 -0000	1.4
  @@ -1,4 +1,7 @@
  -<?xml version="1.0"?>
  -<j:jelly xmlns:j="jelly:core">
  -  Hello World!
  +<?xml version="1.0"?>
  +
  +<j:jelly xmlns:j="jelly:core">
  +
  +  Hello World!
  +
   </j:jelly>
  
  
  
  1.5       +21 -6     jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/run_all.jelly
  
  Index: run_all.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/run_all.jelly,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- run_all.jelly	2 Jun 2002 17:29:02 -0000	1.4
  +++ run_all.jelly	3 Jun 2002 05:14:29 -0000	1.5
  @@ -1,9 +1,24 @@
  -<?xml version="1.0"?>
<j:jelly xmlns:j="jelly:core">

  <!-- try an absolute path -->
  -  <j:include uri="/src/test/org/apache/commons/jelly/hello_world.jelly"/>
  

  <!-- include other relative scripts... -->
  -  <j:include uri="example2.jelly"/>  
  <j:include uri="jsl/example.jelly"/> 
  <j:include uri="ant/filescanner.jelly"/> 
  +<?xml version="1.0"?>
  +<j:jelly xmlns:j="jelly:core">
  +
  +  <!-- try an absolute path -->
  +  <j:include uri="/src/test/org/apache/commons/jelly/hello_world.jelly"/>
  +  
  +
  +  <!-- include other relative scripts... -->
  +  <j:include uri="example2.jelly"/>  
  +  <j:include uri="jsl/example.jelly"/> 
  +  <j:include uri="ant/filescanner.jelly"/> 
  +
      
  -  <!-- now lets try pass in a variable to a child script -->
  <j:set var="foo">bar</j:set>
  <j:include uri="testFindVariable.jelly"/>
  
  <!-- loading all dynamic tags libraries -->
  -  <j:include uri="define/babelfishTaglib.jelly"/>
  
  +  <!-- now lets try pass in a variable to a child script -->
  +  <j:set var="foo">bar</j:set>
  +  <j:include uri="testFindVariable.jelly"/>
  +  
  +  <!-- loading all dynamic tags libraries -->
  +  <j:include uri="define/babelfishTaglib.jelly"/>
  +  
     <!-- now run a script using the new taglib -->
  -  <j:include uri="define/example.jelly"/>
  +  <j:include uri="define/example.jelly"/>
  +
   </j:jelly>
  
  
  
  1.2       +13 -3     jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/show_args.jelly
  
  Index: show_args.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/show_args.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- show_args.jelly	28 May 2002 07:20:06 -0000	1.1
  +++ show_args.jelly	3 Jun 2002 05:14:29 -0000	1.2
  @@ -1,4 +1,14 @@
  -<?xml version="1.0"?>

<!-- displays the current command line arguments -->
  -
<j:jelly xmlns:j="jelly:core">
<arguments>
  -  <j:forEach var="arg" items="${args}">
  	<argument><j:expr value="${arg}"/></argument>
  </j:forEach>
</arguments>
  +<?xml version="1.0"?>
  +
  +<!-- displays the current command line arguments -->
  +
  +
  +<j:jelly xmlns:j="jelly:core">
  +<arguments>
  +
  +  <j:forEach var="arg" items="${args}">
  +      <argument><j:expr value="${arg}"/></argument>
  +  </j:forEach>
  +</arguments>
  +
   </j:jelly>
  
  
  
  1.6       +14 -7     jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/show_properties.jelly
  
  Index: show_properties.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/show_properties.jelly,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- show_properties.jelly	16 May 2002 16:29:55 -0000	1.5
  +++ show_properties.jelly	3 Jun 2002 05:14:29 -0000	1.6
  @@ -1,20 +1,27 @@
  -<?xml version="1.0"?>
  -<j:jelly xmlns:j="jelly:core">
  +<?xml version="1.0"?>
  +
  +<j:jelly xmlns:j="jelly:core">
  +
   <html>
     <body>
  -    <h1>System properties</h1>
    
  +    <h1>System properties</h1>
  +    
       <table>
         <tr>
           <th>Name</th>
           <th>Value</th>
  -      </tr>
  +      </tr>
  +
         <j:forEach var="iter" items="${System.getProperties()}">
           <tr>
             <td><j:expr value="${iter.key}"/></td>
             <td><j:expr value="${iter.value}"/></td>
           </tr>
         </j:forEach>
  -    </table>
  -  </body>
  -</html>
  +    </table>
  +
  +  </body>
  +
  +</html>
  +
   </j:jelly>
  
  
  
  1.2       +8 -1      jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/testFindVariable.jelly
  
  Index: testFindVariable.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/testFindVariable.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- testFindVariable.jelly	30 May 2002 16:47:17 -0000	1.1
  +++ testFindVariable.jelly	3 Jun 2002 05:14:29 -0000	1.2
  @@ -1 +1,8 @@
  -<?xml version="1.0"?>
<j:jelly xmlns:j="jelly:core">
  <j:if test='${context.findVariable("foo") != "bar"}'>
  	<fail>The value of foo in a parent scope does not equal to 'bar'</fail>
  </j:if>
  
  The value of foo is <j:expr value='${context.findVariable("foo")}'/>
</j:jelly>
  \ No newline at end of file
  +<?xml version="1.0"?>
  +<j:jelly xmlns:j="jelly:core">
  +  <j:if test='${context.findVariable("foo") != "bar"}'>
  +      <fail>The value of foo in a parent scope does not equal to 'bar'</fail>
  +  </j:if>
  +  
  +  The value of foo is <j:expr value='${context.findVariable("foo")}'/>
  +</j:jelly>
  \ No newline at end of file
  
  
  
  1.2       +7 -2      jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/test_args.jelly
  
  Index: test_args.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/test_args.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test_args.jelly	28 May 2002 07:20:06 -0000	1.1
  +++ test_args.jelly	3 Jun 2002 05:14:29 -0000	1.2
  @@ -1,2 +1,7 @@
  -<?xml version="1.0"?>

<!-- displays the current command line arguments -->
  -<j:jelly xmlns:j="jelly:core">
  <j:forEach var="arg" items="${args}"><j:expr value="${arg}"/> </j:forEach>
</j:jelly>
  \ No newline at end of file
  +<?xml version="1.0"?>
  +
  +<!-- displays the current command line arguments -->
  +
  +<j:jelly xmlns:j="jelly:core">
  +  <j:forEach var="arg" items="${args}"><j:expr value="${arg}"/> </j:forEach>
  +</j:jelly>
  \ No newline at end of file
  
  
  
  1.4       +9 -4      jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/define/babelfishTaglib.jelly
  
  Index: babelfishTaglib.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/define/babelfishTaglib.jelly,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- babelfishTaglib.jelly	31 May 2002 08:52:03 -0000	1.3
  +++ babelfishTaglib.jelly	3 Jun 2002 05:14:30 -0000	1.4
  @@ -1,7 +1,10 @@
  -<?xml version="1.0"?>
  -<!-- defines a new taglib of babelfish soap services -->
  +<?xml version="1.0"?>
  +
  +<!-- defines a new taglib of babelfish soap services -->
  +
   <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:define="jelly:define" xmlns:http="notImplementedYet">
  -  <define:taglib uri="jelly:babelfish">  
  +  <define:taglib uri="jelly:babelfish">  
  +
       <!-- defines the <translate> tag                                            -->
       <!-- notice how the 'from' and 'to' attributes are available as variables   -->
       <!-- and the body of the <translate> tag is invoked via <define:invokeBody> -->
  @@ -26,4 +29,6 @@
         </http:post>
       </define:tag>
       
  -  </define:taglib>    
</j:jelly>
  +  </define:taglib>    
  +</j:jelly>
  +
  
  
  
  1.4       +15 -4     jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/define/example.jelly
  
  Index: example.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/define/example.jelly,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- example.jelly	31 May 2002 08:52:03 -0000	1.3
  +++ example.jelly	3 Jun 2002 05:14:30 -0000	1.4
  @@ -1,4 +1,15 @@
  -<?xml version="1.0"?>
  -<!-- uses the babelfish taglib -->
<j:jelly xmlns:j="jelly:core" xmlns:babelfish="jelly:babelfish">

  This example should output a web service call...
  -  <babelfish:translate from="EN" to="FR">
    Jelly is cool stuff!
  </babelfish:translate>
  -  ... OK did that work?

</j:jelly>
  +<?xml version="1.0"?>
  +
  +<!-- uses the babelfish taglib -->
  +<j:jelly xmlns:j="jelly:core" xmlns:babelfish="jelly:babelfish">
  +
  +  This example should output a web service call...
  +
  +  <babelfish:translate from="EN" to="FR">
  +    Jelly is cool stuff!
  +  </babelfish:translate>
  +
  +  ... OK did that work?
  +
  +</j:jelly>
  +
  
  
  
  1.2       +49 -1     jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jsl/example.jelly
  
  Index: example.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/jsl/example.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- example.jelly	25 May 2002 18:27:21 -0000	1.1
  +++ example.jelly	3 Jun 2002 05:14:30 -0000	1.2
  @@ -1 +1,49 @@
  -<?xml version="1.0"?>
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:jsl="jelly:jsl">

<html>
<body>
	
  <x:parse var="doc">
  <simpleDocument author="James Elson">

    <title>I am a title!</title>

    <synopsis>Twas a dark, rainy night...</synopsis>

    <para>dfjsdfjsdf</para>
    <para>fdsfsdfhdsff gyuf uysgf ds</para>

  </simpleDocument>
  </x:parse>


<h1>Output</h1>


<jsl:stylesheet source="${doc}">

  <jsl:template match="/">
    <jsl:applyTemplates/>
  </jsl:template>

  <jsl:template match="*">
    <small><jsl:applyTemplates/></small>
  </jsl:template>

  <jsl:template match="title">
    <h2><jsl:applyTemplates/></h2>
  </jsl:template>


  <jsl:template match="para">
    <p><jsl:applyTemplates/></p>
  </jsl:template>

</jsl:stylesheet>

</body>
</html>

</j:jelly>

  \ No newline at end of file
  +<?xml version="1.0"?>
  +<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:jsl="jelly:jsl">
  +
  +<html>
  +<body>
  +    
  +  <x:parse var="doc">
  +  <simpleDocument author="James Elson">
  +
  +    <title>I am a title!</title>
  +
  +    <synopsis>Twas a dark, rainy night...</synopsis>
  +
  +    <para>dfjsdfjsdf</para>
  +    <para>fdsfsdfhdsff gyuf uysgf ds</para>
  +
  +  </simpleDocument>
  +  </x:parse>
  +
  +
  +<h1>Output</h1>
  +
  +
  +<jsl:stylesheet source="${doc}">
  +
  +  <jsl:template match="/">
  +    <jsl:applyTemplates/>
  +  </jsl:template>
  +
  +  <jsl:template match="*">
  +    <small><jsl:applyTemplates/></small>
  +  </jsl:template>
  +
  +  <jsl:template match="title">
  +    <h2><jsl:applyTemplates/></h2>
  +  </jsl:template>
  +
  +
  +  <jsl:template match="para">
  +    <p><jsl:applyTemplates/></p>
  +  </jsl:template>
  +
  +</jsl:stylesheet>
  +
  +</body>
  +</html>
  +
  +</j:jelly>
  +
  
  
  
  1.2       +25 -21    jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/sql/example.jelly
  
  Index: example.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/sql/example.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- example.jelly	15 May 2002 06:25:50 -0000	1.1
  +++ example.jelly	3 Jun 2002 05:14:30 -0000	1.2
  @@ -1,21 +1,25 @@
  -<?xml version="1.0"?>
  -<j:jelly xmlns:j="jelly:core" xmlns:sql="jelly:sql">

  -  <sql:setDataSource url="${databaseUrl}" driver="${databaseDriver}" user="${databaseUser}"/>
  -
  -  <sql:query var="results">
  -  	select * from <j:expr value="${databaseTable}"/>
  -  </sql:query>
  -
  -  <dataSet>
  -
  -  <j:forEach items="${results.rowsByIndex}" var="row">
  -	<row>
  -	  <j:forEach var="columnName" items="${results.columnNames}" indexVar="i">
  -		<field column="${columnName}"><j:expr value="${row[i]}"/></field>								
  -	  </j:forEach>
  -	</row>
  -  </j:forEach>		  	    
  -
  -  </dataSet>
  -  
  -</j:jelly>

  +<?xml version="1.0"?>
  +
  +<j:jelly xmlns:j="jelly:core" xmlns:sql="jelly:sql">
  +
  +  <sql:setDataSource url="${databaseUrl}" driver="${databaseDriver}" user="${databaseUser}"/>
  +
  +  <sql:query var="results">
  +      select * from <j:expr value="${databaseTable}"/>
  +  </sql:query>
  +
  +  <dataSet>
  +
  +    <j:forEach items="${results.rowsByIndex}" var="row">
  +      <row>
  +        <j:forEach var="columnName" items="${results.columnNames}" indexVar="i">
  +          <field column="${columnName}"><j:expr value="${row[i]}"/></field>                                
  +        </j:forEach>
  +      </row>
  +    </j:forEach>                  
  +
  +  </dataSet>
  +
  +</j:jelly>
  +
  +
  
  
  
  1.3       +28 -26    jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/sql/example2.jelly
  
  Index: example2.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/sql/example2.jelly,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- example2.jelly	20 May 2002 16:39:11 -0000	1.2
  +++ example2.jelly	3 Jun 2002 05:14:30 -0000	1.3
  @@ -1,26 +1,28 @@
  -<?xml version="1.0"?>
  -<j:jelly xmlns:j="jelly:core" xmlns:sql="jelly:sql">

  -  <sql:setDataSource var="db" url="${databaseUrl}" driver="${databaseDriver}" user="${databaseUser}"/>
  -
  -  <sql:query var="results" dataSource="${db}">
  -  	select * from <j:expr value="${databaseTable}"/>
  -  </sql:query>
  -
  -  <dataSet>
  -
  -
  -  <j:forEach var="columnName" items="${results.columnNames}" indexVar="i">
  -    <column><j:expr value="${columnName}"/></column>								
  -  </j:forEach>
  -  <j:forEach items="${results.rowsByIndex}" var="row">
  -	<row>
  -	  <j:forEach var="field" items="${row}">
  -		<field><j:expr value="${field}"/></field>								
  -	  </j:forEach>
  -	</row>
  -  </j:forEach>		  	    
  -
  -
  -  </dataSet>
  -  
  -</j:jelly>

  +<?xml version="1.0"?>
  +
  +<j:jelly xmlns:j="jelly:core" xmlns:sql="jelly:sql">
  +
  +  <sql:setDataSource var="db" url="${databaseUrl}" driver="${databaseDriver}" user="${databaseUser}"/>
  +
  +  <sql:query var="results" dataSource="${db}">
  +      select * from <j:expr value="${databaseTable}"/>
  +  </sql:query>
  +
  +  <dataSet>
  +
  +    <j:forEach var="columnName" items="${results.columnNames}" indexVar="i">
  +      <column><j:expr value="${columnName}"/></column>                                
  +    </j:forEach>
  +
  +    <j:forEach items="${results.rowsByIndex}" var="row">
  +      <row>
  +        <j:forEach var="field" items="${row}">
  +          <field><j:expr value="${field}"/></field>                                
  +        </j:forEach>
  +      </row>
  +    </j:forEach>                  
  +  </dataSet>
  +
  +</j:jelly>
  +
  +
  
  
  
  1.2       +17 -15    jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/sql/testSql.jelly
  
  Index: testSql.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/sql/testSql.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- testSql.jelly	20 May 2002 16:39:11 -0000	1.1
  +++ testSql.jelly	3 Jun 2002 05:14:30 -0000	1.2
  @@ -1,15 +1,17 @@
  -<?xml version="1.0"?>
  -<j:jelly xmlns:j="jelly:core" xmlns:sql="jelly:sql">

  -  <sql:setDataSource var="db" url="${databaseUrl}" driver="${databaseDriver}" user="${databaseUser}"/>
  -
  -  <sql:query var="results" dataSource="${db}">
  -  	select * from <j:expr value="${databaseTable}"/>
  -  </sql:query>
  -
  -  <dataSet>
  -
  -  <size><j:expr value="${results.rowCount}"/></size>
  -
  -  </dataSet>
  -  
  -</j:jelly>

  +<?xml version="1.0"?>
  +
  +<j:jelly xmlns:j="jelly:core" xmlns:sql="jelly:sql">
  +
  +  <sql:setDataSource var="db" url="${databaseUrl}" driver="${databaseDriver}" user="${databaseUser}"/>
  +
  +  <sql:query var="results" dataSource="${db}">
  +      select * from <j:expr value="${databaseTable}"/>
  +  </sql:query>
  +
  +  <dataSet>
  +    <size><j:expr value="${results.rowCount}"/></size>
  +  </dataSet>
  +
  +</j:jelly>
  +
  +
  
  
  
  1.3       +16 -10    jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/xml/example.jelly
  
  Index: example.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/xml/example.jelly,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- example.jelly	25 May 2002 18:27:22 -0000	1.2
  +++ example.jelly	3 Jun 2002 05:14:30 -0000	1.3
  @@ -1,10 +1,16 @@
  -<?xml version="1.0"?>
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml">
  -
  <x:parse var="doc">
  -    <html>
  -      <title>It works!</title>
  -      <body>
  -      </body>
  -    </html>
  -  </x:parse>

  -  <x:expr select="$doc/html/title"/>

  -</j:jelly>

  +<?xml version="1.0"?>
  +<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml">
  +
  +  <x:parse var="doc">
  +    <html>
  +      <title>It works!</title>
  +      <body>
  +      </body>
  +    </html>
  +  </x:parse>
  +
  +  <x:expr select="$doc/html/title"/>
  +
  +</j:jelly>
  +
  +
  
  
  
  1.2       +40 -2     jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/xml/testForEach.jelly
  
  Index: testForEach.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/xml/testForEach.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- testForEach.jelly	20 May 2002 10:09:28 -0000	1.1
  +++ testForEach.jelly	3 Jun 2002 05:14:30 -0000	1.2
  @@ -1,2 +1,40 @@
  -<?xml version="1.0"?>
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml">

<testcase>

  <x:parse var="doc">
  -    <a>
	  <b v="1"/>
	  <b v="2"/>
	  <b v="3"/>
	</a>
  </x:parse>

  <j:set var="i" value="0"/>
  <j:set var="i2" value="0"/>
	
  <x:forEach select="$doc/a/b" var="x">
	<x:set var="i2" select="$i2 + number($x/@v)"/>
  </x:forEach>
	
  <x:forEach select="$doc/a">
  	<x:forEach select="b">
	  <x:set var="i" select="$i + @v"/>
	</x:forEach>
  </x:forEach>
  
  <x:if select="$i2 != 6.0">  		
  	<fail>The i2 should be 6! but the value is <x:expr select="$i2"/></fail>
  </x:if>
  
  <x:if select="$i != 6.0">  		
  	<fail>The i should be 6! but the value is <x:expr select="$i"/></fail>
  </x:if>
  
</testcase>

</j:jelly>

  +<?xml version="1.0"?>
  +<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml">
  +
  +<testcase>
  +
  +  <x:parse var="doc">
  +
  +    <a>
  +      <b v="1"/>
  +      <b v="2"/>
  +      <b v="3"/>
  +    </a>
  +  </x:parse>
  +
  +  <j:set var="i" value="0"/>
  +  <j:set var="i2" value="0"/>
  +    
  +  <x:forEach select="$doc/a/b" var="x">
  +    <x:set var="i2" select="$i2 + number($x/@v)"/>
  +  </x:forEach>
  +    
  +  <x:forEach select="$doc/a">
  +      <x:forEach select="b">
  +      <x:set var="i" select="$i + @v"/>
  +    </x:forEach>
  +  </x:forEach>
  +  
  +  <x:if select="$i2 != 6.0">          
  +      <fail>The i2 should be 6! but the value is <x:expr select="$i2"/></fail>
  +  </x:if>
  +  
  +  <x:if select="$i != 6.0">          
  +      <fail>The i should be 6! but the value is <x:expr select="$i"/></fail>
  +  </x:if>
  +  
  +</testcase>
  +
  +</j:jelly>
  +
  +
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>