Appendice 5
Foglio di Stile XSLT per la produzione di output HTML mediante l'uso di parametri per esigenze di accessibilità
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso-8859-1" version="4.01"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
<xsl:param name="color"/>
<xsl:param name="font"/>
<xsl:param name="size"/>
<xsl:strip-space elements="p"/>
<xsl:template match="/">
<html>
<head>
<title>
<xsl:value-of select="/TEI.2/teiHeader/fileDesc/titleStmt/author"/> - <xsl:value-of
select="/TEI.2/teiHeader/fileDesc/titleStmt/title"/>
</title>
<style type="text/css">
p {
font-family:<xsl:value-of select="$font"/>;
font-size: <xsl:value-of select="$size"/>pt;
text-align: justify;
text-indent: 25pt;
line-height: 2em;
margin: 0pt 0pt;
}
a { color: Black; font-size: <xsl:value-of select="1 + $size"/>pt; text-align: left;
font-family: "Times New Roman", Times, serif; text-decoration: none; line-height: 1em; }
a:hover { color: #1E20FF; }
h1 { font-size: <xsl:value-of select="5 + $size"/>pt; text-align: left; font-weight:
bold; font-family:"Times New Roman", Times, serif; }
h2 {font-size: <xsl:value-of select="3 + $size"/>pt; text-align: left;
font-family:"Times New Roman", Times, serif; }
cite { font-style: normal; }
.italic {font-style: italic;}
.mc { font-size: 16pt; font-family: "Times New Roman", Times, serif; font-weight: bold;
text-align: center; }
.bal {
font-size: 25pt; font-family: "Times New Roman", Times, serif; font-weight: bold;
text-align: center; letter-spacing: 1em;}
.sub {
font-size: medium; font-family: "Times New Roman", Times, serif; text-align: center;}
.imp {
font-size: medium; font-family: "Times New Roman", Times, serif; text-align: center;
}
.cap { margin-left: 10%; margin-right: 10%; }
.part {
font-size: medium; font-family: "Times New Roman", Times, serif;
font-style: italic;
text-align: left;}
.center { text-align: center; }
.hr { width: 65%; }
.bloc {font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: <xsl:value-of select="$size"/>pt;
line-height: 2em;
margin-left: 10%; margin-right: 10%; }
blockquote {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: <xsl:value-of select="$size"/>pt;
text-align: justify;
line-height: 2em;
}
body { background: <xsl:value-of select="$color"/>;
font-family: <xsl:value-of select="$font"/>;
font-size: 12pt;
line-height: 2em;}
</style>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="teiHeader"/>
<xsl:template match="text">
<xsl:apply-templates mode="index"/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="front" mode="index">
<xsl:apply-templates mode="index"/>
</xsl:template>
<xsl:template match="titlePage" mode="index">
<div class="center">
<br/>
<hr class="hr"/>
<br/>
<xsl:apply-templates mode="index"/>
<br/>
<br/>
<hr class="hr"/>
<br/>
<br/>
<span class="imp">INDICE</span>
</div>
</xsl:template>
<xsl:template match="docAuthor" mode="index">
<span class="mc">
<xsl:value-of select="."/>
</span>
<p> </p>
<p> </p>
</xsl:template>
<xsl:template match="docAuthor"/>
<xsl:template match="docTitle" mode="index">
<xsl:apply-templates mode="index"/>
</xsl:template>
<xsl:template match="titlePart[@type='main']" mode="index">
<span class="bal">
<xsl:value-of select="."/>
</span>
<br/>
</xsl:template>
<xsl:template match="titlePart[@type='main']"/>
<xsl:template match="titlePart[@type='sub']" mode="index">
<span class="sub">
<xsl:value-of select="."/>
</span>
<br/>
<p> </p>
<p> </p>
</xsl:template>
<xsl:template match="titlePart[@type='sub']"/>
<xsl:template match="docImprint" mode="index">
<span class="imp">
<xsl:value-of select="."/>
</span>
</xsl:template>
<xsl:template match="docImprint"/>
<xsl:template match="div[@type='ded']" priority="1">
<p>***inserire dedica***</p>
</xsl:template>
<xsl:template match="div[@type='ep']" priority="1">
<p>***inserire epigrafe***</p>
</xsl:template>
<!---->
<xsl:template match="body">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="div0" mode="index">
<div class="cap">
<br/>
<span class="part">
<xsl:value-of select="p"/>
</span>
<br/>
<xsl:apply-templates mode="index"/>
</div>
</xsl:template>
<xsl:template match="div0/p" mode="index"/>
<xsl:template match="div1" mode="index">
<br/>
<xsl:apply-templates mode="index"/>
</xsl:template>
<xsl:template match="back/div" mode="index">
<div class="cap">
<br/>
<xsl:apply-templates mode="index"/>
</div>
</xsl:template>
<xsl:template match="head" mode="index">
<a href="#{../@id}">
<xsl:value-of select="."/>
<br/>
<xsl:apply-templates mode="index"/>
</a>
</xsl:template>
<xsl:template match="text()|@*" mode="index"/>
<!---->
<xsl:template match="div0">
<div class="center">
<br/>
<br/>
<br/>
<span class="imp">
<xsl:value-of select="p"/>
</span>
<br/>
<br/>
***<br/>
<br/>
<br/>
</div>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="div0/p"/>
<xsl:template match="div1">
<xsl:comment>INIZIO CAPITOLO <xsl:value-of select="@id"/>
</xsl:comment>
<div class="cap">
<xsl:apply-templates/>
</div>
<xsl:comment>FINE CAPITOLO <xsl:value-of select="@id"/>
</xsl:comment>
</xsl:template>
<xsl:template match="head[@type='ord']">
<a name="{../@id}"/>
<h2>
<xsl:apply-templates/>
</h2>
</xsl:template>
<xsl:template match="head[@type='conv']">
<a name="{../@id}"/>
<h2>
<xsl:apply-templates/>
</h2>
</xsl:template>
<xsl:template match="head[@type='tem']">
<h1>
<xsl:apply-templates/>
</h1>
<hr/>
<br/>
</xsl:template>
<xsl:template match="p">
<p>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="div[@type='nota']">
<div class="cap">
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="q[@type='citazione']" priority="1">
<xsl:choose>
<xsl:when test="@rend='bloc'">
<blockquote>
<xsl:apply-templates/>
</blockquote>
</xsl:when>
<xsl:when test="@rend='italic'">
<cite class="italic">
<xsl:apply-templates/>
</cite>
</xsl:when>
<xsl:otherwise>
<cite>
<xsl:apply-templates/>
</cite>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="l">
<xsl:apply-templates/>
<br/>
</xsl:template>
<xsl:template match="lb">
<br/>
</xsl:template>
<xsl:template match="*[@rend='bloc']">
<div class="bloc">
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="*[@rend='italic']">
<span class="italic">
<xsl:apply-templates/>
</span>
</xsl:template>
<xsl:template match="q[@type='epistola']">
<div><xsl:apply-templates/></div>
</xsl:template>
</xsl:stylesheet>