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" />
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"/>
12 <link rel="stylesheet" href="master.css" type="text/css" media="all" charset="utf-8" />
17 font: Georgia, "Times New Roman", serif;
25 text-decoration: none;
28 /* =================================================== */
29 /* = Common elements: headings, paragraphs and lines = */
30 /* =================================================== */
63 /* ======================== */
64 /* = Footnotes and themes = */
65 /* ======================== */
67 border-left: 0.1em solid #DDDDDD;
90 #footnotes .annotation {
105 /* =================== */
106 /* = Custom elements = */
107 /* =================== */
112 margin-bottom: 0.25em;
119 margin-bottom: -0.25em;
142 div.kwestia div.stanza {
162 border-bottom: 0.1em solid #999;
163 padding-bottom: 1.5em;
166 div.note p, div.note p.paragraph {
186 <xsl:apply-templates select="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" />
187 <xsl:if test="count(descendant::*[self::pe or self::pa or self::pr or self::pt][not(parent::extra)])">
190 <xsl:for-each select="descendant::*[self::pe or self::pa or self::pr or self::pt][not(parent::extra)]">
192 <a name="{concat('footnote-', generate-id(.))}" />
193 <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>
195 <xsl:when test="count(akap|akap_cd|strofa) = 0">
196 <p><xsl:apply-templates select="text()|*" mode="inline" /></p>
199 <xsl:apply-templates select="text()|*" mode="inline" />
212 <!-- ============================================================================== -->
213 <!-- = MASTER TAG = -->
214 <!-- = (can contain block tags, paragraph tags, standalone tags and special tags) = -->
215 <!-- ============================================================================== -->
216 <xsl:template match="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny">
217 <xsl:if test="nazwa_utworu">
219 <xsl:apply-templates select="autor_utworu|dzielo_nadrzedne|nazwa_utworu|podtytul" mode="header" />
222 <xsl:apply-templates />
226 <!-- ==================================================================================== -->
227 <!-- = BLOCK TAGS = -->
228 <!-- = (can contain other block tags, paragraph tags, standalone tags and special tags) = -->
229 <!-- ==================================================================================== -->
230 <xsl:template match="nota">
231 <div class="note"><xsl:apply-templates /></div>
234 <xsl:template match="lista_osob">
235 <div class="person-list">
236 <h3><xsl:value-of select="naglowek_listy" /></h3>
238 <xsl:apply-templates select="lista_osoba" />
243 <xsl:template match="dedykacja">
244 <div class="dedication"><xsl:apply-templates /></div>
247 <xsl:template match="kwestia">
248 <div class="kwestia">
249 <xsl:apply-templates select="strofa|akap" />
253 <xsl:template match="dlugi_cytat|poezja_cyt">
254 <blockquote><xsl:apply-templates /></blockquote>
257 <xsl:template match="motto">
258 <div class="motto"><xsl:apply-templates mode="inline" /></div>
262 <!-- ========================================== -->
263 <!-- = PARAGRAPH TAGS = -->
264 <!-- = (can contain inline and special tags) = -->
265 <!-- ========================================== -->
267 <xsl:template match="autor_utworu" mode="header">
268 <span class="author"><xsl:apply-templates mode="inline" /></span>
271 <xsl:template match="nazwa_utworu" mode="header">
272 <span class="title"><xsl:apply-templates mode="inline" /></span>
275 <xsl:template match="dzielo_nadrzedne" mode="header">
276 <span class="collection"><xsl:apply-templates mode="inline" /></span>
279 <xsl:template match="podtytul" mode="header">
280 <span class="subtitle"><xsl:apply-templates mode="inline" /></span>
283 <!-- Section headers (included in index)-->
284 <xsl:template match="naglowek_akt|naglowek_czesc|srodtytul">
285 <h2><xsl:apply-templates mode="inline" /></h2>
288 <xsl:template match="naglowek_scena|naglowek_rozdzial">
289 <h3><xsl:apply-templates mode="inline" /></h3>
292 <xsl:template match="naglowek_osoba|naglowek_podrozdzial">
293 <h4><xsl:apply-templates mode="inline" /></h4>
296 <!-- Other paragraph tags -->
297 <xsl:template match="miejsce_czas">
298 <p class="place-and-time"><xsl:apply-templates mode="inline" /></p>
301 <xsl:template match="didaskalia">
302 <div class="didaskalia"><xsl:apply-templates mode="inline" /></div>
305 <xsl:template match="lista_osoba">
306 <li><xsl:apply-templates mode="inline" /></li>
309 <xsl:template match="akap|akap_dialog|akap_cd">
310 <p class="paragraph"><xsl:apply-templates mode="inline" /></p>
313 <xsl:template match="strofa">
316 <xsl:when test="count(br) > 0">
317 <xsl:call-template name="verse">
318 <xsl:with-param name="line-content" select="br[1]/preceding-sibling::text() | br[1]/preceding-sibling::node()" />
319 <xsl:with-param name="line-number" select="1" />
321 <xsl:for-each select="br">
322 <!-- Each BR tag "consumes" text after it -->
323 <xsl:variable name="lnum" select="count(preceding-sibling::br)" />
324 <xsl:call-template name="verse">
325 <xsl:with-param name="line-number" select="$lnum+2" />
326 <xsl:with-param name="line-content"
327 select="following-sibling::text()[count(preceding-sibling::br) = $lnum+1] | following-sibling::node()[count(preceding-sibling::br) = $lnum+1]" />
332 <xsl:call-template name="verse">
333 <xsl:with-param name="line-content" select="text() | node()" />
334 <xsl:with-param name="line-number" select="1" />
341 <xsl:template name="verse">
342 <xsl:param name="line-content" />
343 <xsl:param name="line-number" />
346 <xsl:when test="name($line-content) = 'wers_akap'">
347 <xsl:attribute name="style">padding-left: 1em</xsl:attribute>
349 <xsl:when test="name($line-content) = 'wers_wciety'">
350 <xsl:attribute name="style">padding-left: <xsl:value-of select="$line-content/@typ" />em</xsl:attribute>
353 <xsl:apply-templates select="$line-content" mode="inline" />
357 <xsl:template match="motto_podpis">
358 <p class="motto_podpis"><xsl:apply-templates mode="inline" /></p>
362 <!-- ================================================ -->
363 <!-- = INLINE TAGS = -->
364 <!-- = (contain other inline tags and special tags) = -->
365 <!-- ================================================ -->
367 <xsl:template match="pa|pe|pr|pt" mode="inline">
368 <a name="{concat('anchor-', generate-id(.))}" />
369 <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>
372 <!-- Other inline tags -->
373 <xsl:template match="mat" mode="inline">
374 <em class="math"><xsl:apply-templates mode="inline" /></em>
377 <xsl:template match="didask_tekst" mode="inline">
378 <em class="didaskalia"><xsl:apply-templates mode="inline" /></em>
381 <xsl:template match="slowo_obce" mode="inline">
382 <em class="foreign-word"><xsl:apply-templates mode="inline" /></em>
385 <xsl:template match="tytul_dziela" mode="inline">
386 <em class="book-title">
387 <xsl:if test="@typ = '1'">„</xsl:if><xsl:apply-templates mode="inline" /><xsl:if test="@typ = '1'">”</xsl:if>
391 <xsl:template match="wyroznienie" mode="inline">
392 <em class="author-emphasis"><xsl:apply-templates mode="inline" /></em>
395 <xsl:template match="osoba" mode="inline">
396 <em class="person"><xsl:apply-templates mode="inline" /></em>
400 <!-- ============================================== -->
401 <!-- = STANDALONE TAGS = -->
402 <!-- = (cannot contain any other tags) = -->
403 <!-- ============================================== -->
404 <xsl:template match="sekcja_swiatlo">
405 <hr class="spacer" />
408 <xsl:template match="sekcja_asterysk">
409 <p class="spacer-asterisk">*</p>
412 <xsl:template match="separator_linia">
413 <hr class="spacer-line" />
417 <!-- ================ -->
418 <!-- = SPECIAL TAGS = -->
419 <!-- ================ -->
421 <xsl:template match="begin" mode="inline">
422 <xsl:variable name="mnum" select="concat('m', substring(@id, 2))" />
423 <a name="m{substring(@id, 2)}" class="theme-begin" fid="{substring(@id, 2)}">
424 <xsl:value-of select="string(following::motyw[@id=$mnum]/text())" />
428 <xsl:template match="end" mode="inline">
429 <span class="theme-end" fid="{substring(@id, 2)}"> </span>
432 <xsl:template match="begin|end">
433 <xsl:apply-templates select='.' mode="inline" />
436 <xsl:template match="motyw" mode="inline" />
439 <!-- ================ -->
440 <!-- = IGNORED TAGS = -->
441 <!-- ================ -->
442 <xsl:template match="extra|uwaga" />
443 <xsl:template match="extra|uwaga" mode="inline" />
449 <xsl:template match="text()" />
450 <xsl:template match="text()" mode="inline">
451 <xsl:value-of select="wl:substitute_entities(.)" />