Monday, June 19, 2006

I really am extremely XSLT

I taught myself XSLT back in 2001, when I stumbled over the open source Apache Cocoon software.

Cocoon used XSLT all over the place. The way it generated HTML web pages out of handy little XML data files was amazing.


I used it for some kind of project status reports or something like that back in 2001. Not much. I think that was about it.

I continued to study it and read quite a bit about it, grocking more and more about how it could be used and what it would be good at doing.

In 2002, I was fortunate enough to land a reports generating project.

Without going into details, it was pretty awesome.


The technique I came up with pulled Java business objects off a server, transmogrified them into XML, used XSLT I wrote for each report to format them into an XML based report format I invented, and then ran the output of that first XSLT transformation through reusable XSLT transformation I wrote for each file format.

So, in simple terms, the level of software reuse I got was amazing.

  (1 object-to-XML converter in Java) +
    (1 XSLT script per report) +
    (1 XSLT script per output file format)


Notice that is a plus sign - not a multiplication symbol - between the two XSLT terms. This is not an m * n cost. This is an m + n cost.

In effect, I created a way to do reporting deeds - and they're done dirt cheap, to cop a phrase from Dire Straits.


There were 3 file formats directly supported: HTML (styled with XSLT), XSL-FO, and GMR (Gnu Gnumeric spreadsheet). Free, open source software was used to transform those documents into other file formats - such as XLS (Microsoft Excel spreadsheets), PDF (Adobe Acrobat reports), and so on.


That project really drove home to me the excellence of XSLT and just how far you could go with so little effort, using XML for mundane IT work. And if anything is mundane IT work, it is generating business reports.

Another thing I was pleased about was the software costs of the project: $0. That is right, not one dollar was spent on purchasing software for this project. All the libraries, all the tools, all the frameworks, all the servers used were free.


Looking around and talking to other people since, many organizations will pay tens of thousands or hundreds of thousands of dollars to buy a workable report-generation scheme for Java - and they still have programming costs with each report they generate!.

I thought that was silly. Still do.

Some projects with odd reporting requirements will need special software. If they hunt around, I know they will find free tools they can use to slash their costs with little effort.


I have been a colossal XSLT fan ever since that reporting project. I sort of was before. Afterwards though, I had a huge excuse.

0 Comments:

<< Home