cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject RE: [ANN] GroupingTransformer
Date Wed, 05 Feb 2003 17:34:28 GMT
On Wed, 2003-02-05 at 17:17, Hunsberger, Peter wrote:
> >> Bruno Dumon wrote:
> >> > Based on some code from the xReporter project, I created a new 
> >> > transformer for Cocoon that can do grouping and summary calculation 
> >> > of table-like data (such as the data that comes out of the 
> >> > SQLTransformer). The grouping to be performed is described in a 
> >> > configuration file. This transformer works independent from 
> >> > xReporter.
> >> 
> >> I'm too lazy^H^H^H^Hbusy to look at the docs now ;-). Can you tell us
> >> what features it has that cannot be implemented with XSLT?
> >> 
> >
> > I've never tried to do things like grouping and calculating summaries in
> > XSLT, but I think that:
> > 
> >  * writing the config file for the GroupingTransformer is less work than
> > doing the same thing in XSLT.
> 
> Grouping is a standard XSLT problem.  It's not real trivial, it usually
> requires a knowledge of keys, but it's not all that hard either.

though you'll have to rewrite it from scratch each time you need it
(AFAIU).

> 
> >  * calculating things like averages, sums, min and max values is a lot
> > easier than in XSLT (or probably impossible XSLT)
> 
> Sum, min, max are usually pretty much trivial.  Obviously, if you've got
> sum, average, is not much harder...

Ah, ok (I was told so by someone else). Though the calculations done by
the GroupingTransformer are based on an expression library, which I
think is more powerful than what can be achieved using xslt.

It would also possible to further extend the GroupingTransformer to do
things like sort the groups based on the calculated summaries (e.g. to
place highest sums first). And then there are also plans to make a
crosstabulating transformer some day...

> 
> >  * it should run faster than XSLT
> 
> That's probably true!  But; will it be easier to maintain?  If it's
> presentation oriented I'd keep it in the XSLT if it's business logic then a
> transformer might be more reasonable (or better, shove it even further
> towards the back end).


-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message