brain dust

The Absolute.

Tuesday, December 19, 2006

The beauty of XML Transformations

So I have been hard pressed to find any real world situations where I would really need to use transformations. Well, today I found one:

I am dealing with a project in which I need to manipulate data from a sql database that has 90 columns of data. I have several systems and interfaces that I need to pass the data to. Sql Stored Procedures, JScripts and so on. I was dreading typing all of the column names in over and over again.

So, I created the Transformer, which takes an XML document, a style sheet (XSLT) and performs the transformation for you and spits out the result in a textbox in the window that you can then copy and paste into your other environments.

This has let me write two XSLTs that are no more than 20 lines long to produce two different sets of JScript methods that would have taken me an hour or so to write. I'll be using this for a long time I'm sure.