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" />
41 <xsl:template match="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny">
42 <xsl:apply-templates />
45 <xsl:template match="naglowek_akt|naglowek_czesc">
46 <h2><xsl:apply-templates mode="inline" /></h2>
49 <xsl:template match="naglowek_scena|naglowek_rozdzial">
50 <h3><xsl:apply-templates mode="inline" /></h3>
53 <xsl:template match="naglowek_osoba">
54 <h4><xsl:apply-templates mode="inline" /></h4>
57 <xsl:template match="kwestia">
59 <xsl:apply-templates select="strofa|akap" />
63 <xsl:template match="didaskalia">
64 <div class="didaskalia"><xsl:apply-templates mode="inline" /></div>
67 <xsl:template match="lista_osob">
68 <div class="person-list">
69 <h3><xsl:value-of select="naglowek_listy" /></h3>
71 <xsl:apply-templates select="lista_osoba" />
76 <xsl:template match="lista_osoba">
77 <li><xsl:apply-templates mode="inline" /></li>
80 <xsl:template match="begin" mode="inline">
81 <xsl:variable name="mnum" select="concat('m', substring(@id, 2))" />
82 <span class="theme-begin" fid="{substring(@id, 2)}">
83 <xsl:value-of select="string(following::motyw[@id=$mnum]/text())" />
87 <xsl:template match="end" mode="inline">
88 <span class="theme-end" fid="{substring(@id, 2)}"> </span>
91 <xsl:template match="begin|end">
92 <xsl:apply-templates select='.' mode="inline" />
95 <xsl:template name="verse">
96 <xsl:param name="line-content" />
97 <xsl:param name="line-number" />
100 <xsl:when test="name($line-content) = 'wers_akap'">
101 <xsl:attribute name="style">indent: 1em</xsl:attribute>
103 <xsl:when test="name($line-content) = 'wers_wciety'">
104 <xsl:attribute name="style">indent: 2em</xsl:attribute>
107 <xsl:apply-templates select="$line-content" mode="inline" />
111 <xsl:template match="pa|pe|pr|pt" mode="inline">
112 <a name="{concat('anchor-', generate-id(.))}" />
113 <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>
116 <xsl:template match="strofa">
119 <xsl:when test="count(br) > 0">
120 <xsl:call-template name="verse">
121 <xsl:with-param name="line-content" select="br[1]/preceding-sibling::text() | br[1]/preceding-sibling::node()" />
122 <xsl:with-param name="line-number" select="1" />
124 <xsl:for-each select="br">
125 <!-- Każdy BR "zjada" to co jest za nim -->
126 <xsl:variable name="lnum" select="count(preceding-sibling::br)" />
127 <xsl:call-template name="verse">
128 <xsl:with-param name="line-number" select="$lnum+2" />
129 <xsl:with-param name="line-content"
130 select="following-sibling::text()[count(preceding-sibling::br) = $lnum+1] | following-sibling::node()[count(preceding-sibling::br) = $lnum+1]" />
135 <xsl:call-template name="verse">
136 <xsl:with-param name="line-content" select="text() | node()" />
137 <xsl:with-param name="line-number" select="1" />
144 <xsl:template match="akap|akap_dialog|akap_cd">
145 <p class="paragraph"><xsl:apply-templates mode="inline" /></p>
148 <xsl:template match="motyw" mode="inline" />
150 <xsl:template match="dlugi_cytat">
151 <blockquote><xsl:apply-templates /></blockquote>