1 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2 xmlns:wl="http://wolnelektury.pl/functions" >
4 <xsl:output encoding="utf-8" indent="yes" omit-xml-declaration = "yes" version="2.0" />
7 <xsl:template match="utwor">
10 <title>Książka z serwisu WolneLektury.pl</title>
11 <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
16 font: Georgia, "Times New Roman", serif;
24 text-decoration: none;
27 /* =================================================== */
28 /* = Common elements: headings, paragraphs and lines = */
29 /* =================================================== */
62 /* ======================== */
63 /* = Footnotes and themes = */
64 /* ======================== */
66 border-left: 0.1em solid #DDDDDD;
87 #footnotes .annotation {
107 /* =================== */
108 /* = Custom elements = */
109 /* =================== */
114 margin-bottom: 0.25em;
121 margin-bottom: -0.25em;
144 div.kwestia div.stanza {
164 border-bottom: 0.1em solid #999;
165 padding-bottom: 1.5em;
168 div.note p, div.note p.paragraph {
180 margin: -0.25em -0.5em;
186 padding: 0.25em 0.5em;
190 .anchor:hover, #book-text .anchor:active {
192 background-color: #CCC;
201 <xsl:apply-templates select="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" />
202 <xsl:if test="count(descendant::*[self::pe or self::pa or self::pr or self::pt][not(parent::extra)])">
205 <xsl:for-each select="descendant::*[self::pe or self::pa or self::pr or self::pt][not(parent::extra)]">
207 <a name="{concat('footnote-', generate-id(.))}" />
208 <a href="{concat('#anchor-', generate-id(.))}" class="annotation">[<xsl:number value="count(preceding::*[self::pa or self::pe or self::pr or self::pt]) + 1" />]</a>
210 <xsl:when test="count(akap|akap_cd|strofa) = 0">
211 <p><xsl:apply-templates select="text()|*" mode="inline" /></p>
214 <xsl:apply-templates select="text()|*" mode="inline" />
227 <!-- ============================================================================== -->
228 <!-- = MASTER TAG = -->
229 <!-- = (can contain block tags, paragraph tags, standalone tags and special tags) = -->
230 <!-- ============================================================================== -->
231 <xsl:template match="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny">
232 <xsl:if test="nazwa_utworu">
234 <xsl:apply-templates select="autor_utworu|dzielo_nadrzedne|nazwa_utworu|podtytul" mode="header" />
237 <xsl:apply-templates />
241 <!-- ==================================================================================== -->
242 <!-- = BLOCK TAGS = -->
243 <!-- = (can contain other block tags, paragraph tags, standalone tags and special tags) = -->
244 <!-- ==================================================================================== -->
245 <xsl:template match="nota">
246 <div class="note"><xsl:apply-templates /></div>
249 <xsl:template match="lista_osob">
250 <div class="person-list">
251 <h3><xsl:value-of select="naglowek_listy" /></h3>
253 <xsl:apply-templates select="lista_osoba" />
258 <xsl:template match="dedykacja">
259 <div class="dedication"><xsl:apply-templates /></div>
262 <xsl:template match="kwestia">
263 <div class="kwestia">
264 <xsl:apply-templates select="strofa|akap|didaskalia" />
268 <xsl:template match="dlugi_cytat|poezja_cyt">
269 <blockquote><xsl:apply-templates /></blockquote>
272 <xsl:template match="motto">
273 <div class="motto"><xsl:apply-templates mode="inline" /></div>
277 <!-- ========================================== -->
278 <!-- = PARAGRAPH TAGS = -->
279 <!-- = (can contain inline and special tags) = -->
280 <!-- ========================================== -->
282 <xsl:template match="autor_utworu" mode="header">
283 <span class="author"><xsl:apply-templates mode="inline" /></span>
286 <xsl:template match="nazwa_utworu" mode="header">
287 <span class="title"><xsl:apply-templates mode="inline" /></span>
290 <xsl:template match="dzielo_nadrzedne" mode="header">
291 <span class="collection"><xsl:apply-templates mode="inline" /></span>
294 <xsl:template match="podtytul" mode="header">
295 <span class="subtitle"><xsl:apply-templates mode="inline" /></span>
298 <!-- Section headers (included in index)-->
299 <xsl:template match="naglowek_akt|naglowek_czesc|srodtytul">
300 <h2><xsl:apply-templates mode="inline" /></h2>
303 <xsl:template match="naglowek_scena|naglowek_rozdzial">
304 <h3><xsl:apply-templates mode="inline" /></h3>
307 <xsl:template match="naglowek_osoba|naglowek_podrozdzial">
308 <h4><xsl:apply-templates mode="inline" /></h4>
311 <!-- Other paragraph tags -->
312 <xsl:template match="miejsce_czas">
313 <p class="place-and-time"><xsl:apply-templates mode="inline" /></p>
316 <xsl:template match="didaskalia">
317 <div class="didaskalia"><xsl:apply-templates mode="inline" /></div>
320 <xsl:template match="lista_osoba">
321 <li><xsl:apply-templates mode="inline" /></li>
324 <xsl:template match="akap|akap_dialog|akap_cd">
325 <p class="paragraph"><xsl:apply-templates mode="inline" /></p>
328 <xsl:template match="strofa">
331 <xsl:when test="count(br) > 0">
332 <xsl:call-template name="verse">
333 <xsl:with-param name="verse-content" select="br[1]/preceding-sibling::text() | br[1]/preceding-sibling::node()" />
334 <xsl:with-param name="verse-type" select="br[1]/preceding-sibling::*[name() = 'wers_wciety' or name() = 'wers_akap' or name() = 'wers_cd'][1]" />
336 <xsl:for-each select="br">
337 <!-- Each BR tag "consumes" text after it -->
338 <xsl:variable name="lnum" select="count(preceding-sibling::br)" />
339 <xsl:call-template name="verse">
340 <xsl:with-param name="verse-content"
341 select="following-sibling::text()[count(preceding-sibling::br) = $lnum+1] | following-sibling::node()[count(preceding-sibling::br) = $lnum+1]" />
342 <xsl:with-param name="verse-type" select="following-sibling::*[count(preceding-sibling::br) = $lnum+1 and (name() = 'wers_wciety' or name() = 'wers_akap' or name() = 'wers_cd')][1]" />
347 <xsl:call-template name="verse">
348 <xsl:with-param name="verse-content" select="text() | node()" />
349 <xsl:with-param name="verse-type" select="wers_wciety|wers_akap|wers_cd[1]" />
356 <xsl:template name="verse">
357 <xsl:param name="verse-content" />
358 <xsl:param name="verse-type" />
361 <xsl:when test="name($verse-type) = 'wers_akap'">
362 <xsl:attribute name="style">padding-left: 1em</xsl:attribute>
364 <xsl:when test="name($verse-type) = 'wers_wciety'">
366 <xsl:when test="$verse-content/@typ">
367 <xsl:attribute name="style">padding-left: <xsl:value-of select="$verse-content/@typ" />em</xsl:attribute>
370 <xsl:attribute name="style">padding-left: 1em</xsl:attribute>
374 <xsl:when test="name($verse-type) = 'wers_cd'">
375 <xsl:attribute name="style">padding-left: 12em</xsl:attribute>
378 <xsl:apply-templates select="$verse-content" mode="inline" />
382 <xsl:template match="motto_podpis">
383 <p class="motto_podpis"><xsl:apply-templates mode="inline" /></p>
387 <!-- ================================================ -->
388 <!-- = INLINE TAGS = -->
389 <!-- = (contain other inline tags and special tags) = -->
390 <!-- ================================================ -->
392 <xsl:template match="pa|pe|pr|pt" mode="inline">
393 <a name="{concat('anchor-', generate-id(.))}" />
394 <a href="{concat('#footnote-', generate-id(.))}" class="annotation">[<xsl:number value="count(preceding::*[self::pa or self::pe or self::pr or self::pt]) + 1" />]</a>
397 <!-- Other inline tags -->
398 <xsl:template match="mat" mode="inline">
399 <em class="math"><xsl:apply-templates mode="inline" /></em>
402 <xsl:template match="didask_tekst" mode="inline">
403 <em class="didaskalia"><xsl:apply-templates mode="inline" /></em>
406 <xsl:template match="slowo_obce" mode="inline">
407 <em class="foreign-word"><xsl:apply-templates mode="inline" /></em>
410 <xsl:template match="tytul_dziela" mode="inline">
411 <em class="book-title">
412 <xsl:if test="@typ = '1'">„</xsl:if><xsl:apply-templates mode="inline" /><xsl:if test="@typ = '1'">”</xsl:if>
416 <xsl:template match="wyroznienie" mode="inline">
417 <em class="author-emphasis"><xsl:apply-templates mode="inline" /></em>
420 <xsl:template match="osoba" mode="inline">
421 <em class="person"><xsl:apply-templates mode="inline" /></em>
425 <!-- ============================================== -->
426 <!-- = STANDALONE TAGS = -->
427 <!-- = (cannot contain any other tags) = -->
428 <!-- ============================================== -->
429 <xsl:template match="sekcja_swiatlo">
430 <hr class="spacer" />
433 <xsl:template match="sekcja_asterysk">
434 <p class="spacer-asterisk">*</p>
437 <xsl:template match="separator_linia">
438 <hr class="spacer-line" />
442 <!-- ================ -->
443 <!-- = SPECIAL TAGS = -->
444 <!-- ================ -->
446 <xsl:template match="begin" mode="inline">
447 <xsl:variable name="mnum" select="concat('m', substring(@id, 2))" />
448 <a name="m{substring(@id, 2)}" class="theme-begin" fid="{substring(@id, 2)}">
449 <xsl:value-of select="string(following::motyw[@id=$mnum]/text())" />
453 <xsl:template match="end" mode="inline">
454 <span class="theme-end" fid="{substring(@id, 2)}"> </span>
457 <xsl:template match="begin|end">
458 <xsl:apply-templates select='.' mode="inline" />
461 <xsl:template match="motyw" mode="inline" />
464 <!-- ================ -->
465 <!-- = IGNORED TAGS = -->
466 <!-- ================ -->
467 <xsl:template match="extra|uwaga" />
468 <xsl:template match="extra|uwaga" mode="inline" />
474 <xsl:template match="text()" />
475 <xsl:template match="text()" mode="inline">
476 <xsl:value-of select="wl:substitute_entities(.)" />