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>
 
 193         Tagi obejmujące tekst dedykacji (styl wieloakapitowy bądź wielostrofowy):
 
 194         <dedykacja> tekst-dedykacji </dedykacja>
 
 196     <xsl:template match="dedykacja">
 
 197         <xsl:param name="mixed" />
 
 199             <xsl:call-template name="standard-attributes" />
 
 200             <xsl:apply-templates select="child::node()">
 
 201                 <xsl:with-param name="mixed" select="false()" />
 
 202             </xsl:apply-templates>
 
 207         Tagi obejmujące tekst motta (styl wieloakapitowy bądź wielostrofowy):
 
 208         <motto> tekst-motta </motto>
 
 210     <xsl:template match="motto">
 
 211         <xsl:param name="mixed" />
 
 212         <div class="motto_container" data-pass-thru="true">
 
 213         <div x-editable="true">
 
 214             <xsl:call-template name="standard-attributes" />
 
 215             <xsl:apply-templates select="child::node()">
 
 216                 <xsl:with-param name="mixed" select="true()" />
 
 217             </xsl:apply-templates>            
 
 219         <xsl:apply-templates select="following-sibling::*[1][self::motto_podpis]" mode="motto">
 
 220             <xsl:with-param name="mixed" select="true()" />
 
 221         </xsl:apply-templates>
 
 226         Catch stand-alone "motto_podpis" and make then render properly.
 
 227         If not, editing will fail :(.
 
 229         TODO: Make "motto" & "motto_podpis" one block in edit mode (like strofa) 
 
 231     <xsl:template match="motto_podpis[not(preceding-sibling::*[1][self::motto])]">
 
 232         <xsl:apply-templates select="." mode="motto">
 
 233             <xsl:with-param name="mixed" select="true()" />
 
 234         </xsl:apply-templates>
 
 237     <xsl:template match="motto_podpis" mode="motto">
 
 238         <xsl:param name="mixed" />
 
 239         <p x-editable="true">
 
 240             <xsl:call-template name="standard-attributes" />
 
 241             <xsl:call-template name="context-menu" />
 
 242             <xsl:apply-templates select="child::node()">
 
 243                 <xsl:with-param name="mixed" select="true()" />
 
 244             </xsl:apply-templates>
 
 248     <xsl:template match="motto_podpis" />
 
 253         Tagi obejmujące listę osób poprzedzającą tekst dramatu
 
 254           (zwykle składaną na osobnej stronie; to odmiana stylu listy):
 
 256         <lista_osob> osoby </lista_osob>
 
 258     <xsl:template match="lista_osob">
 
 259         <xsl:param name="mixed" />
 
 261             <xsl:call-template name="standard-attributes" />
 
 262             <xsl:apply-templates select="child::node()">
 
 263                 <xsl:with-param name="mixed" select="false()" />
 
 264             </xsl:apply-templates>
 
 268     <xsl:template match="naglowek_listy">
 
 269         <xsl:param name="mixed" />
 
 270         <p x-editable="true">
 
 271             <xsl:call-template name="standard-attributes" />
 
 272             <xsl:call-template name="context-menu" />
 
 273             <xsl:apply-templates select="child::node()">
 
 274                 <xsl:with-param name="mixed" select="true()" />
 
 275             </xsl:apply-templates>
 
 279     <xsl:template match="lista_osoba">
 
 280         <xsl:param name="mixed" />
 
 281         <p x-editable="true">
 
 282             <xsl:call-template name="standard-attributes" />
 
 283             <xsl:call-template name="context-menu" />
 
 284             <xsl:apply-templates select="child::node()">
 
 285                 <xsl:with-param name="mixed" select="true()" />
 
 286             </xsl:apply-templates>
 
 290     <!--  Tagi obejmujące inne komentarze wprowadzające
 
 291         przed tekstem dramatu (składane razem z listą osób):
 
 293         <miejsce_czas> komentarze-wprowadzające </miejsce_czas>
 
 295     <xsl:template match="miejsce_czas">
 
 296         <xsl:param name="mixed" />
 
 297         <p x-editable="true">
 
 298             <xsl:call-template name="standard-attributes" />
 
 299             <xsl:call-template name="context-menu" />
 
 300             <xsl:apply-templates select="child::node()">
 
 301                 <xsl:with-param name="mixed" select="true()" />
 
 302             </xsl:apply-templates>
 
 308         ***************************
 
 309         TAGI STYLÓW TEKSTU GŁÓWNEGO
 
 310         ***************************
 
 314       Tagi nagłówka części/księgi:
 
 315       <naglowek_czesc> nagłówek-części-lub-księgi </naglowek_czesc>
 
 317     <xsl:template match="naglowek_czesc">
 
 318         <xsl:param name="mixed" />
 
 319         <h2 x-editable="true">
 
 320             <xsl:call-template name="standard-attributes" />
 
 321             <xsl:call-template name="context-menu" />
 
 322             <xsl:apply-templates select="child::node()">
 
 323                 <xsl:with-param name="mixed" select="true()" />
 
 324             </xsl:apply-templates>
 
 329       Tagi tytułu rozdziału:
 
 330       <naglowek_rozdzial> nr-i/lub-tytuł </naglowek_rozdzial>
 
 332     <xsl:template match="naglowek_rozdzial">
 
 333         <xsl:param name="mixed" />
 
 334         <h3 x-editable="true">
 
 335             <xsl:call-template name="standard-attributes" />
 
 336             <xsl:call-template name="context-menu" />
 
 337             <xsl:apply-templates select="child::node()">
 
 338                 <xsl:with-param name="mixed" select="true()" />
 
 339             </xsl:apply-templates>
 
 344       Tagi tytułu podrozdziału:
 
 345       <naglowek_podrozdzial> nr-i/lub-podtytuł </naglowek_podrozdzial>
 
 347     <xsl:template match="naglowek_podrozdzial">
 
 348         <xsl:param name="mixed" />
 
 349         <h4 x-editable="true">
 
 350             <xsl:call-template name="standard-attributes" />
 
 351             <xsl:call-template name="context-menu" />
 
 352             <xsl:apply-templates select="child::node()">
 
 353                 <xsl:with-param name="mixed" select="true()" />
 
 354             </xsl:apply-templates>
 
 360        <srodtytul> śródtytuł </srodtytul>
 
 362        Tagi nagłówków aktów:
 
 363        <naglowek_akt> nagłówek-aktu </naglowek_akt>
 
 366     <xsl:template match="srodtytul">
 
 367         <xsl:param name="mixed" />
 
 368         <h2 x-editable="true">
 
 369             <xsl:call-template name="standard-attributes" />
 
 370             <xsl:call-template name="context-menu" />
 
 371             <xsl:apply-templates select="child::node()">
 
 372                 <xsl:with-param name="mixed" select="true()" />
 
 373             </xsl:apply-templates>
 
 377     <xsl:template match="naglowek_akt">
 
 378         <xsl:param name="mixed" />
 
 379         <h2 x-editable="true">
 
 380             <xsl:call-template name="standard-attributes" />
 
 381             <xsl:call-template name="context-menu" />
 
 382             <xsl:apply-templates select="child::node()">
 
 383                 <xsl:with-param name="mixed" select="true()" />
 
 384             </xsl:apply-templates>
 
 390       <naglowek_scena> nagłówek-sceny </naglowek_scena>
 
 393     <xsl:template match="naglowek_scena">
 
 394         <xsl:param name="mixed" />
 
 395         <h3 x-editable="true">
 
 396             <xsl:call-template name="standard-attributes" />
 
 397             <xsl:call-template name="context-menu" />
 
 398             <xsl:apply-templates select="child::node()">
 
 399                 <xsl:with-param name="mixed" select="true()" />
 
 400             </xsl:apply-templates>
 
 404     <xsl:template match="naglowek_osoba">
 
 405         <xsl:param name="mixed" />
 
 406         <h4 x-editable="true">
 
 407             <xsl:call-template name="standard-attributes" />
 
 408             <xsl:call-template name="context-menu" />
 
 409             <xsl:apply-templates select="child::node()">
 
 410                 <xsl:with-param name="mixed" select="true()" />
 
 411             </xsl:apply-templates>
 
 416        ************************
 
 417        Bloki w tekście głównym
 
 418        ************************
 
 421     <xsl:template match="dlugi_cytat">
 
 422         <xsl:param name="mixed" />
 
 424             <xsl:call-template name="standard-attributes" />
 
 425             <xsl:apply-templates select="child::node()">
 
 426                 <xsl:with-param name="mixed" select="false()" />
 
 427             </xsl:apply-templates>
 
 431     <xsl:template match="poezja_cyt">
 
 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="kwestia">
 
 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="didaskalia">
 
 452         <xsl:param name="mixed" />
 
 453         <div x-editable="true">
 
 454             <xsl:call-template name="standard-attributes" />
 
 455             <xsl:apply-templates select="child::node()">
 
 456                 <xsl:with-param name="mixed" select="true()" />
 
 457             </xsl:apply-templates>
 
 461     <xsl:template match="wywiad_pyt">
 
 462         <xsl:param name="mixed" />
 
 464             <xsl:call-template name="standard-attributes" />
 
 465             <xsl:apply-templates select="child::node()">
 
 466                 <xsl:with-param name="mixed" select="false()" />
 
 467             </xsl:apply-templates>
 
 471     <xsl:template match="wywiad_odp">
 
 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>
 
 482         ***********************************
 
 483         Style akapitowe oraz strofy i wersy
 
 484         ***********************************
 
 487     <xsl:template match="akap">
 
 488         <xsl:param name="mixed" />
 
 489         <p x-editable="true">
 
 490             <xsl:call-template name="standard-attributes" />
 
 491             <xsl:call-template name="context-menu" />
 
 492             <xsl:apply-templates select="child::node()">
 
 493                 <xsl:with-param name="mixed" select="true()" />
 
 494             </xsl:apply-templates>
 
 498     <xsl:template match="akap_cd">
 
 499         <xsl:param name="mixed" />
 
 500         <p x-editable="true">
 
 501             <xsl:call-template name="standard-attributes" />
 
 502             <xsl:call-template name="context-menu" />
 
 503             <xsl:apply-templates select="child::node()">
 
 504                 <xsl:with-param name="mixed" select="true()" />
 
 505             </xsl:apply-templates>
 
 509     <xsl:template match="akap_dialog">
 
 510         <xsl:param name="mixed" />
 
 511         <p x-editable="true">
 
 512             <xsl:call-template name="standard-attributes" />
 
 513             <xsl:call-template name="context-menu" />
 
 514             <xsl:apply-templates select="child::node()">
 
 515                 <xsl:with-param name="mixed" select="true()" />
 
 516             </xsl:apply-templates>
 
 525     <xsl:template match="strofa">
 
 526         <div x-editable="true">
 
 527             <xsl:call-template name="standard-attributes" />
 
 528             <xsl:call-template name="context-menu" />
 
 531                 <xsl:when test="count(br) > 0">
 
 532                     <xsl:variable name="first-verse" select="br[1]/preceding-sibling::node()" />                    
 
 533                     <xsl:call-template name="verse">
 
 534                         <xsl:with-param name="verse-content" select="$first-verse" />                        
 
 536                     <xsl:for-each select="br">
 
 537                         <xsl:variable name="lnum" select="count(preceding-sibling::br)" />
 
 538                         <!-- select all nodes up to the next br or end of stanza -->
 
 539                         <xsl:variable name="current-verse"
 
 540                             select="following-sibling::node()[count(preceding-sibling::br) = $lnum+1]" />                        
 
 541                         <xsl:call-template name="verse">
 
 542                             <xsl:with-param name="verse-content" select="$current-verse" />                            
 
 547                     <xsl:call-template name="verse">
 
 548                         <xsl:with-param name="verse-content" select="child::node()" />                        
 
 555     <xsl:template name="verse">
 
 556         <!-- the verse contents including the last br (if any) -->
 
 557         <xsl:param name="verse-content" />
 
 558         <xsl:variable name="first-tag-name" select="name($verse-content/self::*)" />
 
 559         <!-- name of text nodes is '' == false -->
 
 561         <!-- THIS IS A HORROR!!! -->
 
 562         <!-- Possible variants: -->
 
 564             <!-- Simple verse == not wers_ tags anywhere until the ending br -->
 
 565             <xsl:when test="not($verse-content[starts-with(name(), 'wers_')])">
 
 566                 <p class="wers" x-node="wers" x-verse="true">
 
 567                 <xsl:apply-templates select="$verse-content[local-name(.) != 'br']">
 
 568                     <xsl:with-param name="mixed" select="true()" />
 
 569                 </xsl:apply-templates>
 
 574             <xsl:apply-templates select="$verse-content[local-name(.) != 'br']">
 
 575                 <xsl:with-param name="mixed" select="false()" />
 
 576             </xsl:apply-templates>
 
 581     <xsl:template match="wers_cd|wers_akap|wers_wciety">
 
 582         <xsl:param name="mixed" />
 
 584                 <xsl:when test="ancestor::*[0]/self::strofa"> -->
 
 586                 <xsl:call-template name="standard-attributes" />
 
 587                 <xsl:apply-templates select="child::node()">
 
 588                         <xsl:with-param name="mixed" select="true()" />
 
 589                 </xsl:apply-templates>
 
 595     <xsl:template match="br"><xsl:text>/</xsl:text></xsl:template>
 
 605         Tagi obejmujące tytuł dzieła, np. książki, filmu, piosenki,
 
 606         modlitwy, przedstawienia teatr. itd.:
 
 608         <tytul_dziela> tytuł-dzieła </tytul_dziela>
 
 610     <xsl:template match="tytul_dziela">
 
 611         <xsl:param name="mixed" />
 
 613             <xsl:call-template name="standard-attributes" />
 
 614             <xsl:apply-templates select="child::node()">
 
 615                 <xsl:with-param name="mixed" select="true()" />
 
 616             </xsl:apply-templates>
 
 620     <xsl:template match="wyroznienie|slowo_obce|mat|didask_tekst|osoba|wyp_osoba|www">
 
 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>
 
 635     <xsl:template match="sekcja_swiatlo">
 
 636         <xsl:param name="mixed" />
 
 637         <br><xsl:call-template name="standard-attributes" /></br>
 
 640     <xsl:template match="sekcja_asterysk">
 
 641         <xsl:param name="mixed" />
 
 642         <hr><xsl:call-template name="standard-attributes" /></hr>
 
 645     <xsl:template match="separator_linia">
 
 646         <xsl:param name="mixed" />
 
 647         <hr><xsl:call-template name="standard-attributes" /></hr>
 
 650     <xsl:template match="zastepnik_wersu">
 
 651         <xsl:param name="mixed" />
 
 652         <hr><xsl:call-template name="standard-attributes" /></hr>
 
 664     <xsl:template match="pr|pa|pe|pt">       
 
 665         <span x-editable="true" x-common="common">
 
 666             <xsl:call-template name="standard-attributes">
 
 667                 <xsl:with-param name="extra-class" select="'annotation-inline-box'" />
 
 669             <a name="anchor-{generate-id(.)}" />
 
 670             <!-- the link to the non-inline version -->
 
 671             <a href="#annotation-{generate-id(.)}" class="annotation"></a>
 
 672             <!-- inline contents -->
 
 673             <span x-annotation-box="true" x-pass-thru="true">
 
 674                 <xsl:call-template name="context-menu" />
 
 675                 <xsl:apply-templates select="node()">
 
 676                     <xsl:with-param name="mixed" select="true()" />
 
 677                 </xsl:apply-templates>
 
 682     <xsl:template match="begin">        
 
 684             <xsl:call-template name="standard-attributes" />
 
 685             <xsl:attribute name="theme-class">
 
 686                 <xsl:value-of select="substring-after(@id, 'b')" />
 
 691     <xsl:template match="extra|uwaga">
 
 692         <span x-common="common">
 
 693             <xsl:call-template name="standard-attributes" />
 
 694             <xsl:apply-templates select="child::node()">
 
 695                 <xsl:with-param name="mixed" select="true()" />
 
 696             </xsl:apply-templates>
 
 700     <xsl:template match="motyw">
 
 701         <span x-editable="true" x-common="common">
 
 702             <xsl:call-template name="standard-attributes" />
 
 703             <xsl:attribute name="theme-class">
 
 704                 <xsl:value-of select="substring-after(@id, 'm')" />
 
 706             <xsl:call-template name="context-menu" />
 
 707             <span x-pass-thru="true" class="theme-text-list"><xsl:value-of select=".|node()" /></span>
 
 711     <xsl:template match="end">
 
 713             <xsl:call-template name="standard-attributes" />
 
 714             <xsl:attribute name="theme-class">
 
 715                 <xsl:value-of select="substring-after(@id, 'e')" />
 
 727     <xsl:template match="text()">
 
 728         <!-- <xsl:value-of select="." /> -->
 
 729         <xsl:param name="mixed" />
 
 731             <xsl:when test="normalize-space(.) = ''" />
 
 732             <xsl:when test="not($mixed)">
 
 733                 <span x-node="out-of-flow-text" class="out-of-flow-text" x-editable="true">
 
 734                         <xsl:value-of select="." />
 
 737             <xsl:otherwise><xsl:value-of select="." /></xsl:otherwise>
 
 741     <xsl:template match="comment()">
 
 742         <xsl:comment><xsl:value-of select="." /></xsl:comment>
 
 745     <xsl:template match="*[name() != local-name()]">
 
 747             <xsl:call-template name="standard-attributes" />
 
 748             <xsl:apply-templates select="child::node()">
 
 749                 <xsl:with-param name="mixed" select="true()" />
 
 750             </xsl:apply-templates>
 
 755                 Earlier versions of html2wl introduced a BUG, that 'causes "out-of-flow-text" tag to appear.
 
 756                 Instead of marking it as "unknown", just pass thru it.
 
 757                 Keep a pass-thru span for out-of-flow box editing
 
 759     <xsl:template match="out-of-flow-text">
 
 760         <span data-pass-thru="true">
 
 761             <xsl:apply-templates select="child::node()">
 
 762                 <xsl:with-param name="mixed" select="false()" />
 
 763             </xsl:apply-templates>        
 
 767     <xsl:template match="*">
 
 768         <span class="unknown-tag" x-node="{name()}">
 
 769             <xsl:apply-templates select="child::node()">
 
 770                 <xsl:with-param name="mixed" select="true()" />
 
 771             </xsl:apply-templates>        
 
 775     <xsl:template name="context-menu">
 
 776         <!-- <span class="default-menu context-menu"> -->
 
 777         <!-- <button class="edit-button">Edytuj</button> -->
 
 778             <!-- <span class="delete-button">Delete</span> -->
 
 780         <!-- <span class="edit-menu context-menu">
 
 781             <span class="accept-button">Accept</span>
 
 782             <span class="reject-button">Close</span>
 
 786     <xsl:template name="standard-attributes">
 
 787         <xsl:param name="extra-class" />
 
 788         <xsl:attribute name="class"><xsl:value-of select="local-name()" /><xsl:text> </xsl:text><xsl:value-of select="$extra-class" /></xsl:attribute>
 
 790         <xsl:attribute name="x-node"><xsl:value-of select="local-name()" /></xsl:attribute>
 
 792         <xsl:if test="local-name() != name()">
 
 793             <xsl:attribute name="x-ns"><xsl:value-of select="namespace-uri()" /></xsl:attribute>
 
 796         <xsl:for-each select="@*">
 
 797             <xsl:variable name="id" select="generate-id()" />
 
 798             <xsl:attribute name="x-attr-value-{$id}"><xsl:value-of select="."/></xsl:attribute>
 
 799             <xsl:attribute name="x-attr-name-{$id}"><xsl:value-of select="local-name()"/></xsl:attribute>
 
 801                 <xsl:when test="namespace-uri()">
 
 802                 <xsl:attribute name="x-attr-ns-{$id}"><xsl:value-of select="namespace-uri()"/></xsl:attribute>
 
 804                                 <!-- if the element belongs to default namespace and attribut has no namespace -->
 
 805                 <xsl:when test="not(namespace-uri(.))">
 
 806                                 <xsl:attribute name="data-wlf-{local-name()}"><xsl:value-of select="."/></xsl:attribute>