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="/">
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 />
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="naglowek_akt|naglowek_czesc">
42 <h2><xsl:apply-templates mode="inline" /></h2>
45 <xsl:template match="naglowek_scena|naglowek_rozdzial">
46 <h3><xsl:apply-templates mode="inline" /></h3>
49 <xsl:template match="naglowek_osoba">
50 <h4><xsl:apply-templates mode="inline" /></h4>
53 <xsl:template match="kwestia">
55 <xsl:apply-templates select="strofa|akap" />
59 <xsl:template match="didaskalia">
60 <div class="didaskalia"><xsl:apply-templates mode="inline" /></div>
63 <xsl:template match="lista_osob">
64 <div class="person-list">
65 <h3><xsl:value-of select="naglowek_listy" /></h3>
67 <xsl:apply-templates select="lista_osoba" />
72 <xsl:template match="lista_osoba">
73 <li><xsl:apply-templates mode="inline" /></li>
76 <xsl:template match="begin" mode="inline">
77 <xsl:variable name="mnum" select="concat('m', substring(@id, 2))" />
78 <span class="theme-begin" fid="{substring(@id, 2)}">
79 <xsl:value-of select="string(following::motyw[@id=$mnum]/text())" />
83 <xsl:template match="end" mode="inline">
84 <span class="theme-end" fid="{substring(@id, 2)}"> </span>
87 <xsl:template match="begin|end">
88 <xsl:apply-templates select='.' mode="inline" />
91 <xsl:template name="verse">
92 <xsl:param name="line-content" />
93 <xsl:param name="line-number" />
96 <xsl:when test="name($line-content) = 'wers_akap'">
97 <xsl:attribute name="style">indent: 1em</xsl:attribute>
99 <xsl:when test="name($line-content) = 'wers_wciety'">
100 <xsl:attribute name="style">indent: 2em</xsl:attribute>
103 <xsl:apply-templates select="$line-content" mode="inline" />
107 <xsl:template match="pa|pe|pr|pt" mode="inline">
108 <a name="{concat('anchor-', generate-id(.))}" />
109 <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>
112 <xsl:template match="strofa">
115 <xsl:when test="count(br) > 0">
116 <xsl:call-template name="verse">
117 <xsl:with-param name="line-content" select="br[1]/preceding-sibling::text() | br[1]/preceding-sibling::node()" />
118 <xsl:with-param name="line-number" select="1" />
120 <xsl:for-each select="br">
121 <!-- Każdy BR "zjada" to co jest za nim -->
122 <xsl:variable name="lnum" select="count(preceding-sibling::br)" />
123 <xsl:call-template name="verse">
124 <xsl:with-param name="line-number" select="$lnum+2" />
125 <xsl:with-param name="line-content"
126 select="following-sibling::text()[count(preceding-sibling::br) = $lnum+1] | following-sibling::node()[count(preceding-sibling::br) = $lnum+1]" />
131 <xsl:call-template name="verse">
132 <xsl:with-param name="line-content" select="text() | node()" />
133 <xsl:with-param name="line-number" select="1" />
140 <xsl:template match="akap|akap_dialog|akap_cd">
141 <p class="paragraph"><xsl:apply-templates mode="inline" /></p>
144 <xsl:template match="motyw" mode="inline" />
146 <xsl:template match="dlugi_cytat">
147 <blockquote><xsl:apply-templates /></blockquote>