XSLT generated output

There are two ways to generate output in server side programming, the Template View and the Transform View. I have borrowed these terms from Martin Fowler‘s book Patterns of Enterprise Application Architecture. The Template View uses HTML pages with special markers, to pick at runtime data from in memory server side objects. In the Java world the technology to enable this is JSP pages and in the .Net world ASP.NET pages. Well known and simple to use stuff.

The other method is Transform View. Here you take a representation of the data and run that through a processor that based on the data generates output. XML to represent the data and XSLT to render output are the most well known examples of this category.

The most well known argument in favor of Transform View is the abillity to easily generate output for multiple channels. Unfortenately Transform view has some major drawbacks when it comes to using it in publically visible websites

  • It harder in XSLT to make it look exactly like you want
  • It rarely happens that you want to reuse a piece of XSLT for two screens. Most of the times presentation of the same data on one screen differs from another. And since the XSLT language is not modular it is hard to reuse parts.
  • Transform languages like XSLT are very hard to program. In fact the XSLT language is so basic that I would not call it a programming language
  • XSLT transformations are slow and memory intensive
  • XML is based on the data and on the view. The downside is that you usually obtain more data than you need.

XML and XSLT do have their place. But is certainly not in generating output that is presented on website that are under control of marketing.


%d bloggers like this: