|
Each HTML page which shows an entry should include links to the preceding entry and the following entry (if there is one) - and to the table of contents (Fig. 2). |
LISTING 8: entry.xsl
<?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/REC-html40"
xmlns:saxon="http://icl.com/saxon"
extension-element-prefixes="saxon">
<xsl:variable name="thisentry"/>
<!-- .......template for dictionary's entry....... -->
<xsl:template match="entry">
<xsl:variable name="thisentry">
<xsl:value-of select="@id"/>
</xsl:variable>
<saxon:output method="html"
file="{$dir}{$filesep}{$thisentry}.html"
doctype-public="-//W3C//DTD HTML 4.0 Transitional"
doctype-system="http://www.w3.org/TR/REC-html40"
encoding="iso-8859-1"
indent="yes">
<html>
<head>
<title>iX Web dictionary</title>
<link rel="stylesheet" href="dictionary.css" type="text/css"/>
</head>
<body>
<table border="0" width="100%" cellspacing="0" cellpadding="5">
<tr>
<td rowspan="7" valign="top" width="30%">
<img src="/ix/images/iX.mini.tr.gif" alt="iX logo"/>
</td>
<td>
<h1>Web Dictionary</h1>
<img src="/ix/images/dots/1tr.gif" alt="vertical space"
width="200" height="50"/>
</td>
</tr>
<tr>
<td>
<h2><xsl:apply-templates select="acro"/></h2>
</td>
</tr>
<tr>
<td>
<h4><xsl:apply-templates select="term"/></h4>
<img src="/ix/images/dots/1tr.gif" alt="vertical space"
width="200" height="50"/>
</td>
</tr>
<tr>
<td>
<p class="de">
<xsl:apply-templates select="expl[@lang='de']"/>
</p>
</td>
</tr>
<tr>
<td>
<p class="en">
<xsl:apply-templates select="expl[@lang='en']"/>
</p>
</td>
</tr>
<tr>
<td>
<img src="/ix/images/dots/1tr.gif" alt="vertical space"
width="200" height="20"/>
<p class="navigate">
<xsl:if test="not(position()=1)">
<a>
<xsl:attribute name="class">navigate</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="preceding-sibling::entry[1]/@id"/>
<xsl:text>.html</xsl:text>
</xsl:attribute>
<xsl:value-of select="preceding-sibling::entry[1]/acro"/>
</a>
<xsl:text> </xsl:text>
<saxon:entity-ref name="lt"/>
<xsl:text> | </xsl:text>
</xsl:if>
<a>
<xsl:attribute name="class">navigate</xsl:attribute>
<xsl:attribute name="href">
<xsl:text>index.html</xsl:text>
</xsl:attribute>
<xsl:text>Inhalt/ToC</xsl:text>
</a>
<xsl:if test="not(position()=last())">
<xsl:text> | </xsl:text>
<saxon:entity-ref name="gt"/>
<xsl:text> </xsl:text>
<a>
<xsl:attribute name="class">navigate</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="following-sibling::entry/@id"/>
<xsl:text>.html</xsl:text>
</xsl:attribute>
<xsl:value-of select="following-sibling::entry/acro"/>
</a>
</xsl:if>
</p>
</td>
</tr>
<xsl:call-template name="do-foot"/>
</table>
</body>
</html>
</saxon:output>
<xsl:message> - <xsl:value-of select="$thisentry"/>: done</xsl:message>
</xsl:template>
</xsl:stylesheet>