cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: [Design] JXTG 2.0 (Just my opinion)
Date Sun, 05 Dec 2004 20:54:23 GMT
Stefano Mazzocchi wrote:

> Bertrand Delacretaz wrote:
>> Le 4 déc. 04, à 21:03, Glen Ezkovich a écrit :
>>> On Dec 4, 2004, at 3:37 AM, Bertrand Delacretaz wrote:
>>>> ...Currently we have JXTG for the first step, and mostly XSLT for 
>>>> the second. Having something that could cover both steps and be 
>>>> usable by either programmers working on the first step or designers 
>>>> working on the second would be a Really Good Thing.
>>> I'm not really sure what you mean by having something that could 
>>> cover both steps. JXTG covers both steps in the sense that many 
>>> people are using it to inject their data into their html.  Now, to 
>>> have a template transformer, that is something with which I would 
>>> really like to play. I'm not very found of XSL. A simpler 
>>> alternative could be a Really, Really Good Thing.
>> That's what I mean - having a transformer that can use the same 
>> template syntax as used in the generator, so that the template 
>> language can be used for both the generation and transformation steps.
> My FS detector is out of scale!!

Ring, ring, ring :-)

> This is *exactly* what the XSLT WG did and failed miserably. XSLT can 
> be used for both generation and tranformation. But it looks right for 
> one (besides the stupid XML-ish syntax) and totally ackward for the 
> other. XQuery is the same thing, only reversed: it can be used as a 
> template language, and as a transformation language. If feels better 
> for the first one (only ackward because, as usual, the XSLT WG starts 
> with one name and ends up defining something else) and totally wrong 
> for the second.
> Look at my eyes and repeat with me: I DO NOT WANT TO REPEAT THE 
> Generation and transformation are two different things, done often by 
> different people and for different goals and with different constaints.
> Having one language for both will do only harm, because it will make 
> it harder for people to decide when to use generation and when to use 
> transformation.

Although I agree that using XSLT as a generator feels awkward, the 
context of Cocoon is different. XSLT as a transfomer uses an input 
document, and XSLT as a generator has no input which makes it look 
strange (although it can load data with the infamous document() function).

Now what is the "input document" equivalent in Cocoon? It depends:
- it can be the view data passed to cocoon.sendPage()
- it can also be the output of the generator.

So in the first case, the template is a generator, and in the second 
case, the template is a transformer. And in all cases, the template 
actually does *transform* a set of data.

So having a template language used either as a generator or a 
transformer doesn't seem so awkward to me, as contrarily to W3C specs, 
it is always a transformation of some data given by some previous layer 
in the processing chain (either the controller or the generator).

Note however that JXTemplateTransformer seems really weird to me as its 
input data *is* the template.


Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

View raw message