cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Hunsberger <peter.hunsber...@gmail.com>
Subject Re: FormsGenerator vs FormsTransformer
Date Wed, 24 Nov 2004 23:09:19 GMT
On Wed, 24 Nov 2004 23:57:13 +0100, Sylvain Wallez <sylvain@apache.org> wrote:
> [catching up the list - guys, you were so verbose lately !]
> 
> Reinhard Poetz wrote:
> 
> > Just wondering why in the examples always the FormsTransformer is used
> > although the use of the FormsGenerator is possible. Does this have a
> > special reason?
> 
> 
> The FormsGenerator produces an XML representation of the form, following
> the hierarchy and ordering defined by the form definition. To produce an
> HTML page from that document, you either must have a generic stylesheet
> that will setup a standard (but not nice) layout, or have a specific
> stylesheet for each form.
> 
> The FormTransformer takes as input widget references spread in a page
> structure, meaning you have a specific template for each form. That
> template can be produced by any kind of generator (file, xsp, jxtg,
> velocity, etc.)
> 
> So to have nicely laid out forms, you can use either approach depending
> if you feel more comfortable with writing an XSL or a template for each
> form.
> 
> Seems like most people prefer to write a template :-)
> 
> Ah, and the FormGenerator can also be used for some webservice-style
> clients where no layout is needed.

The way we attack this is to aggregate the output of two generators:
one creates the object model and the other creates the layout model. 
Conceptually, a XSLT then walks the object model and annotates it with
the layout data.  A second XSLT then takes the combined model and
pumps out the actual xhtml (or whatever). In some cases  this simply
means adding class attributes since much of our actual styling is left
to CSS, but in other cases we do create gobs of xhtml...

-- 
Peter Hunsberger

Mime
View raw message