May 12, 2003

More on advanced XSLT usage

Fun at Sand Dunes - Death Valley, California

I found this old article by Jason Diamond via Leigh Dodds. The article describes the same technique I was referring to in a previous entry. The article refers to an even older article by Eric van der Vlist describing the same technique.

The idea is to come up with your own set of XML elements that describe best your problem domain, annotate your HTML pages with these XML elements, and then use an XSLT stylesheet to transform the annotated HTML page into another XSLT stylesheet. This last XSLT stylesheet contains all the presentation information from the original HTML; it is applied on the real input data model to generate the output HTML.

A traditional user of XSLT would write this last stylesheet by hand, mixing the presentation with the actual code that traverses the data structure to be represented. To do this, the developer would first have to reverse engineer the structure of the HTML page, and embed that structure into the stylesheet. The process is time consuming, frustrating and error-prone; the result is ugly and hard to maintain.

Annotating an HTML page and generating the stylesheet automatically is a much easier solution to maintain in the long run. The HTML page designer doesn't have to know XSLT, they would follow exactly the same design process as before. The only thing they need to learn are the extension XML elements that describe where and how the dynamic data will be placed into the HTML page.

The challenge is on the developer of the extension XML elements to be able to cover all the corner cases, and make it possible for the designer to easily embed the data in the page templates.

Posted by ovidiu at May 12, 2003 12:59 AM |
Copyright © 2002-2016 Ovidiu Predescu.