cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: [RT] StringTemplate: The answer to our templating needs?
Date Fri, 29 Oct 2004 07:58:17 GMT
Reinhard Poetz wrote:

> Tony Collen wrote:
>
>>
>> Do we need a new, (standardized?) or possibly even *gasp* better 
>> templating system for Cocoon?  This is where I encourage people to 
>> dive in and give their own [RT]s and thoughts on the issue.
>
>
>
> First, thank you for the pointer. Interesting stuff.
>
> But first, we should agree on our needs and then we should choose a 
> technology.
> IMO less is more - the templating engine should really focus on 
> presenting data. I see following needs:
>
>  - really powerful query language to access
>    * all kind of objects
>    * incl. passed DOM trees
>  - control structures like for/each, if, choose
>  - call methods on passed objects
>  - stream objects (DOM, XMLizable, ...?)
>  - and probably a way to define macros (see cForm macros)


- Ability to directly produce SAX events, for efficiency reasons.


> Don't know whether we need the possibilty to use xPath expressions on 
> passed objects. On one hand it would be helpful, on the other we 
> probably end again with two different syntax.


XPath is a must-have when you deal with XML documents while Jexl is 
mostly useless in that case but is straightforward when you deal with 
JavaBeans. I also agree that understanding the difference between 
"${continuation.id}" and "#{$continuation/id}" is less than evident.

So what about a unified syntax for expansion tokens, within which 
different languages could be used. Example:
- ${continuation.id} // Jexl, default syntax
- ${xpath:$continuation/id} // xpath
- ${im:defaults:skin} // input-module
- ${ognl:$continuation.id} // OGNL [1]

Sylvain

[1] http://www.ognl.org/

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Mime
View raw message