This post contains attachments v20040724130932.zip 
Summary
A Generic stylesheet to transform, with the help of an optional layout file, an ADO recordset to a sortable HTML Table
I am new to XML and especially XSL, however a request for several very similar reports for our Intranet site forced me to look for an alternative to my normal build the HTML using asp.
I had considered XML, but transforming it seemed as complex, if not more so than hand crafting the table in ASP. Fortunately I found Michele Vivoda's article "ADO, XML and XSLT - Populating Tables and Combo boxes" at
http://www.topxml.com/xsl/articles/xsl_ado/
This went quite a way to solving my problem but I wanted to add other bits and the fact that Michele used the original namespace meant that other samples I found couldn't be imported into his example. Also I didn't want to use non standard things like script blocks, at least until I was happy with the way XSLT is supposed to work.
So I wrote my own, although I 'borrowed' the idea of the layout file from Michele's article.
I can't say whether my approach is efficient as I do not truly understand how the different methods hang together, but for the
relatively small datasets I will be working with it seems quite acceptable.
I have included both asp and htm versions of the samples, the former using dynamically created recordsets and the later persisted
rescordsets.
Hope someone finds the code useful
Graham Shaw
|