Exercise 2.

Part 5 of this tutorial explained the following stylesheet:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="collection">

<html>
<head></head>
<body>
<h2>
<xsl:value-of select="head"/>
</h2>
</body>
</html>
</xsl:template>

</xsl:stylesheet>

 

Change this stylesheet in such the way that collection.xml can be transformed into the following HTML file:

Browser view HTML source code

Letter collection of the University of Leiden

From Sijthoff, Albertus Willem to Hensbroek, Pieter Andreas Martin Boele van
Feldafing
1910
SYT A 1910



<h2 align="center">Letter collection of the University of Leiden</h2>


<p>
<b>From Sijthoff, Albertus Willem to Hensbroek, Pieter Andreas Martin Boele van</b><br>
Feldafing<br/>
1910<br/>
<i>SYT A 1910</i><br/>
</p>

Notice that the line mentioned the author and the recipient is given in bold and that the shelfmark (from the element <callnumber>) is printed in italics. These formatting instructions can be given by using the HTML elements <b> (bold) and <i> (italic). Using the XSLT elements that have been discussed up and until part 6, only the first letter can be shown.

Part 7 of this tutorial explains why this is the case and how this situation can be improved.

Answers | Continue with the tutorial