NewtFire logo: a mosaic rendering of a firebelly newt
newtFire {dh}
Creative Commons License Last modified: Sunday, 23-Aug-2020 02:02:32 UTC. Maintained by: Elisa E. Beshero-Bondar (eeb4 at psu.edu). Powered by firebellies.

The texts

For this assignment, we set you free to write XSLT on your own project files. Alternatively, you may choose to work with XML files you have discovered and downloaded from the GitHub repos of other newtFire projects.

Because the XML texts in these projects may still be under development, they may be inconsistently or incompletely marked up. As long as they are well formed, however, you can explore them with XPath-based tools, including XSLT. While you are welcome to use XML files from any of these sources, we will be especially pleased to see you create something interesting from your own project XML files to build new HTML pages for your project website.

The assignment

Select an XML file from one of the projects and take a few minutes to study it and familiarize yourself with its overall structure. (Notice whether it’s in a namespace and change your stylesheet template accordingly!) 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/>.

XSLT Stylesheet setup

In Spring 2019, none of the project teams have been coding XML in a namespace like TEI. So if working with 2019 project code, your XSLT stylesheet template just needs to process non-namespaced XML and output code in the HTML namespace. Here is a template for that purpose:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
    exclude-result-prefixes="xs"
    xmlns="http://www.w3.org/1999/xhtml"
         version="3.0">
    
         <xsl:output method="xhtml" encoding="utf-8" doctype-system="about:legacy-compat"
        omit-xml-declaration="yes"/>
    
</xsl:stylesheet>

Advice in case you need it: 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 or collection 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 find interesting or useful, but so that you’ll gain practice with a range of XSLT techniques, this assignment requires that you make meaningful use of at least two of the following in your XSLT:

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). We recommend that you style your output HTML with CSS, and if you do this, be sure that your XSLT generates the necessary <link> element inside HTML document, and upload the CSS file along with the XSLT and output HTML.