Copyright 2013 Syd Bauman, David Birnbaum, Julia Flanders, and Martin Holmes
This TEI-encoded XML file is available under the terms of the Creative Commons Attribution-ShareAlike 3.0 (Unported) license.
How XSLT fits into the publishing toolchain.
Elicit some of the possible outputs we might produce from XML using XSLT.
Try to elicit as many different XML output flavours as might be common, including TEI (of course), DocBook, SVG, Dublin Core or RDF (metadata), MARC, MODS etc. etc.
Elicit what xsl:fo is for, and how it's used.
An important point to make at this stage is that when we transform our typically rich TEI code into something else, we frequently throw away lots of information. For example, if we create a PDF for printing, we may throw away all the links, because they can't be followed from a piece of paper. Similarly, when we create XHTML, we may hide all sorts of key information (such as components of the teiHeader) because they're too detailed to be effective components of a web page.
To answer this question, we're going to create a simple XSLT file together.
You're welcome to type along with me in Oxygen if you'd like to.
We're going to start with the hamlet.xml example file, which you can find here:
Stress that it's absolutely not important that they understand everything that's happening here. The main idea is to get a sense of how transformations work, what templates look like, and what happens when you don't provide a template (default processing behaviour).
This is the process:
Again, the purpose here is not to understand exactly how all of this works; it's to demonstrate that even with a very simple XSLT transformation, you can start to get quite impressive results.
If all the students have followed along, you might give them ten or fifteen minutes to continue extending the stylesheet to see how they get on.