1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
4 <xsl:output method="xml" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" indent="yes" />
6 <xsl:template match="text()" />
8 <xsl:template match="extra|uwaga" />
9 <xsl:template match="extra|uwaga" mode="inline" />
11 <xsl:template match="utwor">
14 <title>book2html output</title>
15 <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
16 <link rel="stylesheet" href="master.css" type="text/css" media="screen" charset="utf-8" />
19 <xsl:apply-templates select="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" />
22 <xsl:for-each select="descendant::*[self::pe or self::pa or self::pr or self::pt][not(parent::extra)]">
24 <a name="{concat('footnote-', generate-id(.))}" />
25 <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>
27 <xsl:when test="count(akap|akap_cd|strofa) = 0">
28 <p><xsl:apply-templates select="text()|*" mode="inline" /></p>
31 <xsl:apply-templates select="text()|*" mode="inline" />
42 <xsl:template match="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny">
43 <xsl:if test="nazwa_utworu">
45 <xsl:apply-templates select="autor_utworu|dzielo_nadrzedne|nazwa_utworu" mode="header" />
48 <xsl:apply-templates />
51 <xsl:template match="autor_utworu" mode="header">
52 <span class="author"><xsl:apply-templates mode="inline" /></span>
55 <xsl:template match="nazwa_utworu" mode="header">
56 <span class="title"><xsl:apply-templates mode="inline" /></span>
59 <xsl:template match="dzielo_nadrzedne" mode="header">
60 <span class="collection"><xsl:apply-templates mode="inline" /></span>
63 <xsl:template match="naglowek_akt|naglowek_czesc">
64 <h2><xsl:apply-templates mode="inline" /></h2>
67 <xsl:template match="naglowek_scena|naglowek_rozdzial">
68 <h3><xsl:apply-templates mode="inline" /></h3>
71 <xsl:template match="naglowek_osoba">
72 <h4><xsl:apply-templates mode="inline" /></h4>
75 <xsl:template match="kwestia">
77 <xsl:apply-templates select="strofa|akap" />
81 <xsl:template match="didaskalia">
82 <div class="didaskalia"><xsl:apply-templates mode="inline" /></div>
85 <xsl:template match="lista_osob">
86 <div class="person-list">
87 <h3><xsl:value-of select="naglowek_listy" /></h3>
89 <xsl:apply-templates select="lista_osoba" />
94 <xsl:template match="lista_osoba">
95 <li><xsl:apply-templates mode="inline" /></li>
98 <xsl:template match="begin" mode="inline">
99 <xsl:variable name="mnum" select="concat('m', substring(@id, 2))" />
100 <span class="theme-begin" fid="{substring(@id, 2)}">
101 <xsl:value-of select="string(following::motyw[@id=$mnum]/text())" />
105 <xsl:template match="end" mode="inline">
106 <span class="theme-end" fid="{substring(@id, 2)}"> </span>
109 <xsl:template match="begin|end">
110 <xsl:apply-templates select='.' mode="inline" />
113 <xsl:template name="verse">
114 <xsl:param name="line-content" />
115 <xsl:param name="line-number" />
118 <xsl:when test="name($line-content) = 'wers_akap'">
119 <xsl:attribute name="style">indent: 1em</xsl:attribute>
121 <xsl:when test="name($line-content) = 'wers_wciety'">
122 <xsl:attribute name="style">indent: 2em</xsl:attribute>
125 <xsl:apply-templates select="$line-content" mode="inline" />
129 <xsl:template match="pa|pe|pr|pt" mode="inline">
130 <a name="{concat('anchor-', generate-id(.))}" />
131 <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>
134 <xsl:template match="strofa">
137 <xsl:when test="count(br) > 0">
138 <xsl:call-template name="verse">
139 <xsl:with-param name="line-content" select="br[1]/preceding-sibling::text() | br[1]/preceding-sibling::node()" />
140 <xsl:with-param name="line-number" select="1" />
142 <xsl:for-each select="br">
143 <!-- Każdy BR "zjada" to co jest za nim -->
144 <xsl:variable name="lnum" select="count(preceding-sibling::br)" />
145 <xsl:call-template name="verse">
146 <xsl:with-param name="line-number" select="$lnum+2" />
147 <xsl:with-param name="line-content"
148 select="following-sibling::text()[count(preceding-sibling::br) = $lnum+1] | following-sibling::node()[count(preceding-sibling::br) = $lnum+1]" />
153 <xsl:call-template name="verse">
154 <xsl:with-param name="line-content" select="text() | node()" />
155 <xsl:with-param name="line-number" select="1" />
162 <xsl:template match="akap|akap_dialog|akap_cd">
163 <p class="paragraph"><xsl:apply-templates mode="inline" /></p>
166 <xsl:template match="motyw" mode="inline" />
168 <xsl:template match="dlugi_cytat">
169 <blockquote><xsl:apply-templates /></blockquote>