1 <?xml version="1.0" encoding="utf-8"?>
 
   2 <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">
 
   3   <xsl:output method="html" version="1.0" encoding="utf-8" />
 
   4   <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
 
   5   <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />
 
   7   <xsl:template match="/" >
 
   8     <xsl:element name="html" xmlns="http://www.w3.org/1999/xhtml">
 
   9       <xsl:element name="head">
 
  10         <link rel="stylesheet" href="style.css" type="text/css" />
 
  11         <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
 
  16       <xsl:element name="body" xmlns="http://www.w3.org/1999/xhtml">
 
  17         <xsl:element name="div" xmlns="http://www.w3.org/1999/xhtml">
 
  18           <xsl:attribute name="id">book-text</xsl:attribute>
 
  19           <xsl:if test="//nazwa_utworu">
 
  20             <!--h1 xmlns="http://www.w3.org/1999/xhtml"-->
 
  21               <xsl:apply-templates select=" //nazwa_utworu" mode="poczatek"/>
 
  22               <xsl:apply-templates select=" //podtytul" mode="poczatek"/>
 
  25           <xsl:apply-templates />
 
  31   <!--===========================================================-->
 
  33   <!--===========================================================-->
 
  35   <xsl:template match="nota">
 
  36     <div class="note" xmlns="http://www.w3.org/1999/xhtml">
 
  37       <xsl:apply-templates />
 
  41   <xsl:template match="lista_osob" >
 
  42     <div class="person-list" xmlns="http://www.w3.org/1999/xhtml">
 
  43       <div class="h3" xmlns="http://www.w3.org/1999/xhtml">
 
  44         <xsl:apply-templates select="child::naglowek_listy" />
 
  46       <ol xmlns="http://www.w3.org/1999/xhtml">
 
  47         <xsl:apply-templates select="lista_osoba" />
 
  52   <xsl:template match="dedykacja">
 
  53     <div class="dedication" xmlns="http://www.w3.org/1999/xhtml">
 
  54       <xsl:apply-templates />
 
  58   <xsl:template match="kwestia">
 
  59     <div class="kwestia" xmlns="http://www.w3.org/1999/xhtml">
 
  60       <xsl:apply-templates select="strofa|akapit|didaskalia|akap " />
 
  64   <xsl:template match="dlugi_cytat|poezja_cyt">
 
  65     <div class="block" xmlns="http://www.w3.org/1999/xhtml">
 
  66       <xsl:apply-templates />
 
  70   <xsl:template match="ramka">
 
  71     <div class="frame" xmlns="http://www.w3.org/1999/xhtml">
 
  72       <xsl:apply-templates />
 
  76   <xsl:template match="motto">
 
  77     <div class="motto" xmlns="http://www.w3.org/1999/xhtml">
 
  78       <xsl:apply-templates />
 
  82   <xsl:template match="ilustr">
 
  84       <xsl:attribute name="src">
 
  85         <xsl:value-of select="@src" />
 
  87       <xsl:attribute name="alt">
 
  88         <xsl:value-of select="@alt" />
 
  90       <xsl:attribute name="title">
 
  91         <xsl:value-of select="@alt" />
 
  96   <!--===========================================================-->
 
  97   <!-- Tagi PARAGRAFOWE -->
 
  98   <!--===========================================================-->
 
 100   <xsl:template match="autor_utworu" mode="poczatek">
 
 101     <h2 class="author" xmlns="http://www.w3.org/1999/xhtml">
 
 102       <xsl:apply-templates />
 
 106   <xsl:template match="autor_utworu" />
 
 108   <xsl:template match="dzielo_nadrzedne" mode="poczatek">
 
 109     <h2 class="collection" xmlns="http://www.w3.org/1999/xhtml">
 
 110       <xsl:apply-templates />
 
 114   <xsl:template match="dzielo_nadrzedne" />
 
 116   <xsl:template match="nazwa_utworu" mode="poczatek" >
 
 117     <h2 class="intitle" xmlns="http://www.w3.org/1999/xhtml">
 
 118       <xsl:apply-templates />
 
 122   <xsl:template match="nazwa_utworu" />
 
 124   <xsl:template match="podtytul" mode="poczatek">
 
 125     <h2 class="insubtitle" xmlns="http://www.w3.org/1999/xhtml">
 
 126       <xsl:apply-templates />
 
 130   <xsl:template match="podtytul" />
 
 132   <xsl:template match="naglowek_czesc|srodtytul">
 
 133     <h2 class="h2" xmlns="http://www.w3.org/1999/xhtml">
 
 134       <xsl:apply-templates />
 
 138   <xsl:template match="naglowek_akt">
 
 139     <h2 class="h2" xmlns="http://www.w3.org/1999/xhtml">
 
 140       <xsl:apply-templates />
 
 144   <xsl:template match="naglowek_scena">
 
 145     <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"><xsl:comment/><!-- hack to keep closing tags --></a>
 
 146     <h2 class="h3" xmlns="http://www.w3.org/1999/xhtml">
 
 147       <xsl:apply-templates />
 
 151   <xsl:template match="naglowek_podrozdzial">
 
 152     <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"><xsl:comment/><!-- same as above --></a>
 
 153     <h2 class="h4" xmlns="http://www.w3.org/1999/xhtml">
 
 154       <xsl:apply-templates />
 
 158   <xsl:template match="naglowek_rozdzial">
 
 159     <h2 class="h3" xmlns="http://www.w3.org/1999/xhtml">
 
 160       <xsl:apply-templates />
 
 164   <xsl:template match="naglowek_osoba">
 
 165     <h2 class="h4" xmlns="http://www.w3.org/1999/xhtml">
 
 166       <xsl:apply-templates />
 
 170   <xsl:template match="miejsce_czas">
 
 171     <div class="place-and-time" xmlns="http://www.w3.org/1999/xhtml">
 
 172       <xsl:apply-templates />
 
 176   <xsl:template match="didaskalia">
 
 177     <div class="didaskalia" xmlns="http://www.w3.org/1999/xhtml">
 
 178       <xsl:apply-templates />
 
 182   <xsl:template match="akap|akap_dialog|akap_cd">
 
 183     <p class="paragraph" xmlns="http://www.w3.org/1999/xhtml">
 
 184       <xsl:apply-templates />
 
 188   <xsl:template match="strofa">
 
 189     <div class="stanza" xmlns="http://www.w3.org/1999/xhtml">
 
 190       <xsl:apply-templates />
 
 191     </div><div class='stanza-spacer' xmlns="http://www.w3.org/1999/xhtml"> </div>
 
 194   <xsl:template match="wers_normalny">
 
 195     <div class="verse" xmlns="http://www.w3.org/1999/xhtml">
 
 196       <xsl:apply-templates />
 
 200   <xsl:template match="wers_akap">
 
 201     <div class="verse" style="margin-left: 1em;" xmlns="http://www.w3.org/1999/xhtml">
 
 202       <xsl:apply-templates />
 
 206   <xsl:template match="wers_wciety">
 
 207     <div class="verse" style='margin-left:1em;' xmlns="http://www.w3.org/1999/xhtml">
 
 208       <xsl:apply-templates />
 
 212   <xsl:template match="wers_do_prawej">
 
 213     <div class="verse" style='text-align: right;' xmlns="http://www.w3.org/1999/xhtml">
 
 214       <xsl:apply-templates/>
 
 218   <xsl:template match="wers_wciety[@typ!='']">
 
 219     <div class="verse" xmlns="http://www.w3.org/1999/xhtml">
 
 220       <xsl:attribute name="style">
 
 221           margin-left: <xsl:value-of select="@typ" />em;
 
 223       <xsl:apply-templates />
 
 227   <xsl:template match="wers_cd">
 
 228     <div class="verse" style="margin-left: 12em;" xmlns="http://www.w3.org/1999/xhtml">
 
 229       <xsl:apply-templates />
 
 233   <xsl:template match="motto_podpis">
 
 234     <div class="motto_podpis" xmlns="http://www.w3.org/1999/xhtml">
 
 235       <xsl:apply-templates />
 
 239   <!--===========================================================-->
 
 240   <!-- Tagi LINIOWE -->
 
 241   <!--===========================================================-->
 
 243   <xsl:template match="slowo_obce">
 
 244     <em class="foreign-word" xmlns="http://www.w3.org/1999/xhtml">
 
 245       <xsl:apply-templates />
 
 249   <xsl:template match="mat" >
 
 250     <em class="math" xmlns="http://www.w3.org/1999/xhtml">
 
 251       <xsl:apply-templates />
 
 255   <xsl:template match="didask_tekst" >
 
 256     <em class="didaskalia" xmlns="http://www.w3.org/1999/xhtml">
 
 257       <xsl:apply-templates />
 
 261   <xsl:template match="tytul_dziela" >
 
 262     <em class="book-title" xmlns="http://www.w3.org/1999/xhtml">
 
 263       <xsl:if test="@typ = '1'" >„</xsl:if>
 
 264       <xsl:apply-templates />
 
 265       <xsl:if test="@typ = '1'">”</xsl:if>
 
 269   <xsl:template match="wyroznienie" >
 
 270     <em class="author-emphasis" xmlns="http://www.w3.org/1999/xhtml">
 
 271       <xsl:apply-templates />
 
 275   <xsl:template match="wieksze_odstepy" >
 
 276     <em class="wieksze-odstepy" xmlns="http://www.w3.org/1999/xhtml">
 
 277       <xsl:apply-templates />
 
 281   <xsl:template match="indeks_dolny" >
 
 282     <sub xmlns="http://www.w3.org/1999/xhtml">
 
 283       <xsl:apply-templates />
 
 287   <xsl:template match="osoba" >
 
 288     <em class="person" xmlns="http://www.w3.org/1999/xhtml">
 
 289       <xsl:apply-templates />
 
 293   <xsl:template match="naglowek_listy"  >
 
 294     <xsl:apply-templates />
 
 297   <xsl:template match="lista_osoba" >
 
 298     <li xmlns="http://www.w3.org/1999/xhtml">
 
 299       <xsl:apply-templates />
 
 303   <!--===========================================================-->
 
 304   <!-- Tagi STANDALONE -->
 
 305   <!--===========================================================-->
 
 307   <xsl:template match="sekcja_swiatlo">
 
 308     <p class="spacer" xmlns="http://www.w3.org/1999/xhtml"> </p>
 
 311   <xsl:template match="sekcja_asterysk">
 
 312     <p class="spacer-asterisk" xmlns="http://www.w3.org/1999/xhtml">*</p>
 
 315   <xsl:template match="separator_linia">
 
 316     <hr class="spacer-line" xmlns="http://www.w3.org/1999/xhtml"></hr>
 
 319   <!--===========================================================-->
 
 320   <!-- Tagi SPECJALNE -->
 
 321   <!--===========================================================-->
 
 323   <xsl:template match="motyw" />
 
 325 <xsl:template match="mat">
 
 326     <img xmlns="http://www.w3.org/1999/xhtml">
 
 327         <xsl:attribute name="src">
 
 328             <xsl:value-of select="wl:mathml(.)" />
 
 333 <xsl:template match="tabela|tabelka">
 
 335         <xsl:when test="@ramka = '1'">
 
 336             <table class="border" xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates /></table>
 
 339             <table xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates /></table>
 
 343 <xsl:template match="wiersz">
 
 344   <tr xmlns="http://www.w3.org/1999/xhtml">
 
 345       <xsl:apply-templates />
 
 348 <xsl:template match="kol">
 
 349   <td xmlns="http://www.w3.org/1999/xhtml">
 
 350      <xsl:apply-templates />
 
 355   <!--===========================================================-->
 
 356   <!-- Tagi IGNOROWANE -->
 
 357   <!--===========================================================-->
 
 359   <xsl:template match="extra" />
 
 361   <xsl:template match="pe|pa|pr|pt" >
 
 362     <a class="anchor" id="anchor-{.}" href="annotations.html#annotation-{.}"
 
 363        xmlns="http://www.w3.org/1999/xhtml"><sup xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates /></sup></a>
 
 366   <xsl:template match="uwaga" />
 
 368   <xsl:template match="nota_red" />
 
 369   <xsl:template match="abstrakt" />
 
 371   <!--pominięcie tych metadanych-->
 
 372   <xsl:template match="rdf:RDF" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />
 
 374   <!--===========================================================-->
 
 375   <!-- Tagi TEKSTOWE -->
 
 376   <!--===========================================================-->
 
 378   <xsl:template match="text()"  >
 
 379     <xsl:value-of select="." />
 
 382   <xsl:template match="text()" >
 
 383     <xsl:value-of select="." />