cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: xml languages
Date Mon, 24 Jan 2005 22:37:01 GMT
Daniel Fagerstrom wrote:
>>> Another possibility is to let set asign the value to the first 
>>> variable binding with the same name that it finds when the stack is 
>>> searched,
>>
>>
>> -1. Don't think this is a possibility; as noted above, templates 
>> should be side effect free.
> 
> 
> Glad that you agree :) Eric and Leszek are not convinced at all and want 
> real assignment.
Not 100% true. When introducing the assignment I have always thought 
about JXTG internal variables. I did not realize it could be also used 
to modify the model passed to the view. So how about the solution that 
the execution context has 2 levels on the start:

* root context contains the whole model passed from controller. This 
context does not allow neither for variable declaration nor assignment.
* main JXTG context which is a direct child of root context - this one 
is empty on the start. This one and all children allow for both 
declaration and assignment.

This way all jxtg assignments stay local to the view.

> I would also prefer complete freeness of side effects, but that would 
> require us to write an own expression language as both Jexl and JXPath 
> allows for calling put methods etc.
This would be nice for the usecase where the user itself can edit a 
template via a web application (i.e. jroller). Exposing current jxtg in 
that manner would be a great security risk.

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
Project Manager                                    MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Mime
View raw message