letters
[librarian.git] / src / librarian / xslt / book2html.xslt
index 390d147..b128b7e 100644 (file)
 <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>
     </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: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>
 
 <!-- = (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 = -->
 <!-- ================ -->
                <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>