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">
70 <xsl:apply-templates mode="inline" /><xsl:text>
76 <!-- ========================================== -->
77 <!-- = PARAGRAPH TAGS = -->
78 <!-- = (can contain inline and special tags) = -->
79 <!-- ========================================== -->
81 <xsl:template match="autor_utworu" mode="header">
85 <xsl:apply-templates mode="inline" />
88 <xsl:template match="nazwa_utworu" mode="header">
92 <xsl:apply-templates mode="inline" />
95 <xsl:template match="dzielo_nadrzedne" mode="header">
98 <xsl:apply-templates mode="inline" />
101 <xsl:template match="podtytul" mode="header">
104 <xsl:apply-templates mode="inline" />
107 <!-- Section headers (included in index)-->
108 <xsl:template match="naglowek_akt|naglowek_czesc|srodtytul">
115 <xsl:apply-templates mode="inline" />
118 <xsl:template match="naglowek_scena|naglowek_rozdzial">
124 <xsl:apply-templates mode="inline" />
127 <xsl:template match="naglowek_osoba|naglowek_podrozdzial">
132 <xsl:apply-templates mode="inline" />
135 <!-- Other paragraph tags -->
136 <xsl:template match="miejsce_czas">
142 <xsl:apply-templates mode="inline" />
145 <xsl:template match="didaskalia">
148 / </xsl:text><xsl:apply-templates mode="inline" /><xsl:text> /</xsl:text>
151 <xsl:template match="lista_osoba">
154 <xsl:apply-templates mode="inline" />
157 <xsl:template match="akap|akap_dialog|akap_cd">
161 <xsl:apply-templates mode="inline" />
164 <xsl:template match="strofa">
169 <xsl:when test="count(br) > 0">
170 <xsl:call-template name="verse">
171 <xsl:with-param name="verse-content" select="br[1]/preceding-sibling::text() | br[1]/preceding-sibling::node()" />
172 <xsl:with-param name="verse-type" select="br[1]/preceding-sibling::*[name() = 'wers_wciety' or name() = 'wers_akap' or name() = 'wers_cd'][1]" />
174 <xsl:for-each select="br">
175 <!-- Each BR tag "consumes" text after it -->
176 <xsl:variable name="lnum" select="count(preceding-sibling::br)" />
177 <xsl:call-template name="verse">
178 <xsl:with-param name="verse-content"
179 select="following-sibling::text()[count(preceding-sibling::br) = $lnum+1] | following-sibling::node()[count(preceding-sibling::br) = $lnum+1]" />
180 <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]" />
185 <xsl:call-template name="verse">
186 <xsl:with-param name="verse-content" select="text() | node()" />
187 <xsl:with-param name="verse-type" select="wers_wciety|wers_akap|wers_cd[1]" />
193 <xsl:template name="verse">
194 <xsl:param name="verse-content" />
195 <xsl:param name="verse-type" />
197 <xsl:when test="name($verse-type) = 'wers_akap'">
198 <xsl:text> </xsl:text>
200 <xsl:when test="name($verse-type) = 'wers_wciety'">
202 <xsl:when test="$verse-content/@typ">
203 <xsl:text> </xsl:text>
206 <xsl:text> </xsl:text>
210 <xsl:when test="name($verse-type) = 'wers_cd'">
211 <xsl:text> </xsl:text>
214 <xsl:apply-templates select="$verse-content" mode="inline" />
217 <xsl:template match="motto_podpis">
218 <xsl:apply-templates mode="inline" />
222 <!-- ================================================ -->
223 <!-- = INLINE TAGS = -->
224 <!-- = (contain other inline tags and special tags) = -->
225 <!-- ================================================ -->
227 <xsl:template match="pa|pe|pr|pt" mode="inline" />
229 <!-- Other inline tags -->
230 <xsl:template match="mat" mode="inline"><xsl:apply-templates mode="inline" /></xsl:template>
232 <xsl:template match="didask_tekst" mode="inline"><xsl:apply-templates mode="inline" /></xsl:template>
234 <xsl:template match="slowo_obce" mode="inline"><xsl:apply-templates mode="inline" /></xsl:template>
236 <xsl:template match="tytul_dziela" mode="inline">
237 <xsl:if test="@typ = '1'">„</xsl:if><xsl:apply-templates mode="inline" /><xsl:if test="@typ = '1'">”</xsl:if>
240 <xsl:template match="wyroznienie" mode="inline">
241 <xsl:text>*</xsl:text><xsl:apply-templates mode="inline" /><xsl:text>*</xsl:text>
244 <xsl:template match="osoba" mode="inline">
245 <xsl:apply-templates mode="inline" />
249 <!-- ============================================== -->
250 <!-- = STANDALONE TAGS = -->
251 <!-- = (cannot contain any other tags) = -->
252 <!-- ============================================== -->
253 <xsl:template match="sekcja_swiatlo">
261 <xsl:template match="sekcja_asterysk">
269 <xsl:template match="separator_linia">
272 ------------------------------------------------
278 <!-- ================ -->
279 <!-- = SPECIAL TAGS = -->
280 <!-- ================ -->
282 <xsl:template match="begin" mode="inline" />
284 <xsl:template match="end" mode="inline" />
286 <xsl:template match="begin|end" />
288 <xsl:template match="motyw" mode="inline" />
291 <!-- ================ -->
292 <!-- = IGNORED TAGS = -->
293 <!-- ================ -->
294 <xsl:template match="extra|uwaga" />
295 <xsl:template match="extra|uwaga" mode="inline" />
301 <xsl:template match="text()" />
302 <xsl:template match="text()" mode="inline">
303 <xsl:value-of select="wl:substitute_entities(.)" />