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