Alphabet soup of web standards

It strikes me that similarities between xml and database structure are fairly common. This article at A List Apart explains the similarities and differences.

The process of converting an XML document into something viewable by a browser (or into anything else) is handled by a “transformation language” called XSLT. Here’s a diagram: PDF

XML syntax – Check out the difference in the source code for these two visually-identical documents, one run through an XSLT transformation, and one just calling an “XSL stylesheet” (like CSS but actually writes virtual code to help the browser interpret):

XSLT-processed

XML source

So a sample flow of an intranet item would be: Data from database –> Java servlet –> XML document –> XSLT transformation or XSL linked stylesheet –> browser displays HTML-like page –> CSS local visual/aural* style .

See this sample transformation of XML –> HTML:

Sample Transformation

What is fun about this structure is that after an initial entirely-machine-programmed process, the code starts looking very human-writable. Instead of coding a giant table-based layout: <table class="metrics"><tr><td>blah</td></tr></table> you could just write: <metrics table>blah</metrics table>

One thing that would make such a transition easier–XHTML is by definition a valid XML document; it’s a good way to get existing data into this sort of structure. Plus, I like coding XHTML much better than HTML. Here’s a good intro to the differences:

NYPL Style Guide

That’s all for now…

* for more on “aural” stylesheets, check out the W3C’s aural stylesheet recommendation page