ufundowali -> wsparli
[librarian.git] / librarian / pdf / wl2tex.xslt
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3
4    This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
5    Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
6
7 -->
8 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9     xmlns:wl="http://wolnelektury.pl/functions"
10     xmlns:dc="http://purl.org/dc/elements/1.1/"
11     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
12
13 <xsl:output encoding="utf-8" indent="yes" version="2.0" />
14
15 <xsl:template match="utwor">
16     <TeXML xmlns="http://getfo.sourceforge.net/texml/ns1">
17         <TeXML escape="0">
18         \documentclass[<xsl:value-of select="@customizations"/>]{wl}
19
20         <!-- flags and values set on root -->
21
22         \newif\ifflaglessadvertising
23         <xsl:for-each select="@*[starts-with(name(), 'flag-')]">
24             <cmd>
25                 <xsl:attribute name="name"><xsl:value-of select="wl:texcommand(name())" />true</xsl:attribute>
26             </cmd>
27         </xsl:for-each>
28
29         <xsl:for-each select="@*[starts-with(name(), 'data-')]">
30             <TeXML escape="0">
31                 \def\<xsl:value-of select="wl:texcommand(name())" />{<TeXML escape="1"><xsl:value-of select="."/></TeXML>}
32             </TeXML>
33         </xsl:for-each>
34         </TeXML>
35
36         <xsl:choose>
37             <xsl:when test="@morefloats = 'new'">
38                 <TeXML escape="0">
39                     \usepackage[maxfloats=53]{morefloats}
40                 </TeXML>
41             </xsl:when>
42             <xsl:when test="@morefloats = 'old'">
43                 <TeXML escape="0">
44                     \usepackage{morefloats}
45                 </TeXML>
46             </xsl:when>
47             <xsl:when test="@morefloats = 'none'" />
48             <xsl:otherwise>
49                 <TeXML escape="0">
50                     \IfFileExists{morefloats.sty}{
51                         \usepackage{morefloats}
52                     }{}
53                 </TeXML>
54             </xsl:otherwise>
55         </xsl:choose>
56
57         <xsl:apply-templates select="rdf:RDF" mode="titlepage" />
58         <xsl:apply-templates select="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" mode='titlepage' />
59
60         <env name="document">
61             <xsl:if test="@data-cover-width">
62                 <cmd name="makecover">
63                     <parm>210mm</parm>
64                     <parm><xsl:value-of select="210 * @data-cover-height div @data-cover-width" />mm</parm>
65                 </cmd>
66             </xsl:if>
67                 <xsl:if test="@thanks">
68                     <TeXML escape="0">
69                         \def\thanknote{<TeXML escape="1"><xsl:value-of select="@thanks" /></TeXML>}
70                     </TeXML>
71                 </xsl:if>
72             <cmd name="maketitle" />
73
74             <cmd name="tytul"><parm>
75               <xsl:choose>
76                 <xsl:when test="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/nazwa_utworu">
77                     <!-- title in master -->
78                     <xsl:apply-templates select="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/autor_utworu" mode="title" />
79                     <xsl:apply-templates select="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/dzielo_nadrzedne" mode="title" />
80                     <xsl:apply-templates select="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/nazwa_utworu" mode="title" />
81                     <xsl:apply-templates select="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/podtytul" mode="title" />
82                     <!-- dc in master or not -->
83                     <cmd name="translatorsline" />
84                 </xsl:when>
85                 <xsl:otherwise>
86                     <!-- look for author title in dc -->
87                     <xsl:apply-templates select="rdf:RDF" mode="firstdctitle" />
88                     <xsl:apply-templates select="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" mode='firstdctitle' />
89                 </xsl:otherwise>
90               </xsl:choose>
91             </parm></cmd>
92             <xsl:apply-templates select="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" />
93             <xsl:apply-templates select="utwor" mode="part" />
94
95             <TeXML escape="0">
96                 <xsl:if test="@data-cover-by">
97                 \def\coverby{Okładka na podstawie:
98                     <xsl:choose>
99                     <xsl:when test="@data-cover-source">
100                         \href{\datacoversource}{\datacoverby}
101                     </xsl:when>
102                     <xsl:otherwise>
103                         \datacoverby{}
104                     </xsl:otherwise>
105                     </xsl:choose>
106                 }
107                 </xsl:if>
108                 \def\editors{<TeXML escape="1"><xsl:call-template name="editors" /></TeXML>}
109                 <xsl:if test="@funders">
110                     \def\funders{Publikację wsparli i wsparły:
111                         <TeXML escape="1"><xsl:value-of select="@funders" /></TeXML>.}
112                 </xsl:if>
113
114                 <xsl:if test="@sponsor-note|data-sponsor">
115                     \def\sponsors{
116                         \scriptsize
117                         <xsl:choose>
118                             <xsl:when test="@sponsor-note">
119                                 <TeXML escape="1"><xsl:value-of select="@sponsor-note" /></TeXML>
120                             </xsl:when>
121                             <xsl:otherwise>
122                                 Sfinansowano ze~środków:
123                             </xsl:otherwise>
124                         </xsl:choose>
125
126                         \vspace{1em}
127
128                         <xsl:apply-templates select="data-sponsor" mode="sponsor" />
129                     }
130                 </xsl:if>
131             </TeXML>
132
133             <cmd name="editorialsection" />
134
135         </env>
136     </TeXML>
137 </xsl:template>
138
139 <xsl:template match="utwor" mode="part">
140     <cmd name="tytul"><parm>
141       <xsl:choose>
142         <xsl:when test="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/nazwa_utworu">
143             <!-- title in master -->
144             <xsl:apply-templates select="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/nazwa_utworu" mode="title" />
145             <xsl:apply-templates select="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/podtytul" mode="title" />
146         </xsl:when>
147         <xsl:otherwise>
148             <!-- look for title in dc -->
149             <xsl:apply-templates select="rdf:RDF" mode="dctitle" />
150             <xsl:apply-templates select="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" mode='dctitle' />
151         </xsl:otherwise>
152       </xsl:choose>
153     </parm></cmd>
154
155     <xsl:apply-templates select="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" />
156     <xsl:apply-templates select="utwor" mode="part" />
157 </xsl:template>
158
159 <!-- =================== -->
160 <!-- = MAIN TITLE PAGE = -->
161 <!-- = (from DC)       = -->
162 <!-- =================== -->
163
164 <xsl:template match="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" mode="titlepage">
165     <xsl:apply-templates select="rdf:RDF" mode="titlepage" />
166 </xsl:template>
167
168 <xsl:template match="rdf:RDF" mode="titlepage">
169     <TeXML escape="0">
170         \def\authors{<TeXML escape="1"><xsl:call-template name="authors" /></TeXML>}
171         \author{\authors}
172         \title{<TeXML escape="1"><xsl:apply-templates select=".//dc:title" mode="inline" /></TeXML>}
173         \def\translatorsline{<TeXML escape="1"><xsl:call-template name="translators" /></TeXML>}
174
175         \def\bookurl{<TeXML escape="1"><xsl:value-of select=".//dc:identifier.url" /></TeXML>}
176
177         \def\rightsinfo{Ten utwór nie jest objęty majątkowym prawem autorskim i~znajduje się w~domenie
178             publicznej, co oznacza że możesz go swobodnie wykorzystywać, publikować
179             i~rozpowszechniać. Jeśli utwór opatrzony jest dodatkowymi materiałami
180             (przypisy, motywy literackie etc.), które podlegają prawu autorskiemu, to
181             te dodatkowe materiały udostępnione są na licencji
182             \href{http://creativecommons.org/licenses/by-sa/3.0/}{Creative Commons
183             Uznanie Autorstwa – Na Tych Samych Warunkach 3.0 PL}.}
184         <xsl:if test=".//dc:rights.license">
185             \def\rightsinfo{Ten utwór jest udostepniony na licencji
186             \href{<xsl:value-of select=".//dc:rights.license" />}{<TeXML escape="1"><xsl:apply-templates select=".//dc:rights" mode="inline" /></TeXML>}.}
187         </xsl:if>
188
189         \def\sourceinfo{
190             <xsl:if test=".//dc:source">
191                 Tekst opracowany na podstawie: <TeXML escape="1"><xsl:apply-templates select=".//dc:source" mode="inline" /></TeXML>
192                 \vspace{.6em}
193             </xsl:if>}
194         \def\publisherinfo{
195             <xsl:if test=".//dc:publisher">
196                 Wydawca:
197                 <TeXML escape="1">
198                     <xsl:for-each select="//dc:publisher/text()">
199                         <xsl:value-of select="."/>
200                         <xsl:if test="not(position() = last())">, </xsl:if>
201                     </xsl:for-each>
202                 </TeXML>
203                 \vspace{.6em}
204             </xsl:if>}
205         \def\description{<TeXML escape="1"><xsl:apply-templates select=".//dc:description" mode="inline" /></TeXML>}
206     </TeXML>
207 </xsl:template>
208
209
210 <!-- ============== -->
211 <!-- = BOOK TITLE = -->
212 <!-- = (from DC)  = -->
213 <!-- ============== -->
214
215 <xsl:template match="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" mode="dctitle">
216     <xsl:apply-templates select="rdf:RDF" mode="dctitle" />
217 </xsl:template>
218
219 <xsl:template match="rdf:RDF" mode="dctitle">
220     <cmd name="nazwapodutworu"><parm>
221         <xsl:apply-templates select=".//dc:title/node()" mode="inline" />
222     </parm></cmd>
223 </xsl:template>
224
225 <xsl:template match="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" mode="firstdctitle">
226     <xsl:apply-templates select="rdf:RDF" mode="firstdctitle" />
227 </xsl:template>
228
229 <xsl:template match="rdf:RDF" mode="firstdctitle">
230     <cmd name="autorutworu"><parm><cmd name="authors"/></parm></cmd>
231     <cmd name="nazwautworu"><parm>
232         <xsl:apply-templates select=".//dc:title/node()" mode="inline" />
233     </parm></cmd>
234     <cmd name="translatorsline" />
235 </xsl:template>
236
237
238 <!-- ============================================================================== -->
239 <!-- = MASTER TAG                                                                 = -->
240 <!-- = (can contain block tags, paragraph tags, standalone tags and special tags) = -->
241 <!-- ============================================================================== -->
242 <!-- ==================================================================================== -->
243 <!-- = BLOCK TAGS                                                                       = -->
244 <!-- = (can contain other block tags, paragraph tags, standalone tags and special tags) = -->
245 <!-- ==================================================================================== -->
246
247 <xsl:template
248     match="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny|nota|dedykacja|dlugi_cytat|poezja_cyt|motto">
249     <cmd>
250         <xsl:attribute name="name">
251             <xsl:value-of select="wl:texcommand(name())" />
252         </xsl:attribute>
253         <parm><xsl:apply-templates/></parm>
254     </cmd>
255 </xsl:template>
256
257 <xsl:template match="lista_osob">
258     <cmd name="listaosob">
259         <parm><xsl:apply-templates select="naglowek_listy" /></parm>
260         <parm><xsl:apply-templates select="lista_osoba" /></parm>
261     </cmd>
262 </xsl:template>
263
264 <xsl:template match="kwestia">
265     <cmd name="kwestia">
266         <parm><xsl:apply-templates select="strofa|akap|didaskalia" /></parm>
267     </cmd>
268 </xsl:template>
269
270 <xsl:template match="ilustr">
271     <cmd name="ilustr">
272         <parm><xsl:value-of select="@src" /></parm>
273         <parm><xsl:value-of select="@alt" /></parm>
274     </cmd>
275 </xsl:template>
276
277 <!-- ========================================== -->
278 <!-- = PARAGRAPH TAGS                         = -->
279 <!-- = (can contain inline and special tags)  = -->
280 <!-- ========================================== -->
281
282 <!-- only in root -->
283 <xsl:template
284     match="autor_utworu|dzielo_nadrzedne|nazwa_utworu|podtytul"
285     mode="title">
286     <cmd>
287         <xsl:attribute name="name">
288             <xsl:value-of select="wl:texcommand(name())" />
289         </xsl:attribute>
290         <parm><xsl:apply-templates mode="inline"/></parm>
291     </cmd>
292 </xsl:template>
293
294
295 <xsl:template
296     match="naglowek_akt|naglowek_czesc|srodtytul|naglowek_osoba|naglowek_podrozdzial|naglowek_scena|naglowek_rozdzial|miejsce_czas|didaskalia|lista_osoba|akap|akap_dialog|akap_cd|motto_podpis|naglowek_listy">
297     <cmd>
298         <xsl:attribute name="name">
299             <xsl:value-of select="wl:texcommand(name())" />
300         </xsl:attribute>
301         <parm><xsl:apply-templates mode="inline"/></parm>
302     </cmd>
303 </xsl:template>
304
305 <xsl:template match="strofa">
306   <cmd name="strofa"><parm>
307     <xsl:choose>
308         <xsl:when test="count(br) > 0">
309             <xsl:call-template name="verse">
310                 <xsl:with-param name="verse-content" select="br[1]/preceding-sibling::text() | br[1]/preceding-sibling::node()" />
311                 <xsl:with-param name="verse-type" select="br[1]/preceding-sibling::*[name() = 'wers_wciety' or name() = 'wers_akap' or name() = 'wers_cd'][1]" />
312             </xsl:call-template>
313             <xsl:for-each select="br">
314                 <TeXML escape="0">\\{}</TeXML>
315                 <!-- Each BR tag "consumes" text after it -->
316                 <xsl:variable name="lnum" select="count(preceding-sibling::br)" />
317                 <xsl:call-template name="verse">
318                     <xsl:with-param name="verse-content"
319                         select="following-sibling::text()[count(preceding-sibling::br) = $lnum+1] | following-sibling::node()[count(preceding-sibling::br) = $lnum+1]" />
320                     <xsl:with-param name="verse-type" select="following-sibling::*[count(preceding-sibling::br) = $lnum+1 and (name() = 'wers_wciety' or name() = 'wers_akap' or name() = 'wers_cd')][1]" />
321                 </xsl:call-template>
322             </xsl:for-each>
323         </xsl:when>
324         <xsl:otherwise>
325             <xsl:call-template name="verse">
326                 <xsl:with-param name="verse-content" select="text() | node()" />
327                 <xsl:with-param name="verse-type" select="wers_wciety|wers_akap|wers_cd[1]" />
328             </xsl:call-template>
329         </xsl:otherwise>
330     </xsl:choose>
331   </parm></cmd>
332 </xsl:template>
333
334
335 <xsl:template name="verse">
336     <xsl:param name="verse-content" />
337     <xsl:param name="verse-type" />
338
339     <cmd>
340         <xsl:attribute name="name">
341             <xsl:choose>
342                 <xsl:when test="$verse-type != ''">
343                     <xsl:value-of select='wl:texcommand(name($verse-type))' />
344                 </xsl:when>
345                 <xsl:otherwise>wers</xsl:otherwise>
346             </xsl:choose>
347         </xsl:attribute>
348         <xsl:if test="string($verse-content/@typ)">
349             <opt><xsl:value-of select="$verse-content/@typ" />em</opt>
350         </xsl:if>
351         <parm><xsl:apply-templates select="$verse-content" mode="inline"/></parm>
352     </cmd>
353 </xsl:template>
354
355 <!-- ================================================ -->
356 <!-- = INLINE TAGS                                  = -->
357 <!-- = (contain other inline tags and special tags) = -->
358 <!-- ================================================ -->
359
360 <xsl:template mode="inline"
361     match="pa|pe|pr|pt|mat|didask_tekst|slowo_obce|wyroznienie|osoba">
362     <cmd>
363         <xsl:attribute name="name">
364             <xsl:value-of select="wl:texcommand(name())" />
365         </xsl:attribute>
366         <parm><xsl:apply-templates mode="inline"/></parm>
367     </cmd>
368 </xsl:template>
369
370
371
372 <xsl:template match="tytul_dziela" mode="inline">
373     <cmd name="tytuldziela"><parm>
374         <xsl:if test="@typ = '1'">„</xsl:if><xsl:apply-templates mode="inline" /><xsl:if test="@typ = '1'">”</xsl:if>
375     </parm></cmd>
376 </xsl:template>
377
378
379
380 <!-- ============================================== -->
381 <!-- = STANDALONE TAGS                            = -->
382 <!-- = (cannot contain any other tags)            = -->
383 <!-- ============================================== -->
384 <xsl:template
385     match="sekcja_swiatlo|sekcja_asterysk|separator_linia">
386     <cmd>
387         <xsl:attribute name="name">
388             <xsl:value-of select="wl:texcommand(name())" />
389         </xsl:attribute>
390     </cmd>
391 </xsl:template>
392
393
394 <!-- ================ -->
395 <!-- = SPECIAL TAGS = -->
396 <!-- ================ -->
397 <!-- Themes -->
398
399
400 <xsl:template match="begin|end|motyw">
401     <xsl:apply-templates select='.' mode="inline" />
402 </xsl:template>
403
404 <xsl:template match="begin" mode="inline" />
405 <xsl:template match="end" mode="inline" />
406
407 <xsl:template match="motyw" mode="inline">
408     <cmd name="motyw">
409         <xsl:if test="@moved">
410             <opt name="moved"><xsl:value-of select="@moved" /></opt>
411         </xsl:if>
412         <parm><xsl:apply-templates mode="inline" /></parm>
413     </cmd>
414 </xsl:template>
415
416 <xsl:template name="authors">
417     <xsl:for-each select=".//dc:creator_parsed">
418         <xsl:if test="position() != 1">, </xsl:if>
419         <xsl:apply-templates mode="inline" />
420     </xsl:for-each>
421 </xsl:template>
422
423 <xsl:template name="editors">
424     <xsl:if test="@editors">
425         <xsl:text>Opracowanie redakcyjne i przypisy: </xsl:text>
426         <xsl:value-of select="@editors" />
427         <xsl:text>.</xsl:text>
428     </xsl:if>
429 </xsl:template>
430
431 <xsl:template name="translators">
432     <xsl:if test=".//dc:contributor.translator_parsed">
433         <cmd name='translator'><parm>
434             <xsl:for-each select=".//dc:contributor.translator_parsed">
435                 <xsl:if test="position() != 1">, </xsl:if>
436                 <xsl:apply-templates mode="inline" />
437             </xsl:for-each>
438         </parm></cmd>
439     </xsl:if>
440 </xsl:template>
441
442 <xsl:template match="data-sponsor" mode="sponsor">
443     <cmd name="par"><parm>
444     <xsl:choose>
445         <xsl:when test="@src">
446             \includegraphics[height=0.25\textwidth,width=0.25\textwidth,keepaspectratio]{<xsl:value-of select="@src" />}
447         </xsl:when>
448         <xsl:otherwise>
449             <xsl:value-of select="@name" />
450         </xsl:otherwise>
451     </xsl:choose>
452     </parm></cmd>
453 </xsl:template>
454
455 <xsl:template match="mat" mode="inline">
456     <TeXML escape="0">
457         <xsl:text>$</xsl:text>
458         <xsl:value-of select="wl:mathml_latex(.)" />
459         <xsl:text>$</xsl:text>
460     </TeXML>
461 </xsl:template>
462
463 <xsl:template match="mat">
464     <TeXML escape="0">
465         <xsl:text>$$</xsl:text>
466         <xsl:value-of select="wl:mathml_latex(.)" />
467         <xsl:text>$$</xsl:text>
468     </TeXML>
469 </xsl:template>
470
471 <xsl:template match="tabela|tabelka">
472     <cmd name="par" />
473     <cmd name="vspace"><parm>1em</parm></cmd>
474     <group><cmd name="raggedright" />
475     <env name="longtabu"> to <TeXML escape="0">\textwidth </TeXML>
476       <!--parm><cmd name="textwidth"/></parm-->
477       <parm><TeXML escape="0"><xsl:value-of select="@_format" /></TeXML></parm>
478         <xsl:choose>
479         <xsl:when test="@ramka='1' or @ramki='1'">
480           <cmd name="hline" />
481           <xsl:apply-templates mode="wiersze-ramki"/>
482         </xsl:when>
483         <xsl:otherwise>
484           <xsl:apply-templates/>
485         </xsl:otherwise>
486         </xsl:choose>
487     </env>
488     </group>
489     <cmd name="vspace"><parm>1em</parm></cmd>
490 </xsl:template>
491 <xsl:template match="wiersz" mode="wiersze-ramki">
492     <xsl:apply-templates />
493     <spec cat="esc"/><spec cat="esc"/>
494     <cmd name="hline" gr="0" />
495 </xsl:template>
496 <xsl:template match="wiersz">
497     <xsl:apply-templates />
498     <spec cat="esc"/><spec cat="esc"/>
499 </xsl:template>
500 <xsl:template match="kol">
501     <xsl:apply-templates mode="inline"/>
502     <xsl:if test="position() &lt; last()">
503     <spec cat="align"/>
504     </xsl:if>
505 </xsl:template>
506
507
508 <!-- ============== -->
509 <!-- = ADDED TAGS = -->
510 <!-- ============== -->
511
512
513 <xsl:template match="dywiz" mode="inline">
514     <cmd name="dywiz" />
515 </xsl:template>
516
517 <xsl:template match="nbsp" mode="inline">
518     <spec cat="tilde" />
519 </xsl:template>
520
521 <xsl:template match="alien" mode="inline">
522     <group>
523         <cmd name="alien" />
524         <xsl:apply-templates mode="inline" />
525     </group>
526 </xsl:template>
527
528 <!-- ================ -->
529 <!-- = IGNORED TAGS = -->
530 <!-- ================ -->
531 <xsl:template match="extra|uwaga" />
532 <xsl:template match="extra|uwaga" mode="inline" />
533
534 <xsl:template match="nota_red" />
535 <xsl:template match="abstrakt" />
536
537 <!-- ======== -->
538 <!-- = TEXT = -->
539 <!-- ======== -->
540 <xsl:template match="text()" />
541 <xsl:template match="text()" mode="inline">
542     <xsl:if test="preceding-sibling::node() and wl:starts_white(.)">
543       <xsl:text> </xsl:text>
544     </xsl:if>
545
546     <xsl:value-of select="wl:substitute_entities(wl:strip(.))" />
547
548     <xsl:if test="following-sibling::node() and wl:ends_white(.)">
549       <xsl:text> </xsl:text>
550     </xsl:if>
551 </xsl:template>
552
553
554 </xsl:stylesheet>