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