You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by jo...@apache.org on 2001/03/19 04:24:06 UTC

cvs commit: jakarta-velocity/xdocs vtl-reference-guide.xml

jon         01/03/18 19:24:06

  Modified:    docs     vtl-reference-guide.html
               xdocs    vtl-reference-guide.xml
  Log:
  more line wrapping and various cleanup
  
  removed part about #stop being used like a #break (my mistake)
  
  Revision  Changes    Path
  1.24      +59 -56    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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- vtl-reference-guide.html	2001/03/15 07:10:48	1.23
  +++ vtl-reference-guide.html	2001/03/19 03:24:06	1.24
  @@ -107,9 +107,8 @@
         <tr><td>
           <blockquote>
                                       <p>
  -    This guide is the reference for
  -    the Velocity Template Language (VTL). For more information,
  -    please also refer to the <a href="user-guide.html">Velocity User Guide</a>.
  +    This guide is the reference for the Velocity Template Language
  +    (VTL). For more information, please also refer to the <a href="user-guide.html">Velocity User Guide</a>.
   </p>
                               </blockquote>
         </td></tr>
  @@ -206,7 +205,8 @@
                                                   <ul>
         <li>Regular Notation: $customer.getAddress()</li>
         <li>Formal Notation: ${purchase.getTotal()}</li>
  -      <li>Regular Notation with Parameter List: $page.setTitle( "My Home Page" )</li>
  +      <li>Regular Notation with Parameter List: $page.setTitle( "My Home
  +      Page" )</li>
       </ul>
                               </blockquote>
         </td></tr>
  @@ -249,10 +249,11 @@
       Usage:
       </p>
                                                   <ul>
  -    <li><em>$ref</em> - The LHS of the assignment must be a variable reference or
  -    a property reference.</li>
  -    <li><em>arg</em> - The RHS of the assignment, <em>arg</em> is parsed if
  -    enclosed in double quotes, and not parsed if enclosed in single quotes.</li>
  +    <li><em>$ref</em> - The LHS of the assignment must be a variable
  +    reference or a property reference.</li>
  +    <li><em>arg</em> - The RHS of the assignment, <em>arg</em> is parsed
  +    if enclosed in double quotes, and not parsed if enclosed in single
  +    quotes.</li>
       </ul>
                                                   <p>
       Examples:
  @@ -260,8 +261,10 @@
                                                   <ul>
         <li>Variable reference: #set( $monkey = "bill" )</li>
         <li>String literal: #set( $monkey.Friend = "monica" )</li>
  -      <li>Property reference: #set( $monkey.Blame = $whitehouse.Leak )</li>
  -      <li>Method reference: #set( $monkey.Plan = $spindoctor.weave($web) )</li>
  +      <li>Property reference: #set( $monkey.Blame = $whitehouse.Leak
  +      )</li>
  +      <li>Method reference: #set( $monkey.Plan = $spindoctor.weave($web)
  +      )</li>
         <li>Number literal: #set( $monkey.Number = 123 )</li>
         <li>Object array: #set( $monkey.Say = ["Not", $my, "fault"] )</li>
       </ul>
  @@ -281,7 +284,7 @@
                                                       <table border="0" cellspacing="0" cellpadding="2" width="100%">
         <tr><td bgcolor="#828DA6">
           <font color="#ffffff" face="arial,helvetica,sanserif">
  -          <strong>#if / #elseif / #else - output conditional on truth of statements</strong>
  +          <strong>#if / #elseif / #else - output conditional on truth                      of statements</strong>
           </font>
         </td></tr>
         <tr><td>
  @@ -299,8 +302,8 @@
       Usage:
       </p>
                                                   <ul>
  -    <li><em>condition</em> - If a boolean, considered true if it has a true false;
  -    if not a boolean, considered true if not null.</li>
  +    <li><em>condition</em> - If a boolean, considered true if it has a
  +    true false; if not a boolean, considered true if not null.</li>
       <li><em>output</em> - May contain VTL.</li>
       </ul>
                                                   <p>
  @@ -338,14 +341,14 @@
       </p>
                                                   <ul>
       <li><em>$ref1</em> - The first variable reference is the item.</li>
  -    <li><em>$ref2</em> - The second variable reference is the list that holds the
  -    items.</li>
  -    <li><em>statement</em> - What is output each time Velocity finds a valid item
  -    ($ref1) in the list ($ref2).</li>
  +    <li><em>$ref2</em> - The second variable reference is the list that
  +    holds the items.</li>
  +    <li><em>statement</em> - What is output each time Velocity finds a
  +    valid item ($ref1) in the list ($ref2).</li>
       </ul>
                                                   <p>
  -    Velocity provides an easy way to get the loop counter so that you can do
  -    something like the following:
  +    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">
  @@ -357,12 +360,12 @@
       <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>
  -    &lt;table&gt;
  -    #foreach( $customer in $customerList )
  -        &lt;tr&gt;&lt;td&gt;$velocityCounter&lt;/td&gt;&lt;td&gt;$customer.Name&lt;/td&gt;&lt;/tr&gt;
  -    #end
  -    &lt;/table&gt;
  -    </pre></td>
  +&lt;table&gt;
  +#foreach( $customer in $customerList )
  +    &lt;tr&gt;&lt;td&gt;$velocityCounter&lt;/td&gt;&lt;td&gt;$customer.Name&lt;/td&gt;&lt;/tr&gt;
  +#end
  +&lt;/table&gt;
  +</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>
  @@ -376,9 +379,9 @@
       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:
  +    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">
  @@ -390,14 +393,14 @@
       <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 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>
  +# 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>
  @@ -413,7 +416,7 @@
                                                       <table border="0" cellspacing="0" cellpadding="2" width="100%">
         <tr><td bgcolor="#828DA6">
           <font color="#ffffff" face="arial,helvetica,sanserif">
  -          <strong>#include - Renders local file(s) that are not parsed by Velocity</strong>
  +          <strong>#include - Renders local file(s) that are not                      parsed by Velocity</strong>
           </font>
         </td></tr>
         <tr><td>
  @@ -440,7 +443,7 @@
                                                       <table border="0" cellspacing="0" cellpadding="2" width="100%">
         <tr><td bgcolor="#828DA6">
           <font color="#ffffff" face="arial,helvetica,sanserif">
  -          <strong>#parse - Renders a local template that is parsed by Velocity</strong>
  +          <strong>#parse - Renders a local template that is parsed by                      Velocity</strong>
           </font>
         </td></tr>
         <tr><td>
  @@ -452,7 +455,7 @@
       <strong>#parse(</strong> arg <strong>)</strong>
       </p>
                                                   <ul>
  -    <li><em>arg</em> - Refers to a template under TEMPLATE_ROOT.</li>    
  +    <li><em>arg</em> - Refers to a template under TEMPLATE_ROOT.</li>
       </ul>
                                                   <p>
       Examples:
  @@ -487,10 +490,8 @@
       Usage:
       </p>
                                                   <p>
  -    This will stop execution of the current template. This can also be
  -    used in conjunction with the <strong>#foreach</strong> and
  -    <strong>#if</strong> directives to conditionally stop a loop from
  -    executing.
  +    This will stop execution of the current template. This is good for
  +    debugging a template.
       </p>
                               </blockquote>
         </td></tr>
  @@ -498,7 +499,7 @@
                                                       <table border="0" cellspacing="0" cellpadding="2" width="100%">
         <tr><td bgcolor="#828DA6">
           <font color="#ffffff" face="arial,helvetica,sanserif">
  -          <strong>#macro - Allows users to define a Velocimacro (VM), a repeated segment of a VTL template, as required</strong>
  +          <strong>#macro - Allows users to define a Velocimacro (VM),          a repeated segment of a VTL template, as required</strong>
           </font>
         </td></tr>
         <tr><td>
  @@ -511,15 +512,17 @@
       <strong>)</strong> [ VM VTL code... ] <strong>#end</strong>
       </p>
                                                   <ul>
  -    <li><em>vmname</em> - Name used to call the VM (<em>#vmname</em>)</li>
  -    <li><em>$arg1 $arg2 [ ... ]</em> - Arguments to the VM. There can be any number
  -    of argumentss, but the number used at invocation must match the number
  -    specified in the definition.</li>
  -    <li><em>[ VM VTL code... ]</em> - Any valid VTL code, anything you can put into
  -    a template, can be put into a VM.</li>
  +    <li><em>vmname</em> - Name used to call the VM
  +    (<em>#vmname</em>)</li>
  +    <li><em>$arg1 $arg2 [ ... ]</em> - Arguments to the VM. There can be
  +    any number of argumentss, but the number used at invocation must
  +    match the number specified in the definition.</li>
  +    <li><em>[ VM VTL code... ]</em> - Any valid VTL code, anything you
  +    can put into a template, can be put into a VM.</li>
       </ul>
                                                   <p>
  -    Once defined, the VM is used like any other VTL directive in a template.
  +    Once defined, the VM is used like any other VTL directive in a
  +    template.
       </p>
                                                       <div align="left">
       <table cellspacing="4" cellpadding="0" border="0">
  @@ -531,8 +534,8 @@
       <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>
  -    #vmname( $arg1 $arg2 )
  -    </pre></td>
  +#vmname( $arg1 $arg2 )
  +</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>
  @@ -547,12 +550,12 @@
       </p>
                                                   <ol>
       <li><i>Global library:</i> VMs pre-packaged with Velocity; available
  -        from any template</li>
  +    from any template</li>
       <li><i>Local library:</i> customized, user-defined, site-specific
  -        VMs; availabe from any template</li>
  +    VMs; availabe 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>
  +    <em>velocimacro.permissions.allowInline=true</em> in
  +    <code>velocity.properties</code>.</li>
       </ol>
                               </blockquote>
         </td></tr>
  
  
  
  1.24      +69 -71    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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- vtl-reference-guide.xml	2001/03/12 22:07:01	1.23
  +++ vtl-reference-guide.xml	2001/03/19 03:24:06	1.24
  @@ -13,9 +13,9 @@
   <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 href="user-guide.html">Velocity User Guide</a>.
  +    This guide is the reference for the Velocity Template Language
  +    (VTL). For more information, please also refer to the <a
  +    href="user-guide.html">Velocity User Guide</a>.
   </p>
   
   </section>
  @@ -91,7 +91,8 @@
       <ul>
         <li>Regular Notation: $customer.getAddress()</li>
         <li>Formal Notation: ${purchase.getTotal()}</li>
  -      <li>Regular Notation with Parameter List: $page.setTitle( "My Home Page" )</li>
  +      <li>Regular Notation with Parameter List: $page.setTitle( "My Home
  +      Page" )</li>
       </ul>
     </subsection>
     
  @@ -121,10 +122,11 @@
       </p>
   
       <ul>
  -    <li><em>$ref</em> - The LHS of the assignment must be a variable reference or
  -    a property reference.</li>
  -    <li><em>arg</em> - The RHS of the assignment, <em>arg</em> is parsed if
  -    enclosed in double quotes, and not parsed if enclosed in single quotes.</li>
  +    <li><em>$ref</em> - The LHS of the assignment must be a variable
  +    reference or a property reference.</li>
  +    <li><em>arg</em> - The RHS of the assignment, <em>arg</em> is parsed
  +    if enclosed in double quotes, and not parsed if enclosed in single
  +    quotes.</li>
       </ul>
   
       <p>
  @@ -134,8 +136,10 @@
       <ul>
         <li>Variable reference: #set( $monkey = "bill" )</li>
         <li>String literal: #set( $monkey.Friend = "monica" )</li>
  -      <li>Property reference: #set( $monkey.Blame = $whitehouse.Leak )</li>
  -      <li>Method reference: #set( $monkey.Plan = $spindoctor.weave($web) )</li>
  +      <li>Property reference: #set( $monkey.Blame = $whitehouse.Leak
  +      )</li>
  +      <li>Method reference: #set( $monkey.Plan = $spindoctor.weave($web)
  +      )</li>
         <li>Number literal: #set( $monkey.Number = 123 )</li>
         <li>Object array: #set( $monkey.Say = ["Not", $my, "fault"] )</li>
       </ul>
  @@ -153,7 +157,8 @@
       </ul>
     </subsection>
   
  -  <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>
  @@ -170,8 +175,8 @@
       </p>
   
       <ul>
  -    <li><em>condition</em> - If a boolean, considered true if it has a true false;
  -    if not a boolean, considered true if not null.</li>
  +    <li><em>condition</em> - If a boolean, considered true if it has a
  +    true false; if not a boolean, considered true if not null.</li>
       <li><em>output</em> - May contain VTL.</li>
       </ul>
       
  @@ -206,46 +211,48 @@
   
       <ul>
       <li><em>$ref1</em> - The first variable reference is the item.</li>
  -    <li><em>$ref2</em> - The second variable reference is the list that holds the
  -    items.</li>
  -    <li><em>statement</em> - What is output each time Velocity finds a valid item
  -    ($ref1) in the list ($ref2).</li>
  +    <li><em>$ref2</em> - The second variable reference is the list that
  +    holds the items.</li>
  +    <li><em>statement</em> - What is output each time Velocity finds a
  +    valid item ($ref1) in the list ($ref2).</li>
       </ul>
   
       <p>
  -    Velocity provides an easy way to get the loop counter so that you can do
  -    something like the following:
  +    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>$velocityCounter</td><td>$customer.Name</td></tr>
  -    #end
  -    </table>
  -    ]]></source>
  +<source><![CDATA[
  +<table>
  +#foreach( $customer in $customerList )
  +    <tr><td>$velocityCounter</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:
  +    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>
  +<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>
  +
     </subsection>
   
  -  <subsection name="#include - Renders local file(s) that are not parsed by Velocity">
  +  <subsection name="#include - Renders local file(s) that are not 
  +                    parsed by Velocity">
       <p>
       Format:
       </p>
  @@ -268,7 +275,8 @@
       </ul>
     </subsection>
   
  -  <subsection name="#parse - Renders a local template that is parsed by Velocity">
  +  <subsection name="#parse - Renders a local template that is parsed by 
  +                    Velocity">
       <p>
       Format:
       </p>
  @@ -278,7 +286,7 @@
       </p>
       
       <ul>
  -    <li><em>arg</em> - Refers to a template under TEMPLATE_ROOT.</li>    
  +    <li><em>arg</em> - Refers to a template under TEMPLATE_ROOT.</li>
       </ul>
   
       <p>
  @@ -311,14 +319,13 @@
       </p>
   
       <p>
  -    This will stop execution of the current template. This can also be
  -    used in conjunction with the <strong>#foreach</strong> and
  -    <strong>#if</strong> directives to conditionally stop a loop from
  -    executing.
  +    This will stop execution of the current template. This is good for
  +    debugging a template.
       </p>
     </subsection>
   
  -  <subsection name="#macro - Allows users to define a Velocimacro (VM), a repeated segment of a VTL template, as required">
  +  <subsection name="#macro - Allows users to define a Velocimacro (VM), 
  +        a repeated segment of a VTL template, as required">
       <p>
       Format:
       </p>
  @@ -329,21 +336,23 @@
       </p>
       
       <ul>
  -    <li><em>vmname</em> - Name used to call the VM (<em>#vmname</em>)</li>
  -    <li><em>$arg1 $arg2 [ ... ]</em> - Arguments to the VM. There can be any number
  -    of argumentss, but the number used at invocation must match the number
  -    specified in the definition.</li>
  -    <li><em>[ VM VTL code... ]</em> - Any valid VTL code, anything you can put into
  -    a template, can be put into a VM.</li>
  +    <li><em>vmname</em> - Name used to call the VM
  +    (<em>#vmname</em>)</li>
  +    <li><em>$arg1 $arg2 [ ... ]</em> - Arguments to the VM. There can be
  +    any number of argumentss, but the number used at invocation must
  +    match the number specified in the definition.</li>
  +    <li><em>[ VM VTL code... ]</em> - Any valid VTL code, anything you
  +    can put into a template, can be put into a VM.</li>
       </ul>
       
       <p>
  -    Once defined, the VM is used like any other VTL directive in a template.
  +    Once defined, the VM is used like any other VTL directive in a
  +    template.
       </p>
   
  -    <source><![CDATA[
  -    #vmname( $arg1 $arg2 )
  -    ]]></source>
  +<source><![CDATA[
  +#vmname( $arg1 $arg2 )
  +]]></source>
   
       <p>
       VMs can be defined in one of three places:
  @@ -351,26 +360,15 @@
   
       <ol>
       <li><i>Global library:</i> VMs pre-packaged with Velocity; available
  -        from any template</li>
  +    from any template</li>
       <li><i>Local library:</i> customized, user-defined, site-specific
  -        VMs; availabe from any template</li>
  +    VMs; availabe 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>
  +    <em>velocimacro.permissions.allowInline=true</em> in
  +    <code>velocity.properties</code>.</li>
       </ol>
     </subsection>
   
   </section>
   </body>
   </document>
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -
  -