Appendice 1

Foglio di Stile XSLT per la produzione di un output HTML a partire dai dati della testata (header) TEI

<?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:strip-space elements="*"/>
	<xsl:preserve-space elements="author"/>
	<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"/> [FRONTESPIZIO]</title>
 </head>
 <body>
 <hr/>
 <h1>
 <xsl:value-of select="/TEI.2/teiHeader/fileDesc/titleStmt/title"/>
 </h1>
  <hr/>
<xsl:apply-templates/>
 </body>
 </html>
	</xsl:template>
	<xsl:template match="teiHeader">
 <xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="filedesc">
 <xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="titleStmt">
 <xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="fileDesc/titleStmt/title">
 <p><b>Titolo dell' Opera</b>: &#160;<xsl:apply-templates/></p>
	</xsl:template>
	<xsl:template match="fileDesc/titleStmt/author">
 <p><b>Autore</b>: &#160;<xsl:apply-templates/></p>
	</xsl:template>
	<xsl:template match="fileDesc/titleStmt/respStmt">
 <xsl:apply-templates/>
	</xsl:template>
	<!-- questa sintassi è necessaria per mantenere il file ben formato -->
	<xsl:template match="fileDesc/titleStmt/respStmt/resp">
 <xsl:text disable-output-escaping="yes"> &lt;p&gt;</xsl:text>
<b><xsl:apply-templates/></b>: &#160; </xsl:template>
	<xsl:template match="fileDesc/titleStmt/respStmt/name">
 <xsl:apply-templates/>
 <xsl:text disable-output-escaping="yes"> &lt;/p&gt;</xsl:text>
	</xsl:template>
	<xsl:template match="editionStmt">
 <p><b>Edizione</b>: &#160;<xsl:apply-templates/></p>
	</xsl:template>
	<xsl:template match="extent">
 <p><b>Dimensioni file</b>: &#160;<xsl:apply-templates/></p>
	</xsl:template>
	<xsl:template match="publicationStmt">
 <xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="publicationStmt">
 <xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="publicationStmt/publisher">
 <p><b>Pubblicazione e Distribuzione</b>: &#160;<xsl:apply-templates/></p>
	</xsl:template>
	<xsl:template match="publicationStmt/pubPlace">
 <p><b>Luogo di pubblicazione</b>: &#160;<xsl:apply-templates/></p>
	</xsl:template>
	<xsl:template match="publicationStmt/availability">
 <p><b>Copyright</b>: &#160;<xsl:apply-templates/>
 <!-- inserire collegamento alla firma digitale -->
 </p>
	</xsl:template>
	<!--modello x evitare di mandare in output la firma digitale -->
	<xsl:template match="availability/p[position() = last()]"/>
	<xsl:template match="publicationStmt/date">
 <p><b>Data di pubblicazione</b>: &#160;<xsl:apply-templates/></p>
	</xsl:template>
	<xsl:template match="sourceDesc">
	<h2>Descrizione della fonte</h2>
 <xsl:apply-templates/>
	</xsl:template>
<xsl:template match="sourceDesc/biblFull">
 <p><b>Testo di Riferimento</b>: &#160;<br/>
 <xsl:apply-templates/>
 </p>
	</xsl:template>
	<xsl:template match="sourceDesc/biblFull/titleStmt/title[@type='main']">
<i>TITOLO</i>: &#160;<xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="sourceDesc/biblFull/titleStmt/title[@type='sub']">
<i>Sottotitolo</i>: &#160;<xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="sourceDesc/biblFull/titleStmt/author">
<i>Autore</i>: &#160;<xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="sourceDesc/biblFull/editionStmt">
 <xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="sourceDesc/biblFull/editionStmt/edition">
<i>Edizione</i>: &#160;<xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="sourceDesc/biblFull/extent">
<i>Dimensioni</i>: &#160;<xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="sourceDesc/biblFull/publicationStmt">
 <xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="sourceDesc/biblFull/publicationStmt/publisher"><i>Editore</i>: &#160;<xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="sourceDesc/biblFull/publicationStmt/pubPlace"><i>Luogo di pubblicazione</i>: &#160;<xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="sourceDesc/biblFull/publicationStmt/date"><i>Anno di pubblicazione</i>: &#160;<xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="sourceDesc/biblFull/publicationStmt/idno">
 <i><xsl:value-of select="@type"/></i>: &#160;<xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="sourceDesc/biblFull/seriesStmt"><i>Collana</i>: &#160;<xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="encodingDesc">
 <h2>Descrizione della codifica</h2>
 <xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="projectDesc">
 <p><b>Descrizione del progetto</b>: &#160;<xsl:apply-templates/></p>
	</xsl:template>
	<xsl:template match="editorialDecl">
 <p><b>Descrizione dei principi di codifica</b>: &#160;<xsl:apply-templates/></p>
	</xsl:template>
	<xsl:template match="refsDecl">
 <p><b>Descrizione dei principi di codifica inerenti il sistema di riferimento</b>: &#160;<xsl:apply-templates/></p>
	</xsl:template>
	<xsl:template match="classDecl">
 <p><b>Classificazione</b>: &#160;<xsl:apply-templates/></p>
	</xsl:template>
	<xsl:template match="profileDesc">
 <p><h2>Descrizione del profilo:</h2>
 <xsl:apply-templates/>
 </p>
	</xsl:template>
	<xsl:template match="profileDesc/creation"><b>Data di creazione</b>: &#160;<xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="profileDesc/langUsage"><b>Lingua</b>: &#160;<xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="profileDesc/textClass">
 <xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="profileDesc/textClass/keywords"><b>Categoria</b>: &#160;<xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="profileDesc/textClass/classCode ">
<b> <xsl:value-of select="@scheme"/></b>: &#160; <xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="revisionDesc">
 <p><h2>Descrizione della revisione</h2>
 <xsl:apply-templates/>
 </p>
	</xsl:template>
	<xsl:template match="revisionDesc/change/date">
 <b>Data</b>: &#160;<xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="revisionDesc/change/respStmt">
 <xsl:apply-templates/>
 <br/>
	</xsl:template>
	<xsl:template match="revisionDesc/change/respStmt/resp">
<b> <xsl:apply-templates/></b>: &#160;</xsl:template>
	<xsl:template match="revisionDesc/change/respStmt/name">
 <xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="revisionDesc/change/item"><b>Descrizione</b>: &#160;<xsl:apply-templates/>
 <br/><br/>
	</xsl:template>
	<xsl:template match="revisionDesc/change/item/bibl/*">
	<!-- elaborazione condizionale per inserire i due punti ed il punto finale -->
  <xsl:choose>
  <xsl:when test="position() = 1">: &#160;<xsl:apply-templates/>,</xsl:when>
  <xsl:when test="position() != last()"> &#160;<xsl:apply-templates/>,</xsl:when>
    <xsl:otherwise> &#160;<xsl:apply-templates/>.</xsl:otherwise>
  </xsl:choose>
	</xsl:template>

	<xsl:template match="text"/>
</xsl:stylesheet>