cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: [Design] JXTG 2.0 (generator and transformer, same template syntax?)
Date Tue, 07 Dec 2004 10:45:41 GMT
Stefano Mazzocchi wrote:

> Bertrand Delacretaz wrote:


<snip/>

>> D4) Bob was initially confused about this generator/transformer 
>> thing, why both? Alice told him not to worry, generators are not his 
>> business anyway, he's only a Cocoon Transformer Template Designer 
>> (but a good one after only four weeks here). He'll understand when he 
>> grows up ;-)
>
>
> Sure, but the question is: once the syntax starts to get ugly for both 
> because of changes we made to the language that make sense only on 
> transformation and not on generation, would it still be the case?
>
> remember that the generation stage has a scripted population stage 
> first, the transformation stage does not!


I don't see this distinction: if you look at the global processing 
chain, there is always a population stage in front of the template engine:

1/ template as a generator

  +------------+              +-----------+
  + Flowscript |--(objects)-->| Template  |----> ...
  +   data     |              | generator |
  +------------+              +-----------+
                                    ^
                                    |
                              Template file

2/ template as a transformer

  +-----------+               +-------------+
  | Generator |--(xml data)-->|  Template   |----> ...
  |           |               | transformer |
  +-----------+               +-------------+
                                     ^
                                     |
                               Template file

Where is the difference? The template lays out some data. In the case of 
the generator, it's controller-provided data, in the case of the 
transformer, it's pipeline-produced data. Note that is not limited to a 
generator, but can also be aggregation, prior transformation, etc, or 
even some preliminary processing of some controller-provided data.

<snip/>

> BTW, this whole discussion reminds me of DVSL:
>
> [http://jakarta.apache.org/velocity/dvsl/users-guide.html]


There is a huge difference with DVSL: just like XSLT, DVSL is a 
rule-driven declarative language. This is what scares most people in 
XSLT (although from my trainer's experience, it's not that hard to 
learn). The template language we're talking about is purely procedural.

>> -Bertrand, enjoying the debate...
>

Me too, even if it's hard to follow :-)

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