Add podtytul_* tags; refs #4005.
[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="ramka">
71     <div class="frame" xmlns="http://www.w3.org/1999/xhtml">
72       <xsl:apply-templates />
73     </div>
74   </xsl:template>
75
76   <xsl:template match="motto">
77     <div class="motto" xmlns="http://www.w3.org/1999/xhtml">
78       <xsl:apply-templates />
79     </div>
80   </xsl:template>
81
82   <xsl:template match="ilustr">
83     <img>
84       <xsl:attribute name="src">
85         <xsl:value-of select="@src" />
86       </xsl:attribute>
87       <xsl:attribute name="alt">
88         <xsl:value-of select="@alt" />
89       </xsl:attribute>
90       <xsl:attribute name="title">
91         <xsl:value-of select="@alt" />
92       </xsl:attribute>
93     </img>
94   </xsl:template>
95
96   <!--===========================================================-->
97   <!-- Tagi PARAGRAFOWE -->
98   <!--===========================================================-->
99
100   <xsl:template match="autor_utworu" mode="poczatek">
101     <h2 class="author" xmlns="http://www.w3.org/1999/xhtml">
102       <xsl:apply-templates />
103     </h2>
104   </xsl:template>
105
106   <xsl:template match="autor_utworu" />
107
108   <xsl:template match="dzielo_nadrzedne" mode="poczatek">
109     <h2 class="collection" xmlns="http://www.w3.org/1999/xhtml">
110       <xsl:apply-templates />
111     </h2>
112   </xsl:template>
113
114   <xsl:template match="dzielo_nadrzedne" />
115
116   <xsl:template match="nazwa_utworu" mode="poczatek" >
117     <h2 class="intitle" xmlns="http://www.w3.org/1999/xhtml">
118       <xsl:apply-templates />
119     </h2>
120   </xsl:template>
121
122   <xsl:template match="nazwa_utworu" />
123
124   <xsl:template match="podtytul" mode="poczatek">
125     <h2 class="insubtitle" xmlns="http://www.w3.org/1999/xhtml">
126       <xsl:apply-templates />
127     </h2>
128   </xsl:template>
129
130   <xsl:template match="podtytul" />
131
132   <xsl:template match="naglowek_czesc|srodtytul">
133     <h2 class="h2" xmlns="http://www.w3.org/1999/xhtml">
134       <xsl:apply-templates />
135     </h2>
136   </xsl:template>
137
138   <xsl:template match="naglowek_akt">
139     <h2 class="h2" xmlns="http://www.w3.org/1999/xhtml">
140       <xsl:apply-templates />
141     </h2>
142   </xsl:template>
143
144   <xsl:template match="naglowek_scena">
145     <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"><xsl:comment/><!-- hack to keep closing tags --></a>
146     <h2 class="h3" xmlns="http://www.w3.org/1999/xhtml">
147       <xsl:apply-templates />
148     </h2>
149   </xsl:template>
150
151   <xsl:template match="naglowek_podrozdzial">
152     <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"><xsl:comment/><!-- same as above --></a>
153     <h2 class="h4" xmlns="http://www.w3.org/1999/xhtml">
154       <xsl:apply-templates />
155     </h2>
156   </xsl:template>
157
158   <xsl:template match="naglowek_rozdzial">
159     <h2 class="h3" xmlns="http://www.w3.org/1999/xhtml">
160       <xsl:apply-templates />
161     </h2>
162   </xsl:template>
163
164   <xsl:template match="podtytul_czesc|podtytul_akt">
165     <h2 class="h2"><small>
166       <xsl:apply-templates />
167     </small></h2>
168   </xsl:template>
169
170   <xsl:template match="podtytul_rozdzial|podtytul_scena">
171     <h2 class="h3"><small>
172       <xsl:apply-templates />
173     </small></h2>
174   </xsl:template>
175
176   <xsl:template match="podtytul_podrozdzial">
177     <h2 class="h4"><small>
178       <xsl:apply-templates />
179     </small></h2>
180   </xsl:template>
181
182
183   <xsl:template match="naglowek_osoba">
184     <h2 class="h4" xmlns="http://www.w3.org/1999/xhtml">
185       <xsl:apply-templates />
186     </h2>
187   </xsl:template>
188
189   <xsl:template match="miejsce_czas">
190     <div class="place-and-time" xmlns="http://www.w3.org/1999/xhtml">
191       <xsl:apply-templates />
192     </div>
193   </xsl:template>
194
195   <xsl:template match="didaskalia">
196     <div class="didaskalia" xmlns="http://www.w3.org/1999/xhtml">
197       <xsl:apply-templates />
198     </div>
199   </xsl:template>
200
201   <xsl:template match="akap|akap_dialog|akap_cd">
202     <p class="paragraph" xmlns="http://www.w3.org/1999/xhtml">
203       <xsl:apply-templates />
204     </p>
205   </xsl:template>
206
207   <xsl:template match="strofa">
208     <div class="stanza" xmlns="http://www.w3.org/1999/xhtml">
209       <xsl:apply-templates />
210     </div><div class='stanza-spacer' xmlns="http://www.w3.org/1999/xhtml">&#160;</div>
211   </xsl:template>
212
213   <xsl:template match="wers_normalny">
214     <div class="verse" xmlns="http://www.w3.org/1999/xhtml">
215       <xsl:apply-templates />
216     &#160;</div>
217   </xsl:template>
218
219   <xsl:template match="wers_akap">
220     <div class="verse" style="margin-left: 1em;" xmlns="http://www.w3.org/1999/xhtml">
221       <xsl:apply-templates />
222     &#160;</div>
223   </xsl:template>
224
225   <xsl:template match="wers_wciety">
226     <div class="verse" style='margin-left:1em;' xmlns="http://www.w3.org/1999/xhtml">
227       <xsl:apply-templates />
228     &#160;</div>
229   </xsl:template>
230
231   <xsl:template match="wers_do_prawej">
232     <div class="verse" style='text-align: right;' xmlns="http://www.w3.org/1999/xhtml">
233       <xsl:apply-templates/>
234     &#160;</div>
235   </xsl:template>
236
237   <xsl:template match="wers_wciety[@typ!='']">
238     <div class="verse" xmlns="http://www.w3.org/1999/xhtml">
239       <xsl:attribute name="style">
240           margin-left: <xsl:value-of select="@typ" />em;
241       </xsl:attribute>
242       <xsl:apply-templates />
243     &#160;</div>
244   </xsl:template>
245
246   <xsl:template match="wers_cd">
247     <div class="verse" style="margin-left: 12em;" xmlns="http://www.w3.org/1999/xhtml">
248       <xsl:apply-templates />
249     &#160;</div>
250   </xsl:template>
251
252   <xsl:template match="motto_podpis">
253     <div class="motto_podpis" xmlns="http://www.w3.org/1999/xhtml">
254       <xsl:apply-templates />
255     </div>
256   </xsl:template>
257
258   <!--===========================================================-->
259   <!-- Tagi LINIOWE -->
260   <!--===========================================================-->
261
262   <xsl:template match="slowo_obce">
263     <em class="foreign-word" xmlns="http://www.w3.org/1999/xhtml">
264       <xsl:apply-templates />
265     </em>
266   </xsl:template>
267
268   <xsl:template match="mat" >
269     <em class="math" xmlns="http://www.w3.org/1999/xhtml">
270       <xsl:apply-templates />
271     </em>
272   </xsl:template>
273
274   <xsl:template match="didask_tekst" >
275     <em class="didaskalia" xmlns="http://www.w3.org/1999/xhtml">
276       <xsl:apply-templates />
277     </em>
278   </xsl:template>
279
280   <xsl:template match="tytul_dziela" >
281     <em class="book-title" xmlns="http://www.w3.org/1999/xhtml">
282       <xsl:if test="@typ = '1'" >„</xsl:if>
283       <xsl:apply-templates />
284       <xsl:if test="@typ = '1'">”</xsl:if>
285     </em>
286   </xsl:template>
287
288   <xsl:template match="wyroznienie" >
289     <em class="author-emphasis" xmlns="http://www.w3.org/1999/xhtml">
290       <xsl:apply-templates />
291     </em>
292   </xsl:template>
293
294   <xsl:template match="wieksze_odstepy" >
295     <em class="wieksze-odstepy" xmlns="http://www.w3.org/1999/xhtml">
296       <xsl:apply-templates />
297     </em>
298   </xsl:template>
299
300   <xsl:template match="indeks_dolny" >
301     <sub xmlns="http://www.w3.org/1999/xhtml">
302       <xsl:apply-templates />
303     </sub>
304   </xsl:template>
305
306   <xsl:template match="osoba" >
307     <em class="person" xmlns="http://www.w3.org/1999/xhtml">
308       <xsl:apply-templates />
309     </em>
310   </xsl:template>
311
312   <xsl:template match="naglowek_listy"  >
313     <xsl:apply-templates />
314   </xsl:template>
315
316   <xsl:template match="lista_osoba" >
317     <li xmlns="http://www.w3.org/1999/xhtml">
318       <xsl:apply-templates />
319     </li>
320   </xsl:template>
321
322   <!--===========================================================-->
323   <!-- Tagi STANDALONE -->
324   <!--===========================================================-->
325
326   <xsl:template match="sekcja_swiatlo">
327     <p class="spacer" xmlns="http://www.w3.org/1999/xhtml">&#160;</p>
328   </xsl:template>
329
330   <xsl:template match="sekcja_asterysk">
331     <p class="spacer-asterisk" xmlns="http://www.w3.org/1999/xhtml">*</p>
332   </xsl:template>
333
334   <xsl:template match="separator_linia">
335     <hr class="spacer-line" xmlns="http://www.w3.org/1999/xhtml"></hr>
336   </xsl:template>
337
338   <!--===========================================================-->
339   <!-- Tagi SPECJALNE -->
340   <!--===========================================================-->
341
342   <xsl:template match="motyw" />
343
344 <xsl:template match="mat">
345     <img xmlns="http://www.w3.org/1999/xhtml">
346         <xsl:attribute name="src">
347             <xsl:value-of select="wl:mathml(.)" />
348         </xsl:attribute>
349     </img>
350 </xsl:template>
351
352 <xsl:template match="tabela|tabelka">
353     <xsl:choose>
354         <xsl:when test="@ramka = '1'">
355             <table class="border" xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates /></table>
356         </xsl:when>
357         <xsl:otherwise>
358             <table xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates /></table>
359         </xsl:otherwise>
360     </xsl:choose>
361 </xsl:template>
362 <xsl:template match="wiersz">
363   <tr xmlns="http://www.w3.org/1999/xhtml">
364       <xsl:apply-templates />
365   </tr>
366 </xsl:template>
367 <xsl:template match="kol">
368   <td xmlns="http://www.w3.org/1999/xhtml">
369      <xsl:apply-templates />
370   </td>
371 </xsl:template>
372
373
374   <!--===========================================================-->
375   <!-- Tagi IGNOROWANE -->
376   <!--===========================================================-->
377
378   <xsl:template match="extra" />
379
380   <xsl:template match="pe|pa|pr|pt" >
381     <a class="anchor" id="anchor-{.}" href="annotations.html#annotation-{.}"
382        xmlns="http://www.w3.org/1999/xhtml"><sup xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates /></sup></a>
383   </xsl:template>
384
385   <xsl:template match="uwaga" />
386
387   <xsl:template match="nota_red" />
388   <xsl:template match="abstrakt" />
389
390   <!--pominięcie tych metadanych-->
391   <xsl:template match="rdf:RDF" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />
392
393   <!--===========================================================-->
394   <!-- Tagi TEKSTOWE -->
395   <!--===========================================================-->
396
397   <xsl:template match="text()"  >
398     <xsl:value-of select="." />
399   </xsl:template>
400
401   <xsl:template match="text()" >
402     <xsl:value-of select="." />
403   </xsl:template>
404
405 </xsl:stylesheet>