hack to prevent self-closing <a> tags
[librarian.git] / librarian / epub / xsltScheme.xsl
index 7e866fd..e67cda7 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:stylesheet version="1.0"  xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:wl="http://wolnelektury.pl/functions" exclude-result-prefixes="mml wl">
   <xsl:output method="html" version="1.0" encoding="utf-8" />
   <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
   <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />
     </div>
   </xsl:template>
 
+  <xsl:template match="ramka">
+    <div class="frame" xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates />
+    </div>
+  </xsl:template>
+
   <xsl:template match="motto">
     <div class="motto" xmlns="http://www.w3.org/1999/xhtml">
       <xsl:apply-templates />
     </div>
   </xsl:template>
 
+  <xsl:template match="ilustr">
+    <img>
+      <xsl:attribute name="src">
+        <xsl:value-of select="@src" />
+      </xsl:attribute>
+      <xsl:attribute name="alt">
+        <xsl:value-of select="@alt" />
+      </xsl:attribute>
+      <xsl:attribute name="title">
+        <xsl:value-of select="@alt" />
+      </xsl:attribute>
+    </img>
+  </xsl:template>
+
   <!--===========================================================-->
   <!-- Tagi PARAGRAFOWE -->
   <!--===========================================================-->
   </xsl:template>
 
   <xsl:template match="naglowek_scena">
-    <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"></a>
+    <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"><xsl:comment/><!-- hack to keep closing tags --></a>
     <h2 class="h3" xmlns="http://www.w3.org/1999/xhtml">
       <xsl:apply-templates />
     </h2>
   </xsl:template>
 
   <xsl:template match="naglowek_podrozdzial">
-    <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"></a>
+    <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"><xsl:comment/><!-- same as above --></a>
     <h2 class="h4" xmlns="http://www.w3.org/1999/xhtml">
       <xsl:apply-templates />
     </h2>
   <xsl:template match="strofa">
     <div class="stanza" xmlns="http://www.w3.org/1999/xhtml">
       <xsl:apply-templates />
-    </div><div xmlns="http://www.w3.org/1999/xhtml">&#160;</div>
+    </div><div class='stanza-spacer' xmlns="http://www.w3.org/1999/xhtml">&#160;</div>
   </xsl:template>
 
   <xsl:template match="wers_normalny">
     &#160;</div>
   </xsl:template>
 
+  <xsl:template match="wers_do_prawej">
+    <div class="verse" style='text-align: right;' xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    &#160;</div>
+  </xsl:template>
+
   <xsl:template match="wers_wciety[@typ!='']">
     <div class="verse" xmlns="http://www.w3.org/1999/xhtml">
       <xsl:attribute name="style">
     </em>
   </xsl:template>
 
+  <xsl:template match="wieksze_odstepy" >
+    <em class="wieksze-odstepy" xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates />
+    </em>
+  </xsl:template>
+
+  <xsl:template match="indeks_dolny" >
+    <sub xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates />
+    </sub>
+  </xsl:template>
+
   <xsl:template match="osoba" >
     <em class="person" xmlns="http://www.w3.org/1999/xhtml">
       <xsl:apply-templates />
 
   <xsl:template match="motyw" />
 
+<xsl:template match="mat">
+    <img xmlns="http://www.w3.org/1999/xhtml">
+        <xsl:attribute name="src">
+            <xsl:value-of select="wl:mathml(.)" />
+        </xsl:attribute>
+    </img>
+</xsl:template>
+
+<xsl:template match="tabela|tabelka">
+    <xsl:choose>
+        <xsl:when test="@ramka = '1'">
+            <table class="border" xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates /></table>
+        </xsl:when>
+        <xsl:otherwise>
+            <table xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates /></table>
+        </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+<xsl:template match="wiersz">
+  <tr xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates />
+  </tr>
+</xsl:template>
+<xsl:template match="kol">
+  <td xmlns="http://www.w3.org/1999/xhtml">
+     <xsl:apply-templates />
+  </td>
+</xsl:template>
+
+
   <!--===========================================================-->
   <!-- Tagi IGNOROWANE -->
   <!--===========================================================-->
   <xsl:template match="extra" />
 
   <xsl:template match="pe|pa|pr|pt" >
-    <a id="anchor-{.}" class="anchor" href="annotations.html#annotation-{.}"
-       xmlns="http://www.w3.org/1999/xhtml">[<xsl:apply-templates />]</a>
+    <a class="anchor" id="anchor-{.}" href="annotations.html#annotation-{.}"
+       xmlns="http://www.w3.org/1999/xhtml"><sup xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates /></sup></a>
   </xsl:template>
 
   <xsl:template match="uwaga" />
 
   <xsl:template match="nota_red" />
+  <xsl:template match="abstrakt" />
 
   <!--pominiÄ™cie tych metadanych-->
   <xsl:template match="rdf:RDF" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />
   <!--===========================================================-->
 
   <xsl:template match="text()"  >
-    <xsl:value-of select="." disable-output-escaping="yes"/>
+    <xsl:value-of select="." />
   </xsl:template>
 
   <xsl:template match="text()" >
-    <xsl:value-of select="." disable-output-escaping="yes"/>
+    <xsl:value-of select="." />
   </xsl:template>
 
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>