Digital humanities


Maintained by: David J. Birnbaum (djbpitt@gmail.com) [Creative Commons BY-NC-SA 3.0 Unported License] Last modified: 2022-11-11T17:45:27+0000


Test #5: XSLT

The task

Your task is to write XSLT that will create an XHTML reading view of our XML version of Clara D. Pierson’s Among the pond people, which can be found at http://dh.obdurodon.org/pondPeople.xml. The look and style of the output is up to you except for places where we specify (below) certain elements to include, and except for those features, any valid XHTML output that is consistent with the way a printed novel might reasonably be rendered is fine.

Note that we use the same element names with different content models in different contexts. For example, an <illustration> element in the list of illustrations at the beginning of the document has different content than an <illustration> element in the main text, and <page> elements in the lists of stories and illustrations toward the beginning contain a single integer and have no attributes, while <page> element children of <illustration> elements inside the main body have text content and @pageno attributes. You may find it helpful to download and explore the Relax NG schema that we used to validate the XML, which you can find at http://dh.obdurodon.org/pondPeople.rnc. You can develop and run your XSLT transformation without the schema, but examining the schema might help you understand the structure of the XML, which could make it easier to plan your transformation.

The context-dependent content of certain elements matters for developing XSLT to process this document because you may have to write templates to process elements with the same name differently depending on their context. You’ve already done that; recall how you wrote different templates to process acts and scenes in Hamlet even though both were tagged as TEI <div> elements.

You should upload both your XSLT and the XHTML output created by your transformation. If you undertake the extra-credit CSS option (see below), upload your CSS file, as well.

General guidelines

Required tasks

At a minimum, the output of your transformation must include the following features that might be expected in any reading view of a collection of stories:

Bonus (optional, extra-credit) tasks