You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by jc...@locus.apache.org on 2000/12/13 04:59:15 UTC

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

jcastura    00/12/12 19:59:15

  Modified:    xdocs    user-guide.xml vtl-reference-guide.xml anakia.xml
  Log:
  edits
  
  Revision  Changes    Path
  1.23      +46 -17    jakarta-velocity/xdocs/user-guide.xml
  
  Index: user-guide.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/xdocs/user-guide.xml,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- user-guide.xml	2000/12/13 01:46:24	1.22
  +++ user-guide.xml	2000/12/13 03:59:14	1.23
  @@ -508,7 +508,7 @@
       constructing a sentence on the fly where <variable>$vice</variable> was to be
       used as the base word in the noun of a sentence. The goal is to allow someone 
       to choose the base word and produce one of the two following results: "Jack is 
  -    a pyromaniac." or "Jack is a kleptomaniac.". Using the shorthand notation would
  +    a pyromaniac." or "Jack is a kleptomaniac.". Using the shorthand notation
       would be inadequate for this task. Consider the following example: 
    </p>
    
  @@ -541,7 +541,7 @@
    <p>
       <strong>Quiet Reference Notation</strong>
       <br/>
  -    When Velocity encounters a reference that is undefined,
  +    When Velocity encounters an undefined reference,
       its normal behavior is to output the image
       of the reference. For example, suppose the following
       reference appears as part of a VTL template.
  @@ -1038,7 +1038,7 @@
       <vtldirective>#parse (foo.vm)</vtldirective>, nor can it reference any other template which contains the 
       statement <vtldirective>#parse (foo.vm)</vtldirective>. VTL templates can have <vtldirective>#parse</vtldirective> 
       statements referring to templates that in turn have <vtldirective>#parse</vtldirective> statements. By default 
  -    set to 10, the <vtl>parse_directive.maxdepth</vtl> line of the <filename>.properties</filename> allows users 
  +    set to 10, the <vtl>parse_directive.maxdepth</vtl> line of the <filename>velocity.properties</filename> allows users 
       to customize maximum number of <vtldirective>#parse</vtldirective> referrals that can occur from a single 
       template. (Note: If the <vtl>parse_directive.maxdepth</vtl> property is absent from the 
       <filename>velocity.properties</filename> file, Velocity will set this default to 20.)  
  @@ -1152,7 +1152,7 @@
   
       <p>
       Velocimacros can be defined <em>inline</em> in a Velocity template, meaning that it is 
  -    unavailable to other Velocity templates on the same web site. Definig a Velocimacro
  +    unavailable to other Velocity templates on the same web site. Defining a Velocimacro
       such that it can be shared by all templates has obvious advantages: it reduces the 
       need to redefine the Velocimacro on numerous templates, saving work and reducing the 
       chance of error, and ensures that a single change to a macro  
  @@ -1172,7 +1172,7 @@
       </p>
       
       <p>
  -    <code>velocimacro.library.local</code> - Addin this line to the <filename>velocity.properties</filename> 
  +    <code>velocimacro.library.local</code> - Adding this line to the <filename>velocity.properties</filename> 
       file allows the template designer to define a local Velocimacros
       template library. Velocity users can use the local template library to define their 
       own Velocimacros and keep these in a file other than the global defaults.
  @@ -1253,38 +1253,67 @@
   
     <p>
     Extra care should be taken when escaping VTL directives that contain multiple script 
  -  elements in a single directive (such as in an if-else-end statements).
  +  elements in a single directive (such as in an if-else-end statements). 
  +  Here is a typical VTL if-statement:  
     </p>
   
     <p>
     <source><![CDATA[
  -  ## Here is a typical VTL if-statement:  
     #if( $jazz )
     Vyacheslav Ganelin
     #end
  -  ## If $jazz is true / not null, this renders as: Vyacheslav Ganelin
  -  ## If $jazz is false / null, there is no output
  +  ]]></source>
  +  </p>
  +
  +  <p>
  +  If <variable>$jazz</variable> is true, the output is "Vyacheslav 
  +  Ganelin"; if <variable>$jazz</variable> is false, there is no 
  +  output. Escaping script elements alters the output. Consider the 
  +  following case:
  +  </p>
   
  -  ## Script elements can be escaped, as shown:
  +  <p>
  +  <source><![CDATA[
     \#if( $jazz ) 
     Vyacheslav Ganelin
     \#end
  -  ## This renders as: #if( $jazz ) Vyacheslav Ganelin #end
  +  ]]></source>
  +  </p>
   
  -  ## A backslash can precede script elements that are legitimately escaped:
  +  <p>  
  +  Whether <variable>$jazz</variable> is true or false, the output will be 
  +  "#if( $jazz ) Vyacheslav Ganelin #end"; in fact, because
  +  all script elements are escaped the truth of 
  +  <variable>$jazz</variable> is never checked. Suppose backslashes precede 
  +  script elements that are legitimately escaped:
  +  </p>
  +
  +  <p>
  +  <source><![CDATA[
     \\#if( $jazz ) 
     Vyacheslav Ganelin
     \\#end
  -  ## If $jazz is true / not null, this renders as: / Vyacheslav Ganelin /
  -  ## If $jazz is false / null, there is no output.
  +  ]]></source>
  +  </p>
  +
  +  <p>
  +  In this case, if <variable>$jazz</variable> is true, the output is 
  +  "/ Vyacheslav Ganelin /". If <variable>$jazz</variable> is false, 
  +  there is no output. Note that things start to break if script elements 
  +  are not properly escaped.
  +  </p>
   
  -  ## Things break if script elements are not properly escaped.
  +  <p>
  +  <source><![CDATA[
     \\\#if( $jazz )
     Vyacheslave Ganelin
     \\#end
  -  ## Here the #if is escaped, but there is an #end remaining.
  -  ## Having too many endings will cause a parsing error.
     ]]></source>
  +  </p>
  +
  +  <p>
  +  Here the <vtl>#if</vtl> is escaped, but there is an <vtl>#end</vtl>
  +  remaining; having too many endings will cause a parsing error.
     </p>
   
    </s1>
  
  
  
  1.15      +2 -2      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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- vtl-reference-guide.xml	2000/12/13 01:46:24	1.14
  +++ vtl-reference-guide.xml	2000/12/13 03:59:14	1.15
  @@ -86,7 +86,7 @@
       Methods are references that consist of a leading <vtl>$</vtl>
       character followed a VTL Identifier, followed
       by a VTL <em>Method Body</em>. A VTL Method Body
  -    consists of a VTL Identifier followed by an
  +    consists of a VTL Identifier followed by a
       left parenthesis character ("("), followed by an optional parameter
       list, followed by right parenthesis character (")").
       Examples of valid method references in the
  @@ -178,7 +178,7 @@
   </p>
   
   <p>
  -    <vtl>$ref</vtl> - The LHS of the assigment must be
  +    <vtl>$ref</vtl> - The LHS of the assignment must be
       a variable reference or a property reference. 
   </p>
   
  
  
  
  1.6       +1 -1      jakarta-velocity/xdocs/anakia.xml
  
  Index: anakia.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/xdocs/anakia.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- anakia.xml	2000/12/13 01:48:31	1.5
  +++ anakia.xml	2000/12/13 03:59:14	1.6
  @@ -36,7 +36,7 @@
       Anakia -- intended to replace Stylebook, which was 
       originally used to generate simple, static web sites in which all pages had 
       the same look and feel -- is great for documentation/project web sites, 
  -    such as the sites on jakarta.apache.org. As it is more targetted to a specific
  +    such as the sites on jakarta.apache.org. As it is more targeted to a specific
       purpose, it does not provide some of XSL's &quot;extra&quot; functionality.
   </p>
   <p>