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