epub margin for indents
[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="margin-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='margin-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!='']">\r
192     <div class="verse" xmlns="http://www.w3.org/1999/xhtml">\r
193       <xsl:attribute name="style">\r
194           margin-left: <xsl:value-of select="@typ" />em;\r
195       </xsl:attribute>\r
196       <xsl:apply-templates />\r
197     </div>\r
198   </xsl:template>\r
199 \r
200   <xsl:template match="wers_cd">\r
201     <div class="verse" style="margin-left: 12em;" xmlns="http://www.w3.org/1999/xhtml">\r
202       <xsl:apply-templates />\r
203     </div>\r
204   </xsl:template>\r
205 \r
206   <xsl:template match="motto_podpis">\r
207     <div class="motto_podpis" xmlns="http://www.w3.org/1999/xhtml">\r
208       <xsl:apply-templates />\r
209     </div>\r
210   </xsl:template>\r
211 \r
212   <!--===========================================================-->\r
213   <!-- Tagi LINIOWE -->\r
214   <!--===========================================================-->\r
215 \r
216   <xsl:template match="slowo_obce">\r
217     <em class="foreign-word" xmlns="http://www.w3.org/1999/xhtml">\r
218       <xsl:apply-templates />\r
219     </em>\r
220   </xsl:template>\r
221 \r
222   <xsl:template match="mat" >\r
223     <em class="math" xmlns="http://www.w3.org/1999/xhtml">\r
224       <xsl:apply-templates />\r
225     </em>\r
226   </xsl:template>\r
227 \r
228   <xsl:template match="didask_tekst" >\r
229     <em class="didaskalia" xmlns="http://www.w3.org/1999/xhtml">\r
230       <xsl:apply-templates />\r
231     </em>\r
232   </xsl:template>\r
233 \r
234   <xsl:template match="tytul_dziela" >\r
235     <em class="book-title" xmlns="http://www.w3.org/1999/xhtml">\r
236       <xsl:if test="@typ = '1'" >„</xsl:if>\r
237       <xsl:apply-templates />\r
238       <xsl:if test="@typ = '1'">”</xsl:if>\r
239     </em>\r
240   </xsl:template>\r
241 \r
242   <xsl:template match="wyroznienie" >\r
243     <em class="author-emphasis" xmlns="http://www.w3.org/1999/xhtml">\r
244       <xsl:apply-templates />\r
245     </em>\r
246   </xsl:template>\r
247 \r
248   <xsl:template match="osoba" >\r
249     <em class="person" xmlns="http://www.w3.org/1999/xhtml">\r
250       <xsl:apply-templates />\r
251     </em>\r
252   </xsl:template>\r
253 \r
254   <xsl:template match="naglowek_listy"  >\r
255     <xsl:apply-templates />\r
256   </xsl:template>\r
257 \r
258   <xsl:template match="lista_osoba" >\r
259     <li xmlns="http://www.w3.org/1999/xhtml">\r
260       <xsl:apply-templates />\r
261     </li>\r
262   </xsl:template>\r
263 \r
264   <!--===========================================================-->\r
265   <!-- Tagi STANDALONE -->\r
266   <!--===========================================================-->\r
267 \r
268   <xsl:template match="sekcja_swiatlo">\r
269     <hr class="spacer" xmlns="http://www.w3.org/1999/xhtml"></hr>\r
270   </xsl:template>\r
271 \r
272   <xsl:template match="sekcja_asterysk">\r
273     <p class="spacer-asterisk" xmlns="http://www.w3.org/1999/xhtml">*</p>\r
274   </xsl:template>\r
275 \r
276   <xsl:template match="separator_linia">\r
277     <hr class="spacer-line" xmlns="http://www.w3.org/1999/xhtml"></hr>\r
278   </xsl:template>\r
279 \r
280   <!--===========================================================-->\r
281   <!-- Tagi SPECJALNE -->\r
282   <!--===========================================================-->\r
283 \r
284   <xsl:template match="motyw" />\r
285 \r
286   <!--===========================================================-->\r
287   <!-- Tagi IGNOROWANE -->\r
288   <!--===========================================================-->\r
289 \r
290   <xsl:template match="pe|pa|pr|pt" />\r
291 \r
292   <xsl:template match="extra" />\r
293 \r
294   <xsl:template match="pe|pa|pr|pt" >\r
295     <a id="anchor-{.}" class="anchor" href="annotations.html#annotation-{.}" \r
296        xmlns="http://www.w3.org/1999/xhtml">[<xsl:apply-templates />]</a>\r
297   </xsl:template>\r
298 \r
299   <xsl:template match="uwaga" />\r
300 \r
301   <xsl:template match="nota_red" />\r
302 \r
303   <!--pominięcie tych metadanych-->\r
304   <xsl:template match="rdf:RDF" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />\r
305 \r
306   <!--===========================================================-->\r
307   <!-- Tagi TEKSTOWE -->\r
308   <!--===========================================================-->\r
309 \r
310   <xsl:template match="text()"  >\r
311     <xsl:value-of select="." disable-output-escaping="yes"/>\r
312   </xsl:template>\r
313 \r
314   <xsl:template match="text()" >\r
315     <xsl:value-of select="." disable-output-escaping="yes"/>\r
316   </xsl:template>\r
317 \r
318 </xsl:stylesheet>