NewtFire logo: a mosaic rendering of a firebelly newt
newtFire {dh}
Creative Commons License Last modified: Monday, 27-Nov-2023 03:18:15 UTC. Maintained by: Elisa E. Beshero-Bondar (eeb4 at psu.edu). Powered by firebellies.

Your task is to transform our XML file representing Bram Stoker’s novel Dracula into an information-rich table of contents and HTML reading-view of the novel. Begin by right-clicking on the following files, saving them to your workspace, and opening them in <oXygen/> to study the code.

  1. The source XML file for Dracula. Don’t be concerned about the red schema warning on the file: you are just missing the Relax NG schema. If you want the file with its schema, you can pull the directory of files in in locally from the textEncoding-Hub where it is in Class Examples > XSLT > XSLT-Test-Files.
  2. A starter XSLT file for this exam (with the <xsl:stylesheet> and <xsl:output> elements prepared for processing to HTML).

To give you an idea of the desired output, here is a view of the HTML code for our target output as posted on the textEncoding-Hub. And here is a display view of that code on the web browser without any CSS. You are expected to prepare XSLT to output HTML like this, and provide your own CSS styling for it.

Open the XML file in <oXygen/> and study its code, and take some notes about where you can find the information destined for the target output in HTML.

Specific tasks

This test requires you to write modal XSLT to process the same <chapter> element nodes from the source XML in two different ways:

  1. one way: to output just the chapter headings in a table of contents,
  2. and the other way, to output the full chapters in a styled HTML reading view.

Reading View

Preparing the reading view involves processing richly mixed content without needing to target it selectively. Here is what you should capture from the Dracula XML markup:

Table of Contents

The table of contents should be output with modal XSLT as an HTML table with three columns (that is, three HTML <td> elements nested inside an HTML <tr> (table row) when processing each chapter. Each cell of the table should contain:

Completing and checking your work