Appendice 14

Foglio di Stile XSLT per la trasformazione in XSL-FO di Baltico

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
xmlns:fo="http://www.w3.org/1999/XSL/Format">
	<xsl:output method="xml" encoding="iso-8859-1" indent="yes"/>
	<xsl:strip-space elements="p"></xsl:strip-space>
	
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
 <fo:layout-master-set>
  <fo:simple-page-master master-name="principale" page-height="29.7cm" page-width="21cm" 
margin-top="1cm" margin-bottom="1cm" margin-left="2.5cm" margin-right="2.5cm">
		  <fo:region-before extent="1.5cm" />
            <fo:region-after  extent="1.5cm" />
		  <fo:region-body margin-top="1.8cm"  margin-bottom="1.8cm" />
		</fo:simple-page-master>
	</fo:layout-master-set>
	<xsl:apply-templates/>	<xsl:apply-templates mode="index"/>
</fo:root>	
</xsl:template>

<xsl:template match="teiHeader"></xsl:template>
<xsl:template match="text"><xsl:apply-templates/></xsl:template>
<!-- INIZIO FRONT -->
<xsl:template match="front"><xsl:apply-templates/>
<!-- INIZIO dediche inserite manualmente -->
	<fo:page-sequence master-reference="principale">
	<fo:flow flow-name="xsl-region-body">
		<fo:block space-before="1cm" font-size="15pt"  text-align="end"  font-family="Times Roman" 
font-style="italic">
A Bartolomeo Collura, mio padre.
		</fo:block>
	</fo:flow>
	</fo:page-sequence>
	
	<fo:page-sequence master-reference="principale">
	<fo:flow flow-name="xsl-region-body">
		<fo:block space-before="1cm" font-size="13pt"  text-align="justify"  font-family="Times Roman" 
line-height="1.5em" margin-right="0.5cm" margin-left="0.5cm">
Contagiati dal delirio delle escavazioni, subito accompagnato dalla comparsa di affaristi scrocconi,
 si scoprirono impensate doti di imprenditori; e sventrando valli e colline sognarono di arricchire,
 mentre copioso colava lo zolfo e si ampliavano i cimiteri. Due secoli di picconate cambiarono la 
faccia della terra. Subito si appales&#242; il disastro, ma in quel turbinio di fortune immaginate 
nessuno vi fece caso. Corsero ai ripari quando gi&#224; il vento screpolava gli spalti delle 
zolfare e le erbacce cominciavano a nasconderne le bocche. Fu come se un'ostinata bonaccia si fosse 
posata su un mare che era stato in tempesta. Non lontano dai ruderi, oziosi, aspettarono sussidi e 
pensioni; e polvere e silenzio sedimentarono sulla loro assurda epopea.
		</fo:block>
	</fo:flow>
	</fo:page-sequence>
	
		<fo:page-sequence master-reference="principale">
	<fo:flow flow-name="xsl-region-body">
		<fo:block space-before="1cm" space-after="0.4cm" font-size="13pt"  text-align="left"  
font-family="Times Roman" line-height="1.2em" margin-left="9.4cm">
Zufolava mentre andava al lavoro
e parlava spesso di un futuro di
benessere e di abbondanza
		</fo:block>
	<fo:block  font-size="13pt"  text-align="end"  font-family="Times Roman" font-variant="small-caps">
Sherwood Anderson,
	</fo:block>
	<fo:block  font-size="13pt"  text-align="end"  font-family="Times Roman" font-style="italic">
Un povero bianco.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
	</fo:block>
	</fo:flow>
	</fo:page-sequence>
<!-- FINE dediche inserite manualmente -->
</xsl:template>
<!-- le dediche non sono state elaborate -->
<xsl:template match="div[@type='ded']" priority="1"></xsl:template>
<xsl:template match="div[@type='ep']" priority="1"></xsl:template>

<xsl:template match="titlePage">
	<fo:page-sequence master-reference="principale">
	<fo:flow flow-name="xsl-region-body">
		<xsl:apply-templates/>
	</fo:flow>
	</fo:page-sequence>
</xsl:template>

<xsl:template match="docAuthor"><fo:block space-after="3.8cm" font-size="23pt"  text-align="center" 
 font-weight="bold" font-family="Times Roman"><xsl:apply-templates/></fo:block></xsl:template>

<xsl:template match="docTitle"><xsl:apply-templates/></xsl:template>

<xsl:template match="titlePart[@type='main']"><fo:block space-after="10pt" font-size="30pt"  
text-align="center"  font-weight="bold" font-family="Times Roman"><xsl:apply-templates/></fo:block>
</xsl:template>

<xsl:template match="titlePart[@type='sub']"><fo:block space-after="14.7cm" font-size="18pt"  
text-align="center"  font-weight="bold" font-family="Times Roman"><xsl:apply-templates/></fo:block>
</xsl:template>

<xsl:template match="docImprint"><fo:block  font-size="18pt"  text-align="center"  
font-weight="bold" font-family="Times Roman"><xsl:apply-templates/></fo:block></xsl:template>

<!-- FINE FRONT -->

<xsl:template match="body"><xsl:apply-templates/></xsl:template>

<xsl:template match="div0">
	<fo:page-sequence master-reference="principale">
	<fo:flow flow-name="xsl-region-body">
		<fo:block space-after="15pt" font-size="20pt"  text-align="center"  font-weight="bold" 
font-family="Times Roman">
<xsl:value-of select="p"></xsl:value-of>
		</fo:block>
	</fo:flow>
	</fo:page-sequence>
	<xsl:apply-templates/>
</xsl:template>

<xsl:template match="div0/p"></xsl:template>

<xsl:template match="div1">
<fo:page-sequence master-reference="principale">
	<fo:static-content flow-name="xsl-region-before">
            <fo:block text-align="center" font-size="12pt" font-family="sans-serif" 
font-weight="normal" font-style="italic"> MATTEO COLLURA - BALTICO: edizione elettronica</fo:block>
        </fo:static-content>
        <fo:static-content flow-name="xsl-region-after" margin-top="0.5cm">
            <fo:block  space-before="0.7cm" text-align="center" font-size="12pt" 
font-family="sans-serif" font-weight="normal">
				<fo:page-number/>
            </fo:block>
        </fo:static-content>
	<fo:flow flow-name="xsl-region-body" text-align="justify" font-size="14pt" font-family="Verdana, 
Geneva, Arial, Helvetica, sans-serif" font-weight="normal"  line-height="1.7em">
	<xsl:apply-templates/>
	</fo:flow>
	</fo:page-sequence>
</xsl:template>

<xsl:template match="head[@type='ord']">
<fo:block space-after="17pt" font-size="20pt"  text-align="left"  font-weight="bold" 
font-family="Times Roman" id="{../@id}"><xsl:apply-templates/></fo:block>
</xsl:template>

<xsl:template match="head[@type='conv']">
<fo:block space-after="17pt" font-size="20pt"  text-align="left"  font-weight="bold" 
font-family="Times Roman" id="{../@id}"><xsl:apply-templates/></fo:block>
</xsl:template>

<xsl:template match="head[@type='tem']">
			<fo:block space-after="20pt" font-size="17pt"  text-align="left"  font-weight="bold" 
font-family="Times Roman"><xsl:apply-templates/></fo:block>
</xsl:template>

<xsl:template match="p">
	<fo:block text-indent="24pt"><xsl:apply-templates/></fo:block> </xsl:template>

<xsl:template match="back" >
<fo:page-sequence master-reference="principale">
<fo:flow flow-name="xsl-region-body" text-align="justify" font-size="14pt" font-family="Verdana, 
Geneva, Arial, Helvetica, sans-serif" font-weight="normal"  line-height="1.7em">
	<xsl:apply-templates/>
	</fo:flow>
	</fo:page-sequence>
</xsl:template>

<xsl:template match="div/signed">
	<fo:block text-align="end" font-size="14pt" font-family="Verdana, Geneva, Arial, Helvetica, 
sans-serif" font-weight="normal" ><xsl:apply-templates/></fo:block> </xsl:template>

<xsl:template match="l"><fo:block><xsl:apply-templates/></fo:block></xsl:template>


<xsl:template match="*[@rend='bloc']">
<fo:block  margin-left="3.5cm" margin-right="2.5cm"><xsl:apply-templates/></fo:block>
</xsl:template>


<xsl:template match="*[@rend='italic']">
<fo:inline font-style="italic"><xsl:apply-templates/></fo:inline>
</xsl:template>

<xsl:template match="q[@type='epistola']">
	<fo:block text-indent="24pt"><xsl:apply-templates/></fo:block>
	</xsl:template>

<xsl:template match="q/text"><xsl:apply-templates/></xsl:template>

<xsl:template match="q/body"><xsl:apply-templates/></xsl:template>
<!-- inizio INDEX -->

<xsl:template match="text" mode="index"><xsl:apply-templates mode="index"/></xsl:template>

<xsl:template match="front" mode="index"></xsl:template>

<xsl:template match="body" mode="index">	
<fo:page-sequence master-reference="principale">
	<fo:flow flow-name="xsl-region-body">
		<fo:block space-before="1cm" font-size="23pt"  text-align="center"  font-weight="bold" 
font-family="Times Roman">
INDICE
		</fo:block>
	</fo:flow>
	</fo:page-sequence><xsl:apply-templates mode="index"/></xsl:template>

<xsl:template match="div0" mode="index">
<fo:page-sequence master-reference="principale">
	<fo:flow flow-name="xsl-region-body">
		<fo:block space-before="2.5cm" space-after="0.8cm" font-size="13pt"  text-align="center"  
font-family="Times Roman" font-style="italic" text-transform="uppercase">
<xsl:value-of select="p"/>
		</fo:block>
		<fo:table   table-layout="fixed">
                    <fo:table-column column-width="16cm"/>
                    <fo:table-column column-width="1cm"/>
                    <fo:table-body>
	<xsl:apply-templates mode="index"/>
 			      </fo:table-body>
                    </fo:table>

	</fo:flow>
	</fo:page-sequence></xsl:template>

<xsl:template match="div0/p" mode="index"></xsl:template>

<xsl:template match="div1" mode="index">
<xsl:apply-templates mode="index"/>
</xsl:template>

<xsl:template match="head[@type='ord']" mode="index">
	<fo:table-row>
	<fo:table-cell>
	<fo:block  font-size="15pt" font-family="Times Roman">
<xsl:value-of select="."/><xsl:apply-templates mode="index"/>
	</fo:block>
	</fo:table-cell>
	</fo:table-row>
</xsl:template>

<xsl:template match="head[@type='conv']" mode="index">
	<fo:table-row>
	<fo:table-cell>
	<fo:block  font-size="15pt" font-family="Times Roman">
	&#160;
	</fo:block>
	</fo:table-cell>
	</fo:table-row>
	<fo:table-row>
	<fo:table-cell>
	<fo:block  font-size="14pt" font-family="Times Roman">
<xsl:value-of select="."/>&#160;&#160;&#160;&#160;<fo:leader leader-pattern="dots" 
rule-style="solid" rule-thickness="1mm"/>
	</fo:block>
	</fo:table-cell>
	<fo:table-cell>
	<fo:block  font-size="14pt" font-family="Times Roman">
&#160;&#160;<fo:page-number-citation ref-id="{../@id}"/><xsl:apply-templates mode="index"/>
	</fo:block>
	</fo:table-cell>
	</fo:table-row>
</xsl:template>

<xsl:template match="head[@type='tem']" mode="index">
	<fo:table-row>
	<fo:table-cell>
	<fo:block  font-size="14pt" font-family="Times Roman">
<xsl:value-of select="."/>&#160;&#160;&#160;&#160;<fo:leader leader-pattern="dots" 
rule-style="solid" rule-thickness="1mm"/>
	</fo:block>
	</fo:table-cell>
	<fo:table-cell>
	<fo:block  font-size="14pt" font-family="Times Roman">
&#160;&#160;<fo:page-number-citation ref-id="{../@id}"/><xsl:apply-templates mode="index"/>
	</fo:block>
	</fo:table-cell>
	</fo:table-row>
</xsl:template>

<xsl:template match="q/text" mode="index"></xsl:template>

<xsl:template match="q/body" mode="index"></xsl:template>

<xsl:template match="back" mode="index"></xsl:template>

<xsl:template match="text()|@*" mode="index"></xsl:template>	

</xsl:stylesheet>