You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Thomas Ã…hlen <th...@obidobi.net> on 2001/11/25 06:04:29 UTC

Follow up: Extended functionality

> >> I am having some problems to manage my templates since I need to parse
> one
> >> template multiple times.
> >
> >Yuck!  :)

I was previously coding my serverside applications in Perl but have since a
year back converted to Java and Servlet programming. My multi pass parsing
in my perl apps was very simply solved with the CPAN package Template
Toolkit.

In my eyes Template Toolkit is one of the best Template engines out there.
To bad that there only is a perl version, I have actually considered makeing
a java version. Today almost all my needs are covered by Velocity :) so I
rather see Velocity mature to a more powerfull engine than trying to
implement Template Toolkit in java.

Homepage of the perl Template Toolkit(TT) with excellent documentation
http://www.template-toolkit.org/

A must read for all template developers ;). You might get inspired by some
funtionallity.

You might ask how TT solved my multi pass parsing?
In TT all directives have a start and a stop delimiter, called tag style. So
when parsing static content I could tell it to use [* ... *] tags and [% ...
%] in the dynamic parse. So its kind of like having 2 different parsers. As
I see it the possibility for different tag styles is very powerfull and
useful.

How could Velocity solve this and still be able to keep current style?
Add the possibility to have multiple grammar classes and add a property:
runtime.grammar.class = org.apache.velocity.runtime.grammar.Grammar
If you are able to implement the possibility to use multiple grammars in
Velocity I am more than willing to implement a Template Toolkit kind of
grammar.

Thomas


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