cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Expression languages (was Re: [RT] StringTemplate: The answer to our templating needs?)
Date Fri, 29 Oct 2004 08:43:31 GMT
Carsten Ziegeler wrote:

>Sylvain Wallez wrote:
>
>  
>
>>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]
>>
>>    
>>
>Hmm, one of the things I really don't like with JXTG is that you
>have to different expression languages. You never know which to
>use and some things work only with one specific language.
>And for me this comes near to FS :)
>  
>

Agree, but considering the wide variety of applications contexts where 
Cocoon is used, I don't think there can be a single "one-size-fits-all" 
language.

There are also a number of places in Cocoon where we need to evaluate 
expressions: templates, sitemap, form validators, form bindings, etc, 
which are currently implemented separately with different syntaxes. We 
need a common expression evaluation component.

>So, let's decide on one language that we think is the best, but
>let's provide a hook so others can plugin their language if *they*
>want to.
>  
>

That's exactly what I suggest above: we choose a standard default 
language, but open the possibility to plug in new ones. XPath is a 
must-have, Jexl and IM have very valid use cases which IMO justify them 
to be provided by Cocoon. Other languages are just a possibility that we 
offer _if_ people want to add their own language.

Sylvain

-- 
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