1 <?xml version="1.0" encoding="UTF-8"?>
 
   2 <xsl:stylesheet version="1.0"    
 
   3     xmlns="http://www.w3.org/1999/xhtml"    
 
   4     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
   7         Dokument ten opisuje jednoznaczne przekształcenie WLML 0.1 -> XHTML.
 
   9     <xsl:output method="html" omit-xml-declaration="yes" encoding="utf-8" indent="no" />
 
  12         Base tag for rendering a fragment of text
 
  14     <xsl:template match="chunk">        
 
  15         <xsl:apply-templates select="child::node()">            
 
  16             <xsl:with-param name="mixed" select="true()" />
 
  17         </xsl:apply-templates>        
 
  21         Base tag for rendering the whole text 
 
  24     <xsl:template match="utwor">
 
  26             <xsl:call-template name="standard-attributes" />
 
  27             <xsl:apply-templates select="child::node()">
 
  28                 <xsl:with-param name="mixed" select="false()" />
 
  29             </xsl:apply-templates>
 
  34         Przekształcenia poszczególnych elementów zgodnie z:            
 
  35         http://wiki.wolnepodreczniki.pl/Lektury:Sk%C5%82ad/Tagi_sk%C5%82adu
 
  38     <!-- TAGI MASTERÓW STYLÓW
 
  40         Tagi rozpoczynające i kończące tekst utworu lirycznego o standardowej szerokości łamu:
 
  43     <xsl:template match="opowiadanie|powiesc">
 
  44         <xsl:param name="mixed" />
 
  46             <xsl:call-template name="standard-attributes" />
 
  47             <xsl:apply-templates select="child::node()">
 
  48                 <xsl:with-param name="mixed" select="false()" />
 
  49             </xsl:apply-templates>
 
  53     <xsl:template match="liryka_l|liryka_lp">
 
  54         <xsl:param name="mixed" />
 
  56             <xsl:call-template name="standard-attributes" />
 
  57             <xsl:apply-templates select="child::node()">
 
  58                 <xsl:with-param name="mixed" select="false()" />
 
  59             </xsl:apply-templates>
 
  63     <xsl:template match="dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny">
 
  64         <xsl:param name="mixed" />
 
  66             <xsl:call-template name="standard-attributes" />
 
  67             <xsl:apply-templates select="child::node()">
 
  68                 <xsl:with-param name="mixed" select="false()" />
 
  69             </xsl:apply-templates>
 
  73     <xsl:template match="wywiad">
 
  74         <xsl:param name="mixed" />
 
  76             <xsl:call-template name="standard-attributes" />
 
  77             <xsl:apply-templates select="child::node()">
 
  78                 <xsl:with-param name="mixed" select="false()" />
 
  79             </xsl:apply-templates>
 
  84         *****************************
 
  85         ELEMENTY POZA TEKSTEM GŁÓWNYM
 
  86         *****************************
 
  90         Autor składanego utworu
 
  92         Element strony tytułowej - lub odpowiadającej jej przestrzeni,
 
  93         np. na stronie internetowej) :
 
  95         <autor_utworu> imiona-itd.-autora-składanego-utworu </autor_utworu>
 
  97     <xsl:template match="autor_utworu">
 
  98         <xsl:param name="mixed" />
 
  99         <h2 x-editable="true">
 
 100             <xsl:call-template name="standard-attributes" />
 
 101             <xsl:call-template name="context-menu" />
 
 102             <xsl:apply-templates select="child::node()">
 
 103                 <xsl:with-param name="mixed" select="true()" />
 
 104             </xsl:apply-templates>
 
 109         Nazwa składanego utworu
 
 111         Element strony tytułowej - lub odpowiadającej jej przestrzeni,
 
 112         np. na stronie internetowej
 
 114         <nazwa_utworu> tytuł-składanego-utworu </nazwa_utworu>
 
 116     <xsl:template match="nazwa_utworu">
 
 117         <xsl:param name="mixed" />
 
 118         <h1 x-editable="true">
 
 119             <xsl:call-template name="standard-attributes" />
 
 120             <xsl:call-template name="context-menu" />
 
 121             <xsl:apply-templates select="child::node()">
 
 122                 <xsl:with-param name="mixed" select="true()" />
 
 123             </xsl:apply-templates>
 
 128         Nazwa utworu nadrzędnego, w którego skład wchodzi dany utwór
 
 129         <dzielo_nadrzedne> tytuł-dzieła-nadrzędnego </dzielo_nadrzedne>
 
 135             <autor_utworu>Bruno Jasieński</autor_utworu>
 
 136             <dzielo_nadrzedne>But w butonierce</dzielo_nadrzedne>
 
 137             <nazwa_utworu>Deszcz</nazwa_utworu>
 
 140     <xsl:template match="dzielo_nadrzedne">
 
 141         <xsl:param name="mixed" />
 
 142         <h2 x-editable="true">
 
 143             <xsl:call-template name="standard-attributes" />
 
 144             <xsl:call-template name="context-menu" />
 
 145             <xsl:apply-templates select="child::node()">
 
 146                 <xsl:with-param name="mixed" select="true()" />
 
 147             </xsl:apply-templates>
 
 152         Podtytuł, czyli wszystkie dopiski do tytułu
 
 154         Element strony tytułowej - lub odpowiadającej jej przestrzeni.
 
 155         <podtytul> podtytuł-składanego-utworu </podtytul>
 
 160             <autor_utworu>Daniel Defoe</autor_utworu>
 
 161             <nazwa_utworu>Robinson Crusoe</nazwa_utworu>
 
 162             <podtytul>Jego życia losy, doświadczenia i przypadki</podtytul>
 
 165     <xsl:template match="podtytul">
 
 166         <xsl:param name="mixed" />
 
 167         <h3 x-editable="true">
 
 168             <xsl:call-template name="standard-attributes" />
 
 169             <xsl:call-template name="context-menu" />
 
 170             <xsl:apply-templates select="child::node()">
 
 171                 <xsl:with-param name="mixed" select="true()" />
 
 172             </xsl:apply-templates>
 
 177        Tagi obejmujące tekst noty poprzedzającej tekst główny (styl wieloakapitowy):
 
 179         <nota><akap> tekst-noty </akap></nota> (styl wieloakapitowy)
 
 182     <xsl:template match="nota">
 
 183         <xsl:param name="mixed" />
 
 185             <xsl:call-template name="standard-attributes" />
 
 186             <xsl:apply-templates select="child::node()">
 
 187                 <xsl:with-param name="mixed" select="false()" />
 
 188             </xsl:apply-templates>
 
 192     <xsl:template match="nota_red">
 
 193         <xsl:param name="mixed" />
 
 195             <xsl:call-template name="standard-attributes" />
 
 196             <xsl:apply-templates select="child::node()">
 
 197                 <xsl:with-param name="mixed" select="false()" />
 
 198             </xsl:apply-templates>
 
 203         Tagi obejmujące tekst dedykacji (styl wieloakapitowy bądź wielostrofowy):
 
 204         <dedykacja> tekst-dedykacji </dedykacja>
 
 206     <xsl:template match="dedykacja">
 
 207         <xsl:param name="mixed" />
 
 209             <xsl:call-template name="standard-attributes" />
 
 210             <xsl:apply-templates select="child::node()">
 
 211                 <xsl:with-param name="mixed" select="false()" />
 
 212             </xsl:apply-templates>
 
 217         Tagi obejmujące tekst motta (styl wieloakapitowy bądź wielostrofowy):
 
 218         <motto> tekst-motta </motto>
 
 220     <xsl:template match="motto">
 
 221         <xsl:param name="mixed" />
 
 222         <div class="motto_container" data-pass-thru="true">
 
 223         <div x-editable="true">
 
 224             <xsl:call-template name="standard-attributes" />
 
 225             <xsl:apply-templates select="child::node()">
 
 226                 <xsl:with-param name="mixed" select="true()" />
 
 227             </xsl:apply-templates>            
 
 229         <xsl:apply-templates select="following-sibling::*[1][self::motto_podpis]" mode="motto">
 
 230             <xsl:with-param name="mixed" select="true()" />
 
 231         </xsl:apply-templates>
 
 236         Catch stand-alone "motto_podpis" and make then render properly.
 
 237         If not, editing will fail :(.
 
 239         TODO: Make "motto" & "motto_podpis" one block in edit mode (like strofa) 
 
 241     <xsl:template match="motto_podpis[not(preceding-sibling::*[1][self::motto])]">
 
 242         <xsl:apply-templates select="." mode="motto">
 
 243             <xsl:with-param name="mixed" select="true()" />
 
 244         </xsl:apply-templates>
 
 247     <xsl:template match="motto_podpis" mode="motto">
 
 248         <xsl:param name="mixed" />
 
 249         <p x-editable="true">
 
 250             <xsl:call-template name="standard-attributes" />
 
 251             <xsl:call-template name="context-menu" />
 
 252             <xsl:apply-templates select="child::node()">
 
 253                 <xsl:with-param name="mixed" select="true()" />
 
 254             </xsl:apply-templates>
 
 258     <xsl:template match="motto_podpis" />
 
 263         Tagi obejmujące listę osób poprzedzającą tekst dramatu
 
 264           (zwykle składaną na osobnej stronie; to odmiana stylu listy):
 
 266         <lista_osob> osoby </lista_osob>
 
 268     <xsl:template match="lista_osob">
 
 269         <xsl:param name="mixed" />
 
 271             <xsl:call-template name="standard-attributes" />
 
 272             <xsl:apply-templates select="child::node()">
 
 273                 <xsl:with-param name="mixed" select="false()" />
 
 274             </xsl:apply-templates>
 
 278     <xsl:template match="naglowek_listy">
 
 279         <xsl:param name="mixed" />
 
 280         <p x-editable="true">
 
 281             <xsl:call-template name="standard-attributes" />
 
 282             <xsl:call-template name="context-menu" />
 
 283             <xsl:apply-templates select="child::node()">
 
 284                 <xsl:with-param name="mixed" select="true()" />
 
 285             </xsl:apply-templates>
 
 289     <xsl:template match="lista_osoba">
 
 290         <xsl:param name="mixed" />
 
 291         <p x-editable="true">
 
 292             <xsl:call-template name="standard-attributes" />
 
 293             <xsl:call-template name="context-menu" />
 
 294             <xsl:apply-templates select="child::node()">
 
 295                 <xsl:with-param name="mixed" select="true()" />
 
 296             </xsl:apply-templates>
 
 300     <!--  Tagi obejmujące inne komentarze wprowadzające
 
 301         przed tekstem dramatu (składane razem z listą osób):
 
 303         <miejsce_czas> komentarze-wprowadzające </miejsce_czas>
 
 305     <xsl:template match="miejsce_czas">
 
 306         <xsl:param name="mixed" />
 
 307         <p x-editable="true">
 
 308             <xsl:call-template name="standard-attributes" />
 
 309             <xsl:call-template name="context-menu" />
 
 310             <xsl:apply-templates select="child::node()">
 
 311                 <xsl:with-param name="mixed" select="true()" />
 
 312             </xsl:apply-templates>
 
 318         ***************************
 
 319         TAGI STYLÓW TEKSTU GŁÓWNEGO
 
 320         ***************************
 
 324       Tagi nagłówka części/księgi:
 
 325       <naglowek_czesc> nagłówek-części-lub-księgi </naglowek_czesc>
 
 327     <xsl:template match="naglowek_czesc">
 
 328         <xsl:param name="mixed" />
 
 329         <h2 x-editable="true">
 
 330             <xsl:call-template name="standard-attributes" />
 
 331             <xsl:call-template name="context-menu" />
 
 332             <xsl:apply-templates select="child::node()">
 
 333                 <xsl:with-param name="mixed" select="true()" />
 
 334             </xsl:apply-templates>
 
 339       Tagi tytułu rozdziału:
 
 340       <naglowek_rozdzial> nr-i/lub-tytuł </naglowek_rozdzial>
 
 342     <xsl:template match="naglowek_rozdzial">
 
 343         <xsl:param name="mixed" />
 
 344         <h3 x-editable="true">
 
 345             <xsl:call-template name="standard-attributes" />
 
 346             <xsl:call-template name="context-menu" />
 
 347             <xsl:apply-templates select="child::node()">
 
 348                 <xsl:with-param name="mixed" select="true()" />
 
 349             </xsl:apply-templates>
 
 354       Tagi tytułu podrozdziału:
 
 355       <naglowek_podrozdzial> nr-i/lub-podtytuł </naglowek_podrozdzial>
 
 357     <xsl:template match="naglowek_podrozdzial">
 
 358         <xsl:param name="mixed" />
 
 359         <h4 x-editable="true">
 
 360             <xsl:call-template name="standard-attributes" />
 
 361             <xsl:call-template name="context-menu" />
 
 362             <xsl:apply-templates select="child::node()">
 
 363                 <xsl:with-param name="mixed" select="true()" />
 
 364             </xsl:apply-templates>
 
 370        <srodtytul> śródtytuł </srodtytul>
 
 372        Tagi nagłówków aktów:
 
 373        <naglowek_akt> nagłówek-aktu </naglowek_akt>
 
 376     <xsl:template match="srodtytul">
 
 377         <xsl:param name="mixed" />
 
 378         <h2 x-editable="true">
 
 379             <xsl:call-template name="standard-attributes" />
 
 380             <xsl:call-template name="context-menu" />
 
 381             <xsl:apply-templates select="child::node()">
 
 382                 <xsl:with-param name="mixed" select="true()" />
 
 383             </xsl:apply-templates>
 
 387     <xsl:template match="naglowek_akt">
 
 388         <xsl:param name="mixed" />
 
 389         <h2 x-editable="true">
 
 390             <xsl:call-template name="standard-attributes" />
 
 391             <xsl:call-template name="context-menu" />
 
 392             <xsl:apply-templates select="child::node()">
 
 393                 <xsl:with-param name="mixed" select="true()" />
 
 394             </xsl:apply-templates>
 
 400       <naglowek_scena> nagłówek-sceny </naglowek_scena>
 
 403     <xsl:template match="naglowek_scena">
 
 404         <xsl:param name="mixed" />
 
 405         <h3 x-editable="true">
 
 406             <xsl:call-template name="standard-attributes" />
 
 407             <xsl:call-template name="context-menu" />
 
 408             <xsl:apply-templates select="child::node()">
 
 409                 <xsl:with-param name="mixed" select="true()" />
 
 410             </xsl:apply-templates>
 
 414     <xsl:template match="naglowek_osoba">
 
 415         <xsl:param name="mixed" />
 
 416         <h4 x-editable="true">
 
 417             <xsl:call-template name="standard-attributes" />
 
 418             <xsl:call-template name="context-menu" />
 
 419             <xsl:apply-templates select="child::node()">
 
 420                 <xsl:with-param name="mixed" select="true()" />
 
 421             </xsl:apply-templates>
 
 426        ************************
 
 427        Bloki w tekście głównym
 
 428        ************************
 
 431     <xsl:template match="dlugi_cytat">
 
 432         <xsl:param name="mixed" />
 
 434             <xsl:call-template name="standard-attributes" />
 
 435             <xsl:apply-templates select="child::node()">
 
 436                 <xsl:with-param name="mixed" select="false()" />
 
 437             </xsl:apply-templates>
 
 441     <xsl:template match="poezja_cyt">
 
 442         <xsl:param name="mixed" />
 
 444             <xsl:call-template name="standard-attributes" />
 
 445             <xsl:apply-templates select="child::node()">
 
 446                 <xsl:with-param name="mixed" select="false()" />
 
 447             </xsl:apply-templates>
 
 451     <xsl:template match="kwestia">
 
 452         <xsl:param name="mixed" />
 
 454             <xsl:call-template name="standard-attributes" />
 
 455             <xsl:apply-templates select="child::node()">
 
 456                 <xsl:with-param name="mixed" select="false()" />
 
 457             </xsl:apply-templates>
 
 461     <xsl:template match="didaskalia">
 
 462         <xsl:param name="mixed" />
 
 463         <div x-editable="true">
 
 464             <xsl:call-template name="standard-attributes" />
 
 465             <xsl:apply-templates select="child::node()">
 
 466                 <xsl:with-param name="mixed" select="true()" />
 
 467             </xsl:apply-templates>
 
 471     <xsl:template match="wywiad_pyt">
 
 472         <xsl:param name="mixed" />
 
 474             <xsl:call-template name="standard-attributes" />
 
 475             <xsl:apply-templates select="child::node()">
 
 476                 <xsl:with-param name="mixed" select="false()" />
 
 477             </xsl:apply-templates>
 
 481     <xsl:template match="wywiad_odp">
 
 482         <xsl:param name="mixed" />
 
 484             <xsl:call-template name="standard-attributes" />
 
 485             <xsl:apply-templates select="child::node()">
 
 486                 <xsl:with-param name="mixed" select="false()" />
 
 487             </xsl:apply-templates>
 
 492         ***********************************
 
 493         Style akapitowe oraz strofy i wersy
 
 494         ***********************************
 
 497     <xsl:template match="akap">
 
 498         <xsl:param name="mixed" />
 
 499         <p x-editable="true">
 
 500             <xsl:call-template name="standard-attributes" />
 
 501             <xsl:call-template name="context-menu" />
 
 502             <xsl:apply-templates select="child::node()">
 
 503                 <xsl:with-param name="mixed" select="true()" />
 
 504             </xsl:apply-templates>
 
 508     <xsl:template match="akap_cd">
 
 509         <xsl:param name="mixed" />
 
 510         <p x-editable="true">
 
 511             <xsl:call-template name="standard-attributes" />
 
 512             <xsl:call-template name="context-menu" />
 
 513             <xsl:apply-templates select="child::node()">
 
 514                 <xsl:with-param name="mixed" select="true()" />
 
 515             </xsl:apply-templates>
 
 519     <xsl:template match="akap_dialog">
 
 520         <xsl:param name="mixed" />
 
 521         <p x-editable="true">
 
 522             <xsl:call-template name="standard-attributes" />
 
 523             <xsl:call-template name="context-menu" />
 
 524             <xsl:apply-templates select="child::node()">
 
 525                 <xsl:with-param name="mixed" select="true()" />
 
 526             </xsl:apply-templates>
 
 535     <xsl:template match="strofa">
 
 536         <div x-editable="true">
 
 537             <xsl:call-template name="standard-attributes" />
 
 538             <xsl:call-template name="context-menu" />
 
 541                 <xsl:when test="count(br) > 0">
 
 542                     <xsl:variable name="first-verse" select="br[1]/preceding-sibling::node()" />                    
 
 543                     <xsl:call-template name="verse">
 
 544                         <xsl:with-param name="verse-content" select="$first-verse" />                        
 
 546                     <xsl:for-each select="br">
 
 547                         <xsl:variable name="lnum" select="count(preceding-sibling::br)" />
 
 548                         <!-- select all nodes up to the next br or end of stanza -->
 
 549                         <xsl:variable name="current-verse"
 
 550                             select="following-sibling::node()[count(preceding-sibling::br) = $lnum+1]" />                        
 
 551                         <xsl:call-template name="verse">
 
 552                             <xsl:with-param name="verse-content" select="$current-verse" />                            
 
 557                     <xsl:call-template name="verse">
 
 558                         <xsl:with-param name="verse-content" select="child::node()" />                        
 
 565     <xsl:template name="verse">
 
 566         <!-- the verse contents including the last br (if any) -->
 
 567         <xsl:param name="verse-content" />
 
 568         <xsl:variable name="first-tag-name" select="name($verse-content/self::*)" />
 
 569         <!-- name of text nodes is '' == false -->
 
 571         <!-- THIS IS A HORROR!!! -->
 
 572         <!-- Possible variants: -->
 
 574             <!-- Simple verse == not wers_ tags anywhere until the ending br -->
 
 575             <xsl:when test="not($verse-content[starts-with(name(), 'wers_')])">
 
 576                 <p class="wers" x-node="wers" x-verse="true">
 
 577                 <xsl:apply-templates select="$verse-content[local-name(.) != 'br']">
 
 578                     <xsl:with-param name="mixed" select="true()" />
 
 579                 </xsl:apply-templates>
 
 584             <xsl:apply-templates select="$verse-content[local-name(.) != 'br']">
 
 585                 <xsl:with-param name="mixed" select="false()" />
 
 586             </xsl:apply-templates>
 
 591     <xsl:template match="wers_cd|wers_akap|wers_wciety">
 
 592         <xsl:param name="mixed" />
 
 594                 <xsl:when test="ancestor::*[0]/self::strofa"> -->
 
 596                 <xsl:call-template name="standard-attributes" />
 
 597                 <xsl:apply-templates select="child::node()">
 
 598                         <xsl:with-param name="mixed" select="true()" />
 
 599                 </xsl:apply-templates>
 
 605     <xsl:template match="br"><xsl:text>/</xsl:text></xsl:template>
 
 615         Tagi obejmujące tytuł dzieła, np. książki, filmu, piosenki,
 
 616         modlitwy, przedstawienia teatr. itd.:
 
 618         <tytul_dziela> tytuł-dzieła </tytul_dziela>
 
 620     <xsl:template match="tytul_dziela">
 
 621         <xsl:param name="mixed" />
 
 623             <xsl:call-template name="standard-attributes" />
 
 624             <xsl:apply-templates select="child::node()">
 
 625                 <xsl:with-param name="mixed" select="true()" />
 
 626             </xsl:apply-templates>
 
 630     <xsl:template match="wyroznienie|slowo_obce|mat|didask_tekst|osoba|wyp_osoba|www">
 
 631         <xsl:param name="mixed" />
 
 633             <xsl:call-template name="standard-attributes" />
 
 634             <xsl:apply-templates select="child::node()">
 
 635                 <xsl:with-param name="mixed" select="true()" />
 
 636             </xsl:apply-templates>
 
 645     <xsl:template match="sekcja_swiatlo">
 
 646         <xsl:param name="mixed" />
 
 647         <hr><xsl:call-template name="standard-attributes" /></hr>
 
 650     <xsl:template match="sekcja_asterysk">
 
 651         <xsl:param name="mixed" />
 
 652         <p><xsl:call-template name="standard-attributes" /></p>
 
 655     <xsl:template match="separator_linia">
 
 656         <xsl:param name="mixed" />
 
 657         <hr><xsl:call-template name="standard-attributes" /></hr>
 
 660     <xsl:template match="zastepnik_wersu">
 
 661         <xsl:param name="mixed" />
 
 663             <xsl:call-template name="standard-attributes" />
 
 664             <xsl:apply-templates select="child::node()">
 
 665                 <xsl:with-param name="mixed" select="true()" />
 
 666             </xsl:apply-templates>
 
 679     <xsl:template match="pr|pa|pe|pt">       
 
 680         <span x-editable="true" x-common="common">
 
 681             <xsl:call-template name="standard-attributes">
 
 682                 <xsl:with-param name="extra-class" select="'annotation-inline-box'" />
 
 684             <a name="anchor-{generate-id(.)}" />
 
 685             <!-- the link to the non-inline version -->
 
 686             <a href="#annotation-{generate-id(.)}" class="annotation"></a>
 
 687             <!-- inline contents -->
 
 688             <span x-annotation-box="true" x-pass-thru="true">
 
 689                 <xsl:call-template name="context-menu" />
 
 690                 <xsl:apply-templates select="node()">
 
 691                     <xsl:with-param name="mixed" select="true()" />
 
 692                 </xsl:apply-templates>
 
 697     <xsl:template match="begin">        
 
 699             <xsl:call-template name="standard-attributes" />
 
 700             <xsl:attribute name="theme-class">
 
 701                 <xsl:value-of select="substring-after(@id, 'b')" />
 
 706     <xsl:template match="extra|uwaga">
 
 707         <span x-common="common">
 
 708             <xsl:call-template name="standard-attributes" />
 
 709             <xsl:apply-templates select="child::node()">
 
 710                 <xsl:with-param name="mixed" select="true()" />
 
 711             </xsl:apply-templates>
 
 715     <xsl:template match="motyw">
 
 716         <span x-editable="true" x-common="common">
 
 717             <xsl:call-template name="standard-attributes" />
 
 718             <xsl:attribute name="theme-class">
 
 719                 <xsl:value-of select="substring-after(@id, 'm')" />
 
 721             <xsl:call-template name="context-menu" />
 
 722             <span x-pass-thru="true" class="theme-text-list"><xsl:value-of select=".|node()" /></span>
 
 726     <xsl:template match="end">
 
 728             <xsl:call-template name="standard-attributes" />
 
 729             <xsl:attribute name="theme-class">
 
 730                 <xsl:value-of select="substring-after(@id, 'e')" />
 
 735     <xsl:template match="lista">
 
 736       <xsl:variable name="listtag">
 
 738           <xsl:when test="@typ='num' or @typ='alfa'">ol</xsl:when>
 
 739           <xsl:when test="@typ='punkt' or @typ='slowniczek' or @typ='czytelnia'">ul</xsl:when>
 
 740           <xsl:otherwise>ul</xsl:otherwise>
 
 743       <xsl:element name="{$listtag}">
 
 744         <xsl:call-template name="standard-attributes" />
 
 745         <xsl:apply-templates select="child::node()">
 
 746           <xsl:with-param name="mixed" select="true()" />
 
 747         </xsl:apply-templates>  
 
 752     <xsl:template match="punkt[../@typ='slowniczek']">
 
 753       <dl x-node="punkt" class="punkt">
 
 754             <xsl:call-template name="standard-attributes" />
 
 755             <xsl:apply-templates select="child::node()">
 
 756                 <xsl:with-param name="mixed" select="true()" />
 
 757             </xsl:apply-templates>      
 
 761     <xsl:template match="punkt[../@typ!='slowniczek']">
 
 762       <li x-editable="true" x-node="punkt" class="punkt">
 
 763             <xsl:call-template name="standard-attributes" />
 
 764             <xsl:apply-templates select="child::node()">
 
 765                 <xsl:with-param name="mixed" select="true()" />
 
 766             </xsl:apply-templates>      
 
 771     <xsl:template match="definiendum">
 
 772       <dt x-editable="true" x-node="definiendum" class="definiendum">
 
 773             <xsl:call-template name="standard-attributes" />
 
 774             <xsl:apply-templates select="child::node()">
 
 775                 <xsl:with-param name="mixed" select="true()" />
 
 776             </xsl:apply-templates>
 
 780     <xsl:template match="definiens">
 
 781       <dd x-editable="true" x-node="definiendum" class="definiendum">
 
 782             <xsl:call-template name="standard-attributes" />
 
 783             <xsl:apply-templates select="child::node()">
 
 784                 <xsl:with-param name="mixed" select="true()" />
 
 785             </xsl:apply-templates>
 
 790     <xsl:template match="tabela">
 
 791       <table x-node="tabela" class="tabela">
 
 792         <xsl:call-template name="standard-attributes" />
 
 793         <tbody x-pass-thru="true">
 
 794             <xsl:apply-templates select="child::node()">
 
 795                 <xsl:with-param name="mixed" select="true()" />
 
 796             </xsl:apply-templates>
 
 801     <xsl:template match="wiersz">
 
 802       <tr x-node="wiersz" class="wiersz">
 
 803             <xsl:call-template name="standard-attributes" />
 
 804             <xsl:apply-templates select="child::node()">
 
 805                 <xsl:with-param name="mixed" select="true()" />
 
 806             </xsl:apply-templates>
 
 811     <xsl:template match="kol">
 
 812       <td x-pass-thru="true">
 
 813             <div x-editable="true" x-node="kol" class="kol">
 
 814               <!-- this wrapper div is necessary for 
 
 815                    relative element to appear correctly
 
 816                    here it's a 'edit' button -->
 
 817             <xsl:call-template name="standard-attributes" />
 
 818               <xsl:apply-templates select="child::node()">
 
 819                 <xsl:with-param name="mixed" select="true()" />
 
 820               </xsl:apply-templates>
 
 834     <xsl:template match="text()">
 
 835         <!-- <xsl:value-of select="." /> -->
 
 836         <xsl:param name="mixed" />
 
 838             <xsl:when test="normalize-space(.) = ''">
 
 839                 <xsl:value-of select="." />
 
 841             <xsl:when test="not($mixed)">
 
 842                 <span x-node="out-of-flow-text" class="out-of-flow-text" x-editable="true">
 
 843                         <xsl:value-of select="." />
 
 846             <xsl:otherwise><xsl:value-of select="." /></xsl:otherwise>
 
 850     <xsl:template match="comment()">
 
 851         <xsl:comment><xsl:value-of select="." /></xsl:comment>
 
 854     <xsl:template match="*[name() != local-name()]">
 
 856             <xsl:call-template name="standard-attributes" />
 
 857             <xsl:apply-templates select="child::node()">
 
 858                 <xsl:with-param name="mixed" select="true()" />
 
 859             </xsl:apply-templates>
 
 864                 Earlier versions of html2wl introduced a BUG, that 'causes "out-of-flow-text" tag to appear.
 
 865                 Instead of marking it as "unknown", just pass thru it.
 
 866                 Keep a pass-thru span for out-of-flow box editing
 
 868     <xsl:template match="out-of-flow-text">
 
 869         <span data-pass-thru="true">
 
 870             <xsl:apply-templates select="child::node()">
 
 871                 <xsl:with-param name="mixed" select="false()" />
 
 872             </xsl:apply-templates>        
 
 876     <xsl:template match="*">
 
 877         <span class="unknown-tag" x-node="{name()}">
 
 878             <xsl:call-template name="standard-attributes" />
 
 879             <xsl:apply-templates select="child::node()">
 
 880                 <xsl:with-param name="mixed" select="true()" />
 
 881             </xsl:apply-templates>        
 
 885     <xsl:template name="context-menu">
 
 886         <!-- <span class="default-menu context-menu"> -->
 
 887         <!-- <button class="edit-button">Edytuj</button> -->
 
 888             <!-- <span class="delete-button">Delete</span> -->
 
 890         <!-- <span class="edit-menu context-menu">
 
 891             <span class="accept-button">Accept</span>
 
 892             <span class="reject-button">Close</span>
 
 896     <xsl:template name="standard-attributes">
 
 897         <xsl:param name="extra-class" />
 
 898         <xsl:attribute name="class"><xsl:value-of select="local-name()" /><xsl:text> </xsl:text><xsl:value-of select="$extra-class" /></xsl:attribute>
 
 900         <xsl:attribute name="x-node"><xsl:value-of select="local-name()" /></xsl:attribute>
 
 902         <xsl:if test="local-name() != name()">
 
 903             <xsl:attribute name="x-ns"><xsl:value-of select="namespace-uri()" /></xsl:attribute>
 
 906         <xsl:for-each select="@*">
 
 907             <xsl:variable name="id" select="generate-id()" />
 
 908             <xsl:attribute name="x-attr-value-{$id}"><xsl:value-of select="."/></xsl:attribute>
 
 909             <xsl:attribute name="x-attr-name-{$id}"><xsl:value-of select="local-name()"/></xsl:attribute>
 
 911                 <xsl:when test="namespace-uri()">
 
 912                 <xsl:attribute name="x-attr-ns-{$id}"><xsl:value-of select="namespace-uri()"/></xsl:attribute>
 
 914                                 <!-- if the element belongs to default namespace and attribut has no namespace -->
 
 915                 <xsl:when test="not(namespace-uri(.))">
 
 916                                 <xsl:attribute name="data-wlf-{local-name()}"><xsl:value-of select="."/></xsl:attribute>
 
 922     <xsl:template match="alien">
 
 923             <span class="alien" x-pass-thru="true">
 
 924                 <xsl:apply-templates select="node()">
 
 925                     <xsl:with-param name="mixed" select="true()" />
 
 926                 </xsl:apply-templates>
 
 930     <xsl:template match="comment()">
 
 931         <xsl:comment><xsl:value-of select="."/></xsl:comment>