<?xml version="1.0"?>
<!DOCTYPE TEI.2 SYSTEM "teixlite.dtd"
[ 
 <!ATTLIST xref url CDATA #IMPLIED>
 <!ATTLIST xptr url CDATA #IMPLIED>
 <!ATTLIST figure file CDATA #IMPLIED>
]> 
<TEI.2>
  <teiHeader>
    <fileDesc>
      <titleStmt>
        <title>XML Publishing Exercises 2</title>
      </titleStmt>
      <publicationStmt>
        <p> </p>
      </publicationStmt>
      <sourceDesc>
        <p></p>
      </sourceDesc>
    </fileDesc>
    <revisionDesc>
      <list>
        <item><date>Jan 11th 2001</date>First draft</item>
      </list>
    </revisionDesc>
  </teiHeader>
  <text>
<front>
<titlePage>
<docTitle>
 <titlePart type="main">XSL Exercises 2</titlePart>
</docTitle>
<docAuthor>Sebastian Rahtz</docAuthor>
<docDate>March 2001</docDate>
</titlePage>
</front>
<body>

<!--
<div>
<head>Practising XSLT</head>
<p>
<list type="ordered">
<item>Go back to one of your Protestant Cemetery stylesheets, and make
it print in red the content of any element for which no template is
defined. See test4.xsl for similar code.
</item>
<item>Generate an output file containing just the lines
of all the inscriptions, copied out with all their markup. A starting
skeleton is
<eg><![CDATA[
<xsl:template match="/">
  <xsl:apply-templates select=".//l"/>
</xsl:template>

<xsl:template match="l">
 ......
</xsl:template>
]]></eg>
</item>
<item>Can you do the previous exercise, but sort the lines
according to length?</item>
	  </list>
</p>
</div>
-->

<div>
<head>Using the TEI stylesheet library for HTML</head>
<p>In the <code>xml</code> directory on your <code>H:</code>
	    drive, you will find two files <code>pope.xml</code> 
(Alexander Pope's <emph>The Rape of the Lock</emph>) and
<code>pope.xsl</code> (an XSLT stylesheet to format it). Run the
	    stylesheet with the command-line
<eg>
saxon pope.xml pope.xsl 
	    </eg>
and look at the resulting <code>pope.html</code> with your browser. 
The stylesheet is calling a
set of generalized XSLT stylesheets for rendering TEI documents. You
can alter the effects by editing <code>pope.xsl</code>, which has
a series of high-level variables. We suggest you try
<list>
<item>Change
<eg>  
 &lt;xsl:variable name="splitLevel">-1&lt;/xsl:variable>
</eg>
to
<eg>
 &lt;xsl:variable name="splitLevel">0&lt;/xsl:variable>
</eg>
and see the Cantos split into separate files</item>
<item>Change
<eg>
   &lt;xsl:variable name="numberHeadings">1&lt;/xsl:variable>
</eg>
to
<eg>
   &lt;xsl:variable name="numberHeadings">A&lt;/xsl:variable>
</eg>
to see how the section numbering changes
	      </item>
<item>Change
<eg>
   &lt;xsl:variable name="leftLinks"/>
</eg>
to
<eg>
   &lt;xsl:variable name="leftLinks">true&lt;/xsl:variable>
</eg>
and observe how the table of contents is now in a table column on the left
	      </item>
	    </list>
There is a full explanation of these variables at
<xptr url="http://www.hcu.ox.ac.uk/TEI/Stylesheets/teixsl.html"/>
  </p>
	</div>

<div>
<head>Making Word files from XML</head>
<p>Start Microsoft Word, and load in one
of the HTML files you have made. Look at the styles which Word uses for the
different HTML elements. Can you make the result a two-column document, change
the main font, and add page numbering?
</p>
</div>

<!--
<div>
<head>Exploring the Protestant Cemetery</head>

<p>To look at the
data about gravestones in the Protestant Cemetery, Rome,
point your web browser at <xptr
url="http://spqr.oucs.ox.ac.uk/~rahtz/cem/cem.html"/>. The screen is divided
	    into
3 parts. On the left, you have three ways to make a query:
<list type="ordered">
<item>Type in all or part of a surname</item>
<item>Type in a word you are looking for in an inscription</item>
<item>Select a country</item>
</list>
When you press the corresponding <code>Submit</code> button, the top
pane on the right will show a table listing some people (or none!), 
with their name, age, date of death, and links to view or save the
relevant inscription. If you press <code>view</code>, the bottom right
pane will show the formatted text. If you have an XSLT specification
	    of your own which will work with a cemetery
	    <gi>inscrip</gi> element, you can upload it and have it
	    applied to the current inscriptions.
</p>
<p>Some gravestones have linked photographs; if any are available, a
thumbnail will appear with the inscription, which you can click on to
	      see the full photograph.</p>
<p>Suggested queries:
<list>
<item>Enter <code>Keats</code> in the `name' query field, and look at
the two memorials for John Keats</item>
<item>Enter <code>Cockburn</code> in the `name' field, and select
<emph>Devereux Cockburn</emph> - look at his photographs.</item>
<item>Enter `actor' in the `word' query field, and look at <emph>Jim
		    Dolen</emph> 
		</item>
<item>Look at the people from Greece, and observe that the problem of
showing Greek letters is unsolved</item>
<item>Write an XSL specification to process the inscriptions,  
and upload it to the system. You need to provide a template
for <gi>inscrip</gi>, so a skeleton is as follows:
<eg><![CDATA[
<xsl:stylesheet 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  version="1.0">

<xsl:output method="html"/>

<xsl:template match="inscrip">
  <blockquote><xsl:apply-templates/></blockquote>
</xsl:template>

<xsl:template match="l">
  <xsl:apply-templates/><br/>
</xsl:template>
</xsl:stylesheet>]]></eg>
Can you add line-numbering, and make italic text appear in green?
	    </item>
</list>
	    </p>
</div>

-->
<!--
<div>
<head>Using the TEI stylesheet library for XSL formatting objects</head>
<p>In the <code>samples</code> directory on your <code>H:</code>
	    drive, you will find two files <code>pope.xml</code> 
(Alexander Pope's <emph>The Rape of the Lock</emph>) and
<code>pope-print.xsl</code> (an XSLT stylesheet to format it to XSL
	    formatting objects). 
The file <code>pope.pdf</code> is a rendering to PDF by an XSL FO
engine.  You can create a FO file (which is
just XML, if you look at it) with the command
<eg>
saxon -o pope.fo pope-print.xml pope.xsl 
</eg>
You can then load <code>pope.fo</code> into the Antenna House XSL
Formatter (icon on your desktop), and see the effect. <hi>Please note
that the Antenna House Formatter is a beta release of a commercial
product! Contact the company if you want to use it outside this
class!</hi>. Open the <code>.fo</code> file (do <emph>not</emph>
specify a style file), and choose `Run formatter'. If you get errors,
choose Formatter Options/File output, and check `Error logging' to
have them written to file instead of popping up.  The stylesheet is
calling a set of generalized XSLT stylesheets for rendering TEI
documents to Formatting Objects. You can alter the effects by editing
<code>pope-print.xsl</code>, which has a series of high-level
variables. Many of these are irrelevant to something as simple as
poetry, but we suggest you try these changes:
<list>
<item>
Replace
<eg>
&lt;xsl:variable name="bodyFont">Times Roman&lt;/xsl:variable>
</eg>
with
<eg>
&lt;xsl:variable name="bodyFont">Helvetica&lt;/xsl:variable>
</eg>
to change the main font
</item>
<item>
Replace
<eg>
&lt;xsl:variable name="bodyMaster">10&lt;/xsl:variable>
</eg>
with
<eg>
&lt;xsl:variable name="bodyMaster">14&lt;/xsl:variable>
</eg>
to change the main font size
</item>
<item>
Replace
<eg>
&lt;xsl:variable name="activePagebreaks">&lt;/xsl:variable>
</eg>
with
<eg>
&lt;xsl:variable name="activePagebreaks">true&lt;/xsl:variable>
</eg>
to change the way pagebreaks are represented.
</item>
</list>
If you want to try another formatter, open <xptr
url="http://spqr.oucs.ox.ac.uk/~rahtz/passivetex.html"/>; this will let you
upload a <code>.fo</code> file, format it, and  download the
resulting PDF.
</p>
</div>
-->
</body>
</text>
</TEI.2>
