jon 01/06/19 18:28:41
Modified: docs user-guide.html vtl-reference-guide.html
xdocs user-guide.xml vtl-reference-guide.xml
Log:
documentation clarification
removed bogus <a name's>
Revision Changes Path
1.42 +64 -0 jakarta-velocity/docs/user-guide.html
Index: user-guide.html
===================================================================
RCS file: /home/cvs/jakarta-velocity/docs/user-guide.html,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- user-guide.html 2001/06/18 13:10:20 1.41
+++ user-guide.html 2001/06/20 01:28:38 1.42
@@ -1900,6 +1900,70 @@
</tr>
</table>
</div>
+ <p>
+ Velocity provides an easy way to get the loop counter so that you
+ can do something like the following:
+ </p>
+ <div align="left">
+ <table cellspacing="4" cellpadding="0" border="0">
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#ffffff"><pre>
+<table>
+#foreach( $customer in $customerList )
+
<tr><td>$velocityCount</td><td>$customer.Name</td></tr>
+#end
+</table>
+</pre></td>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ </table>
+ </div>
+ <p>
+ The default name for the loop counter variable reference, which is
+ specified in the velocity.properties file, is $velocityCount. By
+ default the counter starts at 1, but this can be set to either 0 or
+ 1 in the <code>velocity.properties</code> file. Here's what the loop
+ counter properties section of the <code>velocity.properties</code>
+ file appears:
+ </p>
+ <div align="left">
+ <table cellspacing="4" cellpadding="0" border="0">
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#ffffff"><pre>
+# Default name of the loop counter
+# variable refernce.
+counter.name = velocityCount
+
+# Default starting value of the loop
+# counter variable reference.
+counter.initial.value = 1
+</pre></td>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ </table>
+ </div>
</blockquote>
</p>
</td></tr>
1.33 +65 -14 jakarta-velocity/docs/vtl-reference-guide.html
Index: vtl-reference-guide.html
===================================================================
RCS file: /home/cvs/jakarta-velocity/docs/vtl-reference-guide.html,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- vtl-reference-guide.html 2001/05/30 02:12:14 1.32
+++ vtl-reference-guide.html 2001/06/20 01:28:39 1.33
@@ -131,8 +131,7 @@
<tr><td><br/></td></tr>
<tr><td>
<blockquote>
- <a name="variables" />
- <table border="0"
cellspacing="0" cellpadding="2" width="100%">
+ <table border="0" cellspacing="0"
cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="Variables"><strong>Variables</strong></a>
@@ -162,7 +161,6 @@
</td></tr>
<tr><td><br/></td></tr>
</table>
- <a name="properties" />
<table border="0"
cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
@@ -194,7 +192,6 @@
</td></tr>
<tr><td><br/></td></tr>
</table>
- <a name="methods" />
<table border="0"
cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
@@ -252,8 +249,7 @@
<tr><td><br/></td></tr>
<tr><td>
<blockquote>
- <a name="set" />
- <table border="0"
cellspacing="0" cellpadding="2" width="100%">
+ <table border="0" cellspacing="0"
cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="#set - Establishes the value of a reference"><strong>#set -
Establishes the value of a reference</strong></a>
@@ -306,11 +302,10 @@
</td></tr>
<tr><td><br/></td></tr>
</table>
- <a name="ifelse" />
<table border="0"
cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
- <a name="#if / #elseif / #else - output conditional on truth of
statements"><strong>#if / #elseif / #else - output conditional on truth of
statements</strong></a>
+ <a name="#if / #elseif / #else - output conditional on truth of
statements"><strong>#if / #elseif / #else - output conditional on truth of
statements</strong></a>
</font>
</td></tr>
<tr><td><br/></td></tr>
@@ -349,7 +344,6 @@
</td></tr>
<tr><td><br/></td></tr>
</table>
- <a name="foreach" />
<table border="0"
cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
@@ -444,7 +438,6 @@
</td></tr>
<tr><td><br/></td></tr>
</table>
- <a name="include" />
<table border="0"
cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
@@ -474,7 +467,6 @@
</td></tr>
<tr><td><br/></td></tr>
</table>
- <a name="parse" />
<table border="0"
cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
@@ -509,7 +501,6 @@
</td></tr>
<tr><td><br/></td></tr>
</table>
- <a name="stop" />
<table border="0"
cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
@@ -536,7 +527,6 @@
</td></tr>
<tr><td><br/></td></tr>
</table>
- <a name="velocimacro" />
<table border="0"
cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
@@ -592,11 +582,72 @@
</p>
<ol>
<li><i>Template library:</i> can be either VMs pre-packaged with
- Velocity or custom-made, user-defined, site-specific VMs; available
from any template</li>
+ Velocity or custom-made, user-defined, site-specific VMs;
+ available from any template</li>
<li><i>Inline:</i> found in regular templates, only usable when
<em>velocimacro.permissions.allowInline=true</em> in
<code>velocity.properties</code>.</li>
</ol>
+ </blockquote>
+ </td></tr>
+ <tr><td><br/></td></tr>
+ </table>
+ </blockquote>
+ </p>
+ </td></tr>
+ <tr><td><br/></td></tr>
+ </table>
+ <table border="0" cellspacing="0"
cellpadding="2" width="100%">
+ <tr><td bgcolor="#525D76">
+ <font color="#ffffff" face="arial,helvetica,sanserif">
+ <a name="Comments"><strong>Comments</strong></a>
+ </font>
+ </td></tr>
+ <tr><td><br/></td></tr>
+ <tr><td>
+ <blockquote>
+ <p>
+ Comments are not rendered at runtime.
+ </p>
+ <table border="0"
cellspacing="0" cellpadding="2" width="100%">
+ <tr><td bgcolor="#828DA6">
+ <font color="#ffffff" face="arial,helvetica,sanserif">
+ <a name="Single Line"><strong>Single Line</strong></a>
+ </font>
+ </td></tr>
+ <tr><td><br/></td></tr>
+ <tr><td>
+ <blockquote>
+ <p>
+ Example:
+ </p>
+ <p>
+ <strong>## This is a comment.</strong>
+ </p>
+ </blockquote>
+ </td></tr>
+ <tr><td><br/></td></tr>
+ </table>
+ <table border="0"
cellspacing="0" cellpadding="2" width="100%">
+ <tr><td bgcolor="#828DA6">
+ <font color="#ffffff" face="arial,helvetica,sanserif">
+ <a name="Multi Line"><strong>Multi Line</strong></a>
+ </font>
+ </td></tr>
+ <tr><td><br/></td></tr>
+ <tr><td>
+ <blockquote>
+ <p>
+ Example:
+ </p>
+ <p>
+ <strong>
+ #*<br />
+ This is a multiline comment.<br />
+ This is the second line<br />
+ *#
+ </strong>
+ </p>
</blockquote>
</td></tr>
<tr><td><br/></td></tr>
1.45 +32 -0 jakarta-velocity/xdocs/user-guide.xml
Index: user-guide.xml
===================================================================
RCS file: /home/cvs/jakarta-velocity/xdocs/user-guide.xml,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- user-guide.xml 2001/06/18 13:10:16 1.44
+++ user-guide.xml 2001/06/20 01:28:40 1.45
@@ -1087,6 +1087,38 @@
</ul>
]]></source>
+ <p>
+ Velocity provides an easy way to get the loop counter so that you
+ can do something like the following:
+ </p>
+
+<source><![CDATA[
+<table>
+#foreach( $customer in $customerList )
+ <tr><td>$velocityCount</td><td>$customer.Name</td></tr>
+#end
+</table>
+]]></source>
+
+ <p>
+ The default name for the loop counter variable reference, which is
+ specified in the velocity.properties file, is $velocityCount. By
+ default the counter starts at 1, but this can be set to either 0 or
+ 1 in the <code>velocity.properties</code> file. Here's what the loop
+ counter properties section of the <code>velocity.properties</code>
+ file appears:
+ </p>
+
+<source><![CDATA[
+# Default name of the loop counter
+# variable refernce.
+counter.name = velocityCount
+
+# Default starting value of the loop
+# counter variable reference.
+counter.initial.value = 1
+]]></source>
+
</section>
<section name="Include">
1.28 +46 -15 jakarta-velocity/xdocs/vtl-reference-guide.xml
Index: vtl-reference-guide.xml
===================================================================
RCS file: /home/cvs/jakarta-velocity/xdocs/vtl-reference-guide.xml,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- vtl-reference-guide.xml 2001/04/24 22:35:35 1.27
+++ vtl-reference-guide.xml 2001/06/20 01:28:41 1.28
@@ -10,7 +10,7 @@
<body>
-<a name="about"/><section name="About this Guide">
+<section name="About this Guide">
<p>
This guide is the reference for the Velocity Template Language
(VTL). For more information, please also refer to the <a
@@ -19,8 +19,8 @@
</section>
-<a name="references" /><section name="References">
- <a name="variables" /><subsection name="Variables">
+<section name="References">
+ <subsection name="Variables">
<p>
Notation:
</p>
@@ -43,7 +43,7 @@
</ul>
</subsection>
- <a name="properties" /><subsection name="Properties">
+ <subsection name="Properties">
<p>
Notation:
</p>
@@ -67,7 +67,7 @@
</ul>
</subsection>
- <a name="methods" /><subsection name="Methods">
+ <subsection name="Methods">
<p>
Notation:
</p>
@@ -106,8 +106,8 @@
</section>
-<a name="directives" /><section name="Directives">
- <a name="set" /><subsection name="#set - Establishes the value of a reference">
+<section name="Directives">
+ <subsection name="#set - Establishes the value of a reference">
<p>
Format:
</p>
@@ -157,8 +157,8 @@
</ul>
</subsection>
- <a name="ifelse" /><subsection name="#if / #elseif / #else - output
- conditional on truth of statements">
+ <subsection name="#if / #elseif / #else - output conditional on truth
+ of statements">
<p>
Format:
</p>
@@ -195,7 +195,7 @@
</ul>
</subsection>
- <a name="foreach" /><subsection name="#foreach - Loops through a list of
objects">
+ <subsection name="#foreach - Loops through a list of objects">
<p>
Format:
</p>
@@ -251,7 +251,6 @@
</subsection>
- <a name="include" />
<subsection name="#include - Renders local file(s) that are not
parsed by Velocity">
<p>
@@ -276,7 +275,6 @@
</ul>
</subsection>
- <a name="parse" />
<subsection name="#parse - Renders a local template that is parsed by
Velocity">
<p>
@@ -307,7 +305,6 @@
</p>
</subsection>
- <a name="stop" />
<subsection name="#stop - Stops the template engine">
<p>
Format:
@@ -327,7 +324,6 @@
</p>
</subsection>
- <a name="velocimacro" />
<subsection name="#macro - Allows users to define a Velocimacro (VM),
a repeated segment of a VTL template, as required">
<p>
@@ -364,14 +360,49 @@
<ol>
<li><i>Template library:</i> can be either VMs pre-packaged with
- Velocity or custom-made, user-defined, site-specific VMs; available
from any template</li>
+ Velocity or custom-made, user-defined, site-specific VMs;
+ available from any template</li>
<li><i>Inline:</i> found in regular templates, only usable when
<em>velocimacro.permissions.allowInline=true</em> in
<code>velocity.properties</code>.</li>
</ol>
</subsection>
+
</section>
+
+<section name="Comments">
+ <p>
+ Comments are not rendered at runtime.
+ </p>
+
+ <subsection name="Single Line">
+ <p>
+ Example:
+ </p>
+
+ <p>
+ <strong>## This is a comment.</strong>
+ </p>
+
+ </subsection>
+ <subsection name="Multi Line">
+ <p>
+ Example:
+ </p>
+
+ <p>
+ <strong>
+ #*<br/>
+ This is a multiline comment.<br/>
+ This is the second line<br/>
+ *#
+ </strong>
+ </p>
+
+ </subsection>
+</section>
+
</body>
</document>