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" method="text" />
6 <!-- ============================================================================== -->
7 <!-- = MASTER TAG = -->
8 <!-- = (can contain block tags, paragraph tags, standalone tags and special tags) = -->
9 <!-- ============================================================================== -->
10 <xsl:template match="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny">
11 <xsl:text>Kodowanie znaków w dokumencie: UTF-8.
13 Publikacja zrealizowana w ramach projektu Wolne Lektury (http://wolnelektury.pl/). Reprodukcja cyfrowa wykonana przez
14 Bibliotekę Narodową z egzemplarza pochodzącego ze zbiorów BN. Ten utwór nie jest chroniony prawem autorskim i znajduje
15 się w domenie publicznej, co oznacza, że możesz go swobodnie wykorzystywać, publikować i rozpowszechniać.
17 Wersja lektury w opracowaniu merytorycznym i krytycznym (przypisy i motywy) dostępna jest na stronie %s.
22 <xsl:if test="nazwa_utworu"><xsl:apply-templates select="autor_utworu|dzielo_nadrzedne|nazwa_utworu|podtytul" mode="header" /></xsl:if>
26 <xsl:apply-templates />
30 <!-- ==================================================================================== -->
31 <!-- = BLOCK TAGS = -->
32 <!-- = (can contain other block tags, paragraph tags, standalone tags and special tags) = -->
33 <!-- ==================================================================================== -->
34 <xsl:template match="nota">
35 <xsl:apply-templates />
38 <xsl:template match="lista_osob">
43 <xsl:value-of select="naglowek_listy" />
44 <xsl:apply-templates select="lista_osoba" />
49 <xsl:template match="dedykacja">
53 <xsl:apply-templates />
56 <xsl:template match="kwestia">
57 <xsl:apply-templates select="strofa|akap|didaskalia" />
60 <xsl:template match="dlugi_cytat|poezja_cyt">
63 <xsl:apply-templates />
66 <xsl:template match="motto">
72 <xsl:apply-templates /><xsl:text>
78 <!-- ========================================== -->
79 <!-- = PARAGRAPH TAGS = -->
80 <!-- = (can contain inline and special tags) = -->
81 <!-- ========================================== -->
83 <xsl:template match="autor_utworu" mode="header">
87 <xsl:apply-templates mode="inline" />
90 <xsl:template match="nazwa_utworu" mode="header">
94 <xsl:apply-templates mode="inline" />
97 <xsl:template match="dzielo_nadrzedne" mode="header">
101 <xsl:apply-templates mode="inline" />
104 <xsl:template match="podtytul" mode="header">
107 <xsl:apply-templates mode="inline" />
110 <!-- Section headers (included in index)-->
111 <xsl:template match="naglowek_akt|naglowek_czesc|srodtytul">
118 <xsl:apply-templates mode="inline" />
121 <xsl:template match="naglowek_scena|naglowek_rozdzial">
127 <xsl:apply-templates mode="inline" />
130 <xsl:template match="naglowek_osoba|naglowek_podrozdzial">
135 <xsl:apply-templates mode="inline" />
138 <!-- Other paragraph tags -->
139 <xsl:template match="miejsce_czas">
145 <xsl:apply-templates mode="inline" />
148 <xsl:template match="didaskalia">
149 <xsl:variable name="content">
150 <xsl:apply-templates select="*|text()" mode="inline" />
154 / </xsl:text><xsl:value-of select="wl:wrap_words(wl:strip($content))" /><xsl:text> /</xsl:text>
157 <xsl:template match="lista_osoba">
160 <xsl:apply-templates mode="inline" />
163 <xsl:template match="akap|akap_dialog|akap_cd">
164 <xsl:variable name="content">
165 <xsl:apply-templates select="*|text()" mode="inline" />
170 <xsl:value-of select="wl:wrap_words(wl:strip($content))" />
173 <xsl:template match="strofa">
177 <xsl:when test="count(br) > 0">
178 <xsl:call-template name="verse">
179 <xsl:with-param name="verse-content" select="br[1]/preceding-sibling::text() | br[1]/preceding-sibling::node()" />
180 <xsl:with-param name="verse-type" select="br[1]/preceding-sibling::*[name() = 'wers_wciety' or name() = 'wers_akap' or name() = 'wers_cd'][1]" />
182 <xsl:for-each select="br">
183 <!-- Each BR tag "consumes" text after it -->
184 <xsl:variable name="lnum" select="count(preceding-sibling::br)" />
185 <xsl:call-template name="verse">
186 <xsl:with-param name="verse-content"
187 select="following-sibling::text()[count(preceding-sibling::br) = $lnum+1] | following-sibling::node()[count(preceding-sibling::br) = $lnum+1]" />
188 <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]" />
193 <xsl:call-template name="verse">
194 <xsl:with-param name="verse-content" select="text() | node()" />
195 <xsl:with-param name="verse-type" select="wers_wciety|wers_akap|wers_cd[1]" />
201 <xsl:template name="verse">
202 <xsl:param name="verse-content" />
203 <xsl:param name="verse-type" />
206 <xsl:variable name="content">
207 <xsl:apply-templates select="$verse-content" mode="inline" />
210 <xsl:when test="name($verse-type) = 'wers_akap'">
211 <xsl:text> </xsl:text>
213 <xsl:when test="name($verse-type) = 'wers_wciety'">
215 <xsl:when test="$verse-content/@typ">
216 <xsl:text> </xsl:text>
219 <xsl:text> </xsl:text>
223 <xsl:when test="name($verse-type) = 'wers_cd'">
224 <xsl:text> </xsl:text>
227 <xsl:value-of select="wl:strip($content)" />
230 <xsl:template match="motto_podpis">
231 <xsl:apply-templates mode="inline" />
235 <!-- ================================================ -->
236 <!-- = INLINE TAGS = -->
237 <!-- = (contain other inline tags and special tags) = -->
238 <!-- ================================================ -->
240 <xsl:template match="pa|pe|pr|pt" mode="inline" />
242 <!-- Other inline tags -->
243 <xsl:template match="mat" mode="inline"><xsl:apply-templates mode="inline" /></xsl:template>
245 <xsl:template match="didask_tekst" mode="inline"><xsl:apply-templates mode="inline" /></xsl:template>
247 <xsl:template match="slowo_obce" mode="inline"><xsl:apply-templates mode="inline" /></xsl:template>
249 <xsl:template match="tytul_dziela" mode="inline">
250 <xsl:if test="@typ = '1'">„</xsl:if><xsl:apply-templates mode="inline" /><xsl:if test="@typ = '1'">”</xsl:if>
253 <xsl:template match="wyroznienie" mode="inline">
254 <xsl:text>*</xsl:text><xsl:apply-templates mode="inline" /><xsl:text>*</xsl:text>
257 <xsl:template match="osoba" mode="inline">
258 <xsl:apply-templates mode="inline" />
262 <!-- ============================================== -->
263 <!-- = STANDALONE TAGS = -->
264 <!-- = (cannot contain any other tags) = -->
265 <!-- ============================================== -->
266 <xsl:template match="sekcja_swiatlo">
274 <xsl:template match="sekcja_asterysk">
282 <xsl:template match="separator_linia">
285 ------------------------------------------------
291 <!-- ================ -->
292 <!-- = SPECIAL TAGS = -->
293 <!-- ================ -->
295 <xsl:template match="begin" mode="inline" />
297 <xsl:template match="end" mode="inline" />
299 <xsl:template match="begin|end" />
301 <xsl:template match="motyw" mode="inline" />
304 <!-- ================ -->
305 <!-- = IGNORED TAGS = -->
306 <!-- ================ -->
307 <xsl:template match="extra|uwaga" />
308 <xsl:template match="extra|uwaga" mode="inline" />
314 <xsl:template match="text()" />
315 <xsl:template match="text()" mode="inline">
316 <xsl:value-of select="wl:substitute_entities(.)" />