Digital humanities


Maintained by: David J. Birnbaum (djbpitt@gmail.com) [Creative Commons BY-NC-SA 3.0 Unported License] Last modified: 2015-08-24T16:07:01+0000


XSLT assignment #6

The texts

Beginning in spring 2014 (2144), XML texts prepared by students in this course for their projects have been made available on GitHub (unless prohibited by copyright, which is the case with the Seuss and Tolkien projects this semester). You can find them by loading our Course projects page and clicking on the bracketed links labeled GitHub after the project titles. Because the XML texts for current (and some older) projects are under development, they may be inconsistently or incompletely marked up. As long as they are well formed, however, they can be explored with XML tools, including XSLT.

The assignment

Select an XML file from one of the projects and spend a few minutes looking at it to familiarize yourself with its overall structure. (Notice whether it’s in a namespace!) Visit the project site to learn more about the general project. You may use your own XML files or someone else’s. Download an XML file from whichever project you choose into <oXygen/>.

Digression: Downloading files from GitHub

The easiest way to download a file from GitHub is to clone the project onto your own machine, which will copy all files, and then open the file you need. If you want to download just one file (which is all you need for this assignment), you can’t just right-click and download because you’ll download a version with extraneous GitHub specific markup mixed into the file, which will render the file unusable for your purposes. What you can do instead is 1) connect to the repo in a browser; 2) click on the file you want, which will display its contents; 3) click on the button labeled Raw at the top of the code window, which will display its contents without any extraneous GitHub-specific material; and 4) either right-click and do a Save as or select all the text in the window, copy it to the clipboard, and paste it into a new XML document in <oXygen/>.

What to do with the file once you’ve downloaded it

Transform the XML into some form of HTML using XSLT, whether that’s a reading view or some sorts of lists or tables or other reports. You should decide yourself on the type of output you would find interesting or useful, but so that you’ll gain practice with some of the techniques we’ve introduced recently, your transformation must require meaningful use of at least two of the following:

Please upload your XSLT and the XML to CourseWeb. You do not have to upload the HTML output of your transformation (we’re going to run the transformation and generate the HTML ourselves anyway). If your HTML is going to be styled with CSS, though, be sure that your XSLT generates the necessary <link> element inside HTML document, and upload the CSS file along with the XSLT.