increased word spacing in WL XML
[librarian.git] / librarian / epub / xsltScheme.xsl
1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet version="1.0"  xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:wl="http://wolnelektury.pl/functions" exclude-result-prefixes="mml wl">
3   <xsl:output method="html" version="1.0" encoding="utf-8" />
4   <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
5   <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />
6
7   <xsl:template match="/" >
8     <xsl:element name="html" xmlns="http://www.w3.org/1999/xhtml">
9       <xsl:element name="head">
10         <link rel="stylesheet" href="style.css" type="text/css" />
11         <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
12         <title>
13           WolneLektury.pl
14         </title>
15       </xsl:element>
16       <xsl:element name="body" xmlns="http://www.w3.org/1999/xhtml">
17         <xsl:element name="div" xmlns="http://www.w3.org/1999/xhtml">
18           <xsl:attribute name="id">book-text</xsl:attribute>
19           <xsl:if test="//nazwa_utworu">
20             <!--h1 xmlns="http://www.w3.org/1999/xhtml"-->
21               <xsl:apply-templates select=" //nazwa_utworu" mode="poczatek"/>
22               <xsl:apply-templates select=" //podtytul" mode="poczatek"/>
23             <!--/h1-->
24           </xsl:if>
25           <xsl:apply-templates />
26         </xsl:element>
27       </xsl:element>
28     </xsl:element>
29   </xsl:template>
30
31   <!--===========================================================-->
32   <!-- Tagi BLOKOWE -->
33   <!--===========================================================-->
34
35   <xsl:template match="nota">
36     <div class="note" xmlns="http://www.w3.org/1999/xhtml">
37       <xsl:apply-templates />
38     </div>
39   </xsl:template>
40
41   <xsl:template match="lista_osob" >
42     <div class="person-list" xmlns="http://www.w3.org/1999/xhtml">
43       <div class="h3" xmlns="http://www.w3.org/1999/xhtml">
44         <xsl:apply-templates select="child::naglowek_listy" />
45       </div>
46       <ol xmlns="http://www.w3.org/1999/xhtml">
47         <xsl:apply-templates select="lista_osoba" />
48       </ol>
49     </div>
50   </xsl:template>
51
52   <xsl:template match="dedykacja">
53     <div class="dedication" xmlns="http://www.w3.org/1999/xhtml">
54       <xsl:apply-templates />
55     </div>
56   </xsl:template>
57
58   <xsl:template match="kwestia">
59     <div class="kwestia" xmlns="http://www.w3.org/1999/xhtml">
60       <xsl:apply-templates select="strofa|akapit|didaskalia|akap " />
61     </div>
62   </xsl:template>
63
64   <xsl:template match="dlugi_cytat|poezja_cyt">
65     <div class="block" xmlns="http://www.w3.org/1999/xhtml">
66       <xsl:apply-templates />
67     </div>
68   </xsl:template>
69
70   <xsl:template match="motto">
71     <div class="motto" xmlns="http://www.w3.org/1999/xhtml">
72       <xsl:apply-templates />
73     </div>
74   </xsl:template>
75
76   <xsl:template match="ilustr" mode="inline">
77     <xsl:apply-templates select="." />
78   </xsl:template>
79
80   <xsl:template match="ilustr">
81     <img>
82       <xsl:attribute name="src">
83         <xsl:value-of select="@src" />
84       </xsl:attribute>
85       <xsl:attribute name="alt">
86         <xsl:value-of select="@alt" />
87       </xsl:attribute>
88       <xsl:attribute name="title">
89         <xsl:value-of select="@alt" />
90       </xsl:attribute>
91     </img>
92   </xsl:template>
93
94   <!--===========================================================-->
95   <!-- Tagi PARAGRAFOWE -->
96   <!--===========================================================-->
97
98   <xsl:template match="autor_utworu" mode="poczatek">
99     <h2 class="author" xmlns="http://www.w3.org/1999/xhtml">
100       <xsl:apply-templates />
101     </h2>
102   </xsl:template>
103
104   <xsl:template match="autor_utworu" />
105
106   <xsl:template match="dzielo_nadrzedne" mode="poczatek">
107     <h2 class="collection" xmlns="http://www.w3.org/1999/xhtml">
108       <xsl:apply-templates />
109     </h2>
110   </xsl:template>
111
112   <xsl:template match="dzielo_nadrzedne" />
113
114   <xsl:template match="nazwa_utworu" mode="poczatek" >
115     <h2 class="intitle" xmlns="http://www.w3.org/1999/xhtml">
116       <xsl:apply-templates />
117     </h2>
118   </xsl:template>
119
120   <xsl:template match="nazwa_utworu" />
121
122   <xsl:template match="podtytul" mode="poczatek">
123     <h2 class="insubtitle" xmlns="http://www.w3.org/1999/xhtml">
124       <xsl:apply-templates />
125     </h2>
126   </xsl:template>
127
128   <xsl:template match="podtytul" />
129
130   <xsl:template match="naglowek_czesc|srodtytul">
131     <h2 class="h2" xmlns="http://www.w3.org/1999/xhtml">
132       <xsl:apply-templates />
133     </h2>
134   </xsl:template>
135
136   <xsl:template match="naglowek_akt">
137     <h2 class="h2" xmlns="http://www.w3.org/1999/xhtml">
138       <xsl:apply-templates />
139     </h2>
140   </xsl:template>
141
142   <xsl:template match="naglowek_scena">
143     <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"></a>
144     <h2 class="h3" xmlns="http://www.w3.org/1999/xhtml">
145       <xsl:apply-templates />
146     </h2>
147   </xsl:template>
148
149   <xsl:template match="naglowek_podrozdzial">
150     <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"></a>
151     <h2 class="h4" xmlns="http://www.w3.org/1999/xhtml">
152       <xsl:apply-templates />
153     </h2>
154   </xsl:template>
155
156   <xsl:template match="naglowek_rozdzial">
157     <h2 class="h3" xmlns="http://www.w3.org/1999/xhtml">
158       <xsl:apply-templates />
159     </h2>
160   </xsl:template>
161
162   <xsl:template match="naglowek_osoba">
163     <h2 class="h4" xmlns="http://www.w3.org/1999/xhtml">
164       <xsl:apply-templates />
165     </h2>
166   </xsl:template>
167
168   <xsl:template match="miejsce_czas">
169     <div class="place-and-time" xmlns="http://www.w3.org/1999/xhtml">
170       <xsl:apply-templates />
171     </div>
172   </xsl:template>
173
174   <xsl:template match="didaskalia">
175     <div class="didaskalia" xmlns="http://www.w3.org/1999/xhtml">
176       <xsl:apply-templates />
177     </div>
178   </xsl:template>
179
180   <xsl:template match="akap|akap_dialog|akap_cd">
181     <p class="paragraph" xmlns="http://www.w3.org/1999/xhtml">
182       <xsl:apply-templates />
183     </p>
184   </xsl:template>
185
186   <xsl:template match="strofa">
187     <div class="stanza" xmlns="http://www.w3.org/1999/xhtml">
188       <xsl:apply-templates />
189     </div><div class='stanza-spacer' xmlns="http://www.w3.org/1999/xhtml">&#160;</div>
190   </xsl:template>
191
192   <xsl:template match="wers_normalny">
193     <div class="verse" xmlns="http://www.w3.org/1999/xhtml">
194       <xsl:apply-templates />
195     &#160;</div>
196   </xsl:template>
197
198   <xsl:template match="wers_akap">
199     <div class="verse" style="margin-left: 1em;" xmlns="http://www.w3.org/1999/xhtml">
200       <xsl:apply-templates />
201     &#160;</div>
202   </xsl:template>
203
204   <xsl:template match="wers_wciety">
205     <div class="verse" style='margin-left:1em;' xmlns="http://www.w3.org/1999/xhtml">
206       <xsl:apply-templates />
207     &#160;</div>
208   </xsl:template>
209
210   <xsl:template match="wers_do_prawej">
211     <div class="verse" style='text-align: right;' xmlns="http://www.w3.org/1999/xhtml">
212       <xsl:apply-templates/>
213     &#160;</div>
214   </xsl:template>
215
216   <xsl:template match="wers_wciety[@typ!='']">
217     <div class="verse" xmlns="http://www.w3.org/1999/xhtml">
218       <xsl:attribute name="style">
219           margin-left: <xsl:value-of select="@typ" />em;
220       </xsl:attribute>
221       <xsl:apply-templates />
222     &#160;</div>
223   </xsl:template>
224
225   <xsl:template match="wers_cd">
226     <div class="verse" style="margin-left: 12em;" xmlns="http://www.w3.org/1999/xhtml">
227       <xsl:apply-templates />
228     &#160;</div>
229   </xsl:template>
230
231   <xsl:template match="motto_podpis">
232     <div class="motto_podpis" xmlns="http://www.w3.org/1999/xhtml">
233       <xsl:apply-templates />
234     </div>
235   </xsl:template>
236
237   <!--===========================================================-->
238   <!-- Tagi LINIOWE -->
239   <!--===========================================================-->
240
241   <xsl:template match="slowo_obce">
242     <em class="foreign-word" xmlns="http://www.w3.org/1999/xhtml">
243       <xsl:apply-templates />
244     </em>
245   </xsl:template>
246
247   <xsl:template match="mat" >
248     <em class="math" xmlns="http://www.w3.org/1999/xhtml">
249       <xsl:apply-templates />
250     </em>
251   </xsl:template>
252
253   <xsl:template match="didask_tekst" >
254     <em class="didaskalia" xmlns="http://www.w3.org/1999/xhtml">
255       <xsl:apply-templates />
256     </em>
257   </xsl:template>
258
259   <xsl:template match="tytul_dziela" >
260     <em class="book-title" xmlns="http://www.w3.org/1999/xhtml">
261       <xsl:if test="@typ = '1'" >„</xsl:if>
262       <xsl:apply-templates />
263       <xsl:if test="@typ = '1'">”</xsl:if>
264     </em>
265   </xsl:template>
266
267   <xsl:template match="wyroznienie" >
268     <em class="author-emphasis" xmlns="http://www.w3.org/1999/xhtml">
269       <xsl:apply-templates />
270     </em>
271   </xsl:template>
272
273   <xsl:template match="wieksze_odstepy" >
274     <em class="wieksze-odstepy" xmlns="http://www.w3.org/1999/xhtml">
275       <xsl:apply-templates />
276     </em>
277   </xsl:template>
278
279   <xsl:template match="indeks_dolny" >
280     <sub xmlns="http://www.w3.org/1999/xhtml">
281       <xsl:apply-templates />
282     </sub>
283   </xsl:template>
284
285   <xsl:template match="osoba" >
286     <em class="person" xmlns="http://www.w3.org/1999/xhtml">
287       <xsl:apply-templates />
288     </em>
289   </xsl:template>
290
291   <xsl:template match="naglowek_listy"  >
292     <xsl:apply-templates />
293   </xsl:template>
294
295   <xsl:template match="lista_osoba" >
296     <li xmlns="http://www.w3.org/1999/xhtml">
297       <xsl:apply-templates />
298     </li>
299   </xsl:template>
300
301   <!--===========================================================-->
302   <!-- Tagi STANDALONE -->
303   <!--===========================================================-->
304
305   <xsl:template match="sekcja_swiatlo">
306     <p class="spacer" xmlns="http://www.w3.org/1999/xhtml">&#160;</p>
307   </xsl:template>
308
309   <xsl:template match="sekcja_asterysk">
310     <p class="spacer-asterisk" xmlns="http://www.w3.org/1999/xhtml">*</p>
311   </xsl:template>
312
313   <xsl:template match="separator_linia">
314     <hr class="spacer-line" xmlns="http://www.w3.org/1999/xhtml"></hr>
315   </xsl:template>
316
317   <!--===========================================================-->
318   <!-- Tagi SPECJALNE -->
319   <!--===========================================================-->
320
321   <xsl:template match="motyw" />
322
323 <xsl:template match="mat">
324     <img xmlns="http://www.w3.org/1999/xhtml">
325         <xsl:attribute name="src">
326             <xsl:value-of select="wl:mathml(.)" />
327         </xsl:attribute>
328     </img>
329 </xsl:template>
330
331 <xsl:template match="tabela|tabelka">
332   <table xmlns="http://www.w3.org/1999/xhtml">
333     <xsl:apply-templates />
334   </table>
335 </xsl:template>
336 <xsl:template match="wiersz">
337   <tr xmlns="http://www.w3.org/1999/xhtml">
338       <xsl:apply-templates />
339   </tr>
340 </xsl:template>
341 <xsl:template match="kol">
342   <td xmlns="http://www.w3.org/1999/xhtml">
343      <xsl:apply-templates />
344   </td>
345 </xsl:template>
346
347
348   <!--===========================================================-->
349   <!-- Tagi IGNOROWANE -->
350   <!--===========================================================-->
351
352   <xsl:template match="extra" />
353
354   <xsl:template match="pe|pa|pr|pt" >
355     <a class="anchor" id="anchor-{.}" href="annotations.html#annotation-{.}"
356        xmlns="http://www.w3.org/1999/xhtml"><sup xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates /></sup></a>
357   </xsl:template>
358
359   <xsl:template match="uwaga" />
360
361   <xsl:template match="nota_red" />
362   <xsl:template match="abstrakt" />
363
364   <!--pominięcie tych metadanych-->
365   <xsl:template match="rdf:RDF" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />
366
367   <!--===========================================================-->
368   <!-- Tagi TEKSTOWE -->
369   <!--===========================================================-->
370
371   <xsl:template match="text()"  >
372     <xsl:value-of select="." />
373   </xsl:template>
374
375   <xsl:template match="text()" >
376     <xsl:value-of select="." />
377   </xsl:template>
378
379 </xsl:stylesheet>