Appendice 8

Foglio di Stile XSLT (Lit-opf.xsl) per la creazione del package file di una pubblicazione OEBPS a partire dai dati XMl/TEI di Baltico

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" encoding="iso-8859-1" doctype-public="+//ISBN 0-9673008-1-9//DTD OEB 1.2 Document//EN" doctype-system="http://openebook.org/dtds/oeb-1.2/oebdoc12.dtd" indent="yes"/>
	<xsl:template match="/">

	<!-- l'intero template opera esclusivamente sul nodo radice e tramite riferimenti 
  assoluti richiama altri elementi, la funzione translate converte gli spazi 
  in underscores-->

<package unique-identifier="{translate(/TEI.2/teiHeader/fileDesc/titleStmt/author,' ','_')}_{translate(/TEI.2/teiHeader/fileDesc/titleStmt/title,' ','_')}">

<metadata>

<dc-metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oebpackage="http://openebook.org/namespaces/oeb-package/1.0/">

<dc:Identifier id="{translate(/TEI.2/teiHeader/fileDesc/titleStmt/author,' ','_')}_{translate(/TEI.2/teiHeader/fileDesc/titleStmt/title,' ','_')}">
	<xsl:value-of select="/TEI.2/teiHeader/fileDesc/titleStmt/title"/>
</dc:Identifier>

<dc:Title>
	<xsl:value-of select="/TEI.2/teiHeader/fileDesc/titleStmt/title"/>
</dc:Title>

<dc:Creator role="aut" file-as="{/TEI.2/teiHeader/fileDesc/titleStmt/author/name[@type='surname']},{/TEI.2/teiHeader/fileDesc/titleStmt/author/name[@type='forename']}">
	<xsl:value-of select="/TEI.2/teiHeader/fileDesc/titleStmt/author"/>
</dc:Creator>

<dc:Subject>Literature/Poetry</dc:Subject>

<!-- Descrizione inserita manualmente in qunato mancante un elemento analgo nel TEi header -->

<dc:Description>Versione elettronica del romanzo di Matteo Collura Baltico. Un'epopea sicilian</dc:Description>

<dc:Publisher>
	<xsl:value-of select="/TEI.2/teiHeader/fileDesc/publicationStmt/publisher"/>
</dc:Publisher>

<!-- per comodità vista la differenza in questo caso fra i metadati tei e quelli DC di riportare soltanto il nome del primo resp-->

<dc:Contributor file-as="{/TEI.2/teiHeader/fileDesc/titleStmt/respStmt/name[1]}" role="com">
	<xsl:value-of select="/TEI.2/teiHeader/fileDesc/titleStmt/respStmt/name[1]"/>
</dc:Contributor>

<dc:Type>
	<xsl:value-of select="/TEI.2/teiHeader/profileDesc/textClass/keywords/term"/>
</dc:Type>

<dc:Date>
	<xsl:value-of select="/TEI.2/teiHeader/fileDesc/editionStmt/edition/date"/>
</dc:Date>

<dc:Format>text/html</dc:Format>

<dc:Source><!-- elaborazione condizionale per inserire le virgole ed il punto finale -->
<xsl:for-each select="/TEI.2/teiHeader/revisionDesc/change/item/bibl/*">
<xsl:choose>
  <xsl:when test="position() != last()"><xsl:value-of select="."/>, </xsl:when>
    <xsl:otherwise><xsl:value-of select="."/>.</xsl:otherwise>
  </xsl:choose>
</xsl:for-each>
</dc:Source>

<dc:Language>Italian (Italy) [it]</dc:Language>

<dc:Rights>Copyright 1988 Matteo Collura</dc:Rights><!-- (contenuto inserito manualmente) -->
					
</dc-metadata>

</metadata>

	<manifest>
		<item id="toc" href="toc.htm" media-type="text/x-oeb1-document"/>
		<item id="contenuto" href="contenuto.htm" media-type="text/x-oeb1-document"/>
		<item id="copy" href="copyright.htm" media-type="text/x-oeb1-document"/>
		<item id="cover-standard" href="copertinag.jpg" media-type="image/jpg"/>
		<item id="thumb-standard" href="copertinap.jpg" media-type="image/jpg"/>
	</manifest>
	
	<spine>
			<itemref idref="contenuto"/>
			<itemref idref="toc"/>
	</spine>
	
	<guide>
		<reference type="toc" title="toc" href="toc.htm"/>
		<reference type="other.ms-coverimage-standard" title="cover-standard" href="copertinag.jpg"/>
		<reference type="other.ms-thumbimage-standard" title="thumb-standard" href="copertinap.jpg"/>
		<reference type="copyright-page" title="copy" href="copyright.htm"/>
	</guide>

</package>

</xsl:template>
</xsl:stylesheet>