Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 72772 invoked from network); 2 Nov 2004 14:32:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Nov 2004 14:32:21 -0000 Received: (qmail 32423 invoked by uid 500); 2 Nov 2004 14:32:02 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 32242 invoked by uid 500); 2 Nov 2004 14:32:00 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 32108 invoked by uid 99); 2 Nov 2004 14:31:59 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [130.237.222.202] (HELO smtp.nada.kth.se) (130.237.222.202) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 02 Nov 2004 06:31:54 -0800 Received: from [192.168.105.46] ([192.58.197.171]) (authenticated bits=0) by smtp.nada.kth.se (8.12.10/8.12.1) with ESMTP id iA2EVjBD001547 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 2 Nov 2004 15:31:50 +0100 (MET) Message-ID: <41879A4C.40809@nada.kth.se> Date: Tue, 02 Nov 2004 15:31:40 +0100 From: Daniel Fagerstrom User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: Expression languages (was Re: [RT] StringTemplate: The answer to our templating needs?) References: <418202B3.4030504@apache.org> In-Reply-To: <418202B3.4030504@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Sylvain Wallez wrote: > 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] >> For plugable expression languages, JEX: http://cvs.apache.org/viewcvs.cgi/jakarta-commons-sandbox/jex/ and http://www.plotnix.com/jex/index.html, might be worth looking at. It provides intefaces for pluggable expression languages. It supports the "expression-engine:path" syntax that you use above and have default implementations for jexl, jxpath, bexl and javascript. The project seem like it never took off and consists of a 2 year old initial submission from Dmitri Plotnikov (the main author of JXPath). But we could get ideas and meybe steal code from JEX, if we would like to have pluggable expression languages in Cocoon. >>> >>> >> >> 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 > I agree with Sylvain. I mainly use expression languages for accessing DOM trees, and we write a lot of XSLT at my company, so for us JXPath (or other XPath based expression languages) is the natural choice. For people who mainly work in Java, and use Cocoon as a view layer for Java beans, JEXL is probably a much more natural choice. So even if I think that JEXL support is FS as I never use it ;) I still think that we should support both. /Daniel