<!--
This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
- Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+ Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
<xsl:template name="book-text">
<div id="book-text">
<xsl:apply-templates select="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" />
- <xsl:if test="count(descendant::*[self::pe or self::pa or self::pr or self::pt][not(parent::extra)])">
+ <xsl:if test="count(descendant::*[self::pe or self::pa or self::pr or self::pt or self::ptrad][not(parent::extra)])">
<div id="footnotes">
<h3>Przypisy</h3>
- <xsl:for-each select="descendant::*[self::pe or self::pa or self::pr or self::pt][not(parent::extra)]">
+ <xsl:for-each select="descendant::*[self::pe or self::pa or self::pr or self::pt or self::ptrad][not(parent::extra)]">
<div>
<xsl:attribute name="class">fn-<xsl:value-of select="name()" /></xsl:attribute>
<a name="{concat('footnote-', generate-id(.))}" />
- <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>
+ <a href="{concat('#anchor-', generate-id(.))}" class="annotation">[<xsl:number value="count(preceding::*[self::pa or self::pe or self::pr or self::pt or self::ptrad]) + 1" />]</a>
<xsl:choose>
<xsl:when test="count(akap|akap_cd|strofa) = 0">
<p><xsl:apply-templates select="text()|*" mode="inline" />
<xsl:if test="name()='pt'"> [przypis tłumacza]</xsl:if>
<xsl:if test="name()='pr'"> [przypis redakcyjny]</xsl:if>
<xsl:if test="name()='pe'"> [przypis edytorski]</xsl:if>
+ <xsl:if test="name()='ptrad'"> [przypis tradycyjny]</xsl:if>
</p>
</xsl:when>
<xsl:otherwise>
<xsl:if test="name()='pt'"> [przypis tłumacza]</xsl:if>
<xsl:if test="name()='pr'"> [przypis redakcyjny]</xsl:if>
<xsl:if test="name()='pe'"> [przypis edytorski]</xsl:if>
+ <xsl:if test="name()='ptrad'"> [przypis tradycyjny]</xsl:if>
</p>
</xsl:otherwise>
</xsl:choose>
<xsl:template match="motto">
<xsl:call-template name="section-anchor"/>
- <div class="motto"><xsl:apply-templates /></div>
+ <div class="motto">
+ <xsl:call-template name="block-args" />
+ <xsl:apply-templates />
+ </div>
</xsl:template>
<xsl:template match="ilustr" mode="inline">
<xsl:template match="ilustr">
<div>
+ <xsl:call-template name="block-args" />
<xsl:attribute name="class">
<xsl:text>ilustr </xsl:text>
<xsl:template match="animacja">
<div class="animacja cycle-slideshow" data-cycle-pause-on-hover="true" data-cycle-next="> img" data-cycle-fx="fadeout" data-cycle-paused="true">
+ <xsl:call-template name="block-args" />
<xsl:apply-templates/>
</div>
</xsl:template>
<!-- ========================================== -->
<!-- Title page -->
<xsl:template match="autor_utworu" mode="header">
- <span class="author"><xsl:apply-templates mode="inline" /></span>
+ <span class="author">
+ <xsl:call-template name="block-args" />
+ <xsl:apply-templates mode="inline" />
+ </span>
</xsl:template>
<xsl:template match="nazwa_utworu" mode="header">
- <span class="title"><xsl:apply-templates mode="inline" /></span>
+ <span class="title">
+ <xsl:call-template name="block-args" />
+ <xsl:apply-templates mode="inline" />
+ </span>
</xsl:template>
<xsl:template match="dzielo_nadrzedne" mode="header">
- <span class="collection"><xsl:apply-templates mode="inline" /></span>
+ <span class="collection">
+ <xsl:call-template name="block-args" />
+ <xsl:apply-templates mode="inline" />
+ </span>
</xsl:template>
<xsl:template match="podtytul" mode="header">
- <span class="subtitle"><xsl:apply-templates mode="inline" /></span>
+ <span class="subtitle">
+ <xsl:call-template name="block-args" />
+ <xsl:apply-templates mode="inline" />
+ </span>
</xsl:template>
<!-- Section headers (included in index)-->
<xsl:template match="naglowek_akt|naglowek_czesc|srodtytul">
<xsl:call-template name="section-anchor"/>
- <h2><xsl:apply-templates mode="inline" /></h2>
+ <h2>
+ <xsl:call-template name="block-args" />
+ <xsl:apply-templates mode="inline" />
+ </h2>
</xsl:template>
<xsl:template match="podtytul_akt|podtytul_czesc">
<div class="subtitle2">
+ <xsl:call-template name="block-args" />
<xsl:apply-templates mode="inline" />
</div>
</xsl:template>
<xsl:template match="naglowek_scena|naglowek_rozdzial">
<xsl:call-template name="section-anchor"/>
- <h3><xsl:apply-templates mode="inline" /></h3>
+ <h3>
+ <xsl:call-template name="block-args" />
+ <xsl:apply-templates mode="inline" />
+ </h3>
</xsl:template>
<xsl:template match="podtytul_scena|podtytul_rozdzial">
<div class="subtitle3">
+ <xsl:call-template name="block-args" />
<xsl:apply-templates mode="inline" />
</div>
</xsl:template>
<xsl:template match="naglowek_osoba|naglowek_podrozdzial">
- <xsl:call-template name="section-anchor"/>
- <h4><xsl:apply-templates mode="inline" /></h4>
+ <xsl:call-template name="section-anchor"/>
+ <h4>
+ <xsl:call-template name="block-args" />
+ <xsl:apply-templates mode="inline" />
+ </h4>
</xsl:template>
<xsl:template match="podtytul_podrozdzial">
<div class="subtitle4">
+ <xsl:call-template name="block-args" />
<xsl:apply-templates mode="inline" />
</div>
</xsl:template>
<!-- Other paragraph tags -->
<xsl:template match="miejsce_czas">
- <xsl:call-template name="section-anchor"/>
- <p class="place-and-time"><xsl:apply-templates mode="inline" /></p>
+ <xsl:call-template name="section-anchor"/>
+ <p class="place-and-time">
+ <xsl:call-template name="block-args" />
+ <xsl:apply-templates mode="inline" />
+ </p>
</xsl:template>
<xsl:template match="didaskalia">
- <xsl:call-template name="section-anchor"/>
- <div class="didaskalia"><xsl:apply-templates mode="inline" /></div>
+ <xsl:call-template name="section-anchor"/>
+ <div class="didaskalia">
+ <xsl:call-template name="block-args" />
+ <xsl:apply-templates mode="inline" />
+ </div>
</xsl:template>
<xsl:template match="lista_osoba">
<xsl:template match="akap|akap_dialog|akap_cd">
<p class="paragraph">
+ <xsl:call-template name="block-args" />
<xsl:call-template name="section-anchor"/>
<xsl:apply-templates mode="inline" />
</p>
</xsl:template>
+<xsl:template match="list">
+ <blockquote class="letter"><xsl:apply-templates /></blockquote>
+</xsl:template>
+<xsl:template match="adresat">
+ <p class="paragraph adresat">
+ <xsl:call-template name="block-args" />
+ <xsl:call-template name="section-anchor"/>
+ <xsl:apply-templates mode="inline" />
+ </p>
+</xsl:template>
+<xsl:template match="miejsce_data">
+ <p class="paragraph miejsce_data">
+ <xsl:call-template name="block-args" />
+ <xsl:call-template name="section-anchor"/>
+ <xsl:apply-templates mode="inline" />
+ </p>
+</xsl:template>
+<xsl:template match="naglowek_listu">
+ <p class="paragraph naglowek_listu">
+ <xsl:call-template name="block-args" />
+ <xsl:call-template name="section-anchor"/>
+ <xsl:apply-templates mode="inline" />
+ </p>
+</xsl:template>
+<xsl:template match="pozdrowienie">
+ <p class="paragraph pozdrowienie">
+ <xsl:call-template name="block-args" />
+ <xsl:call-template name="section-anchor"/>
+ <xsl:apply-templates mode="inline" />
+ </p>
+</xsl:template>
+<xsl:template match="podpis">
+ <p class="paragraph podpis">
+ <xsl:call-template name="block-args" />
+ <xsl:call-template name="section-anchor"/>
+ <xsl:apply-templates mode="inline" />
+ </p>
+</xsl:template>
+
<xsl:template match="strofa" mode="inline">
<xsl:apply-templates select="." />
</xsl:template>
<xsl:template match="strofa">
- <div class="stanza">
+ <div class="stanza">
+ <xsl:call-template name="block-args" />
<xsl:call-template name="section-anchor"/>
<xsl:choose>
<xsl:when test="count(br) > 0">
<xsl:param name="verse-content" />
<xsl:param name="verse-type" />
<div class="verse">
+ <xsl:attribute name="class">
+ <xsl:text>verse</xsl:text>
<xsl:choose>
<xsl:when test="name($verse-type) = 'wers_akap'">
- <xsl:attribute name="style">padding-left: 1em</xsl:attribute>
+ <xsl:text> verse-p</xsl:text>
</xsl:when>
<xsl:when test="name($verse-type) = 'wers_wciety'">
- <xsl:choose>
- <xsl:when test="$verse-content/@typ">
- <xsl:attribute name="style">padding-left: <xsl:value-of select="$verse-content/@typ" />em</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style">padding-left: 1em</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:text> verse-indent</xsl:text>
+ <xsl:if test="$verse-content/@typ">
+ <xsl:text> verse-indent-</xsl:text>
+ <xsl:value-of select="$verse-content/@typ" />
+ </xsl:if>
</xsl:when>
<xsl:when test="name($verse-type) = 'wers_cd'">
- <xsl:attribute name="style">padding-left: 12em</xsl:attribute>
+ <xsl:text> verse-cont</xsl:text>
</xsl:when>
<xsl:when test="name($verse-type) = 'wers_do_prawej'">
- <xsl:attribute name="style">text-align: right</xsl:attribute>
+ <xsl:text> verse-right</xsl:text>
</xsl:when>
<xsl:when test="name($verse-type) = 'wers_srodek'">
- <xsl:attribute name="style">text-align: center</xsl:attribute>
+ <xsl:text> verse-center</xsl:text>
</xsl:when>
</xsl:choose>
- <xsl:apply-templates select="$verse-content" mode="inline" />
+ </xsl:attribute>
+ <xsl:apply-templates select="$verse-content" mode="inline" />
</div>
</xsl:template>
<xsl:template match="motto_podpis">
<xsl:call-template name="section-anchor"/>
- <p class="motto_podpis"><xsl:apply-templates mode="inline" /></p>
+ <p class="motto_podpis">
+ <xsl:call-template name="block-args" />
+ <xsl:apply-templates mode="inline" />
+ </p>
</xsl:template>
<xsl:template match="tabela|tabelka">
<xsl:call-template name="section-anchor"/>
<xsl:choose>
<xsl:when test="@ramka = '1'">
- <table class="border"><xsl:apply-templates /></table>
+ <table class="border">
+ <xsl:call-template name="block-args" />
+ <xsl:apply-templates />
+ </table>
</xsl:when>
<xsl:otherwise>
- <table><xsl:apply-templates /></table>
+ <table>
+ <xsl:call-template name="block-args" />
+ <xsl:apply-templates />
+ </table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- = (contain other inline tags and special tags) = -->
<!-- ================================================ -->
<!-- Annotations -->
-<xsl:template match="pa|pe|pr|pt" mode="inline">
+<xsl:template match="pa|pe|pr|pt|ptrad" mode="inline">
<a name="{concat('anchor-', generate-id(.))}" />
- <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>
+ <a href="{concat('#footnote-', generate-id(.))}" class="annotation">[<xsl:number value="count(preceding::*[self::pa or self::pe or self::pr or self::pt or self::ptrad]) + 1" />]</a>
</xsl:template>
<xsl:template match="ref" mode="inline">
</xsl:template>
<xsl:template match="slowo_obce" mode="inline">
- <em class="foreign-word"><xsl:apply-templates mode="inline" /></em>
+ <em>
+ <xsl:attribute name="class">
+ <xsl:text>foreign-word</xsl:text>
+ <xsl:if test="@protect">
+ <xsl:text> foreign-word-protected</xsl:text>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:apply-templates mode="inline" />
+ </em>
</xsl:template>
<xsl:template match="tytul_dziela" mode="inline">
</xsl:template>
+<xsl:template match="werset">
+ <p class="werset paragraph">
+ <xsl:call-template name="block-args" />
+ <xsl:call-template name="section-anchor"/>
+ <xsl:apply-templates mode="inline" />
+ </p>
+</xsl:template>
+
+
<!-- ================ -->
<!-- = IGNORED TAGS = -->
<!-- ================ -->
<a name="{concat('sec', count(ancestor-or-self::*[last()-2]/preceding-sibling::*) + 1)}" />
</xsl:template>
+<xsl:template name="block-args">
+ <xsl:if test="@id">
+ <xsl:attribute name="id">
+ <xsl:text>wl-</xsl:text>
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ </xsl:if>
+</xsl:template>
+
<xsl:template match="numeracja">
<span class="numeracja">
<xsl:attribute name="data-start">
<xsl:value-of select="@start" />
</xsl:attribute>
+ <xsl:attribute name="data-link">
+ <xsl:value-of select="@link" />
+ </xsl:attribute>
</span>
</xsl:template>