-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFdS.xsl
743 lines (692 loc) · 45.7 KB
/
FdS.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ixsl="http://saxonica.com/ns/interactiveXSLT"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:js="http://saxonica.com/ns/globalJS"
xmlns:saxon="http://saxon.sf.net/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="h ixsl js saxon xs" version="3.0">
<xsl:output method="html" html-version="5" encoding="utf-8" indent="no"/>
<xsl:mode on-no-match="shallow-copy"/>
<!--INITIAL TEMPLATE-->
<xsl:template name="xsl:initial-template">
<xsl:call-template name="main"/>
</xsl:template>
<!--MAIN TEMPLATE-->
<xsl:template name="main" match="/">
<xsl:result-document href="#body" method="ixsl:replace-content">
<header>
<div id="titoli_header_eIDNO">
<h1><xsl:value-of select="//tei:TEI[not(@xml:id='glossario')]/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type='main']" /></h1>
<h2><xsl:value-of select="//tei:TEI[not(@xml:id='glossario')]/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author"/></h2>
<h3><xsl:copy-of select="//tei:TEI[not(@xml:id='glossario')]/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:msDesc/tei:msIdentifier/tei:idno"/></h3>
</div>
<div id="info_legenda_pulsanti">
<div id="introduzione">
<h3>Informazioni</h3>
<xsl:apply-templates select="//tei:TEI[not(@xml:id='glossario')]/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:msDesc/tei:history" />
<xsl:apply-templates select="//tei:TEI[not(@xml:id='glossario')]/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:msDesc/tei:msIdentifier"/>
<xsl:apply-templates select="//tei:TEI[not(@xml:id='glossario')]/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:msDesc/tei:physDesc" />
</div>
<div id="legenda_pulsanti">
<div id="box_legenda">
<h3>Legenda</h3><br/>
<li><b>?</b> indica un gap nel manoscritto.</li>
<li>Le <sup>parole</sup> in apice sono aggiunte al testo sopra alla riga corrente.</li>
<li>Le <sub place="below">parole</sub> in pedice sono aggiunte al testo sotto alla riga corrente.</li>
<li>Le <strike>parole</strike> cancellate sono barrate.</li>
<li>I termini evidenziati di azzurro sono riferimenti a: persone, luoghi, enti o termini linguistici. Passandoci il cursore sopra vengono mostrate informazioni e definizioni. Le definizioni dei termini linguistici derivano da <i><a href="https://www.cercleferdinanddesaussure.org/ressources-electroniques/#4">Dalle parole ai termini</a></i> di Giuseppe Cosenza.</li>
<li>Ponendo il cursore sopra i termini sottolineati viene mostrata l'abbreviazione sciolta.</li>
</div>
<div id="box_icone_traduzioni">
<input id="icona_testo_francese" type="button" class="clicked" alt="Visualizza la trascrizione francese" onclick="gestoreMostraTrascrizioneFR()" value="Trascrizione francese"/>
<input id="icona_testo_italiano" type="button" class="" alt="Visualizza la traduzione italiana" onclick="gestoreMostraTraduzioneIT()" value="Traduzione italiana"/>
<input id="icona_testo_inglese" type="button" class="" alt="Visualizza la traduzione inglese" onclick="gestoreMostraTraduzioneEN()" value="Traduzione inglese"/>
</div>
<div id="box_icone_formattazione">
<input id="icona_abbr_expan" type="button" alt="Clicca per sciogliere o contrarre le abbreviazioni" onclick="gestoreAbbr()" value="Sciogli le abbreviazioni"/>
<br/>
<input id="icona_sic_corr" type="button" class="" alt="Clicca per visualizzare o omettere le correzioni" onclick="gestoreSicCorr()" value="Mostra le correzioni"/>
<br/>
<input id="icona_del" type="button" class="" alt="Clicca per nascondere i del nel testo" onclick="gestoreMostraDel()" value="Nascondi del"/>
<br/>
<input id="icona_gap" type="button" class="" alt="Clicca per nascondere i gap nel testo" onclick="gestoreMostraGap()" value="Nascondi gap"/>
</div>
</div>
</div>
</header>
<div id="corpo">
<div id="div_immagine_testo">
<h2 id="titolo_div_immagine">
<!--OUTPUT: "Pagine 1-2" "Pagine 20-21" "Pagine 3-4" ovvero pagine codificate nel file contenente la pagina selezionata-->
<xsl:value-of select="concat('Pagina ', substring-before(substring-after(document-uri(),'1_'), '_included.xml'))"/>
</h2>
<!--SELECT che permette di scegliere la pagina del manoscritto da visualizzare-->
<div id="div_select_pages">
<xsl:variable name="default" select="6"/>
<xsl:variable name="N" select="30"/>
<xsl:variable name="pages" select="'1', '2', '4', '5', '7', '8', '9', '10', '11', '12', '13', '15', '16', '17', '18', '19', '20', '21', '22', '25', '26', '27', '28', '29', '30'"/>
<select id="select_pages" onchange="select_pages()">
<option value="">Pagine da visualizzare:</option>
<xsl:for-each select="$pages">
<option value="{.}">
<xsl:sequence select="."/>
</option>
</xsl:for-each>
</select>
</div>
<!-- SCAN -->
<!--Elimino la possibilità di visualizzare soltanto il fronte o soltanto il retro-->
<!--<div id="pulsanti_immagini_lettera" >
<input id="icona_1" type="button" class="icone_FR" alt="Clicca per visualizzare la prima facciata del manoscritto" src="immagini/icona1.png" onclick="gestoreSelezionaScan1()" value="Fronte"/>
<input id="icona_2" type="button" class="icone_FR" alt="Clicca per visualizzare la seconda facciata del manoscritto" src="immagini/icona2.png" onclick="gestoreSelezionaScan2()" value="Retro"/>
</div>-->
<div id="box_img">
<h3>Manoscritto</h3>
<xsl:apply-templates select="//tei:facsimile"/>
</div>
<!--TRASCRIZIONE FRANCESE-->
<div id="box_testo_fr">
<h3>Trascrizione francese</h3>
<div class="box_testo">
<xsl:apply-templates select="//tei:body[@xml:id='body-francese']/tei:ab[1]"/>
<xsl:apply-templates select="//tei:div[@type='box_testo']"/>
</div>
</div>
<!--TRADUZIONE ITALIANA-->
<div id="box_testo_it" style="display:none;">
<h3>Traduzione italiana</h3>
<div class="box_testo_it">
<xsl:apply-templates select="//tei:div[@type='box_testo_it']"/>
</div>
</div>
<!--TRADUZIONE INGLESE-->
<div id="box_testo_en" style="display:none;">
<h3>Traduzione inglese</h3>
<div class="box_testo_en">
<xsl:apply-templates select="//tei:div[@type='box_testo_en']"/>
</div>
</div>
</div>
</div>
<div id="div_bibliografia">
<p>
<b>Bibliografia:</b><br/>
<xsl:for-each select="//tei:TEI[not(@xml:id='glossario')]/tei:text/tei:back/tei:div/tei:listBibl/tei:bibl">
<xsl:element name="li">
<xsl:attribute name="class">bBook</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="@xml:id" />
</xsl:attribute>
<!--Autore-->
<xsl:for-each select="current()//tei:author">
<xsl:element name="span">
<xsl:attribute name="class">bAuth</xsl:attribute>
<xsl:for-each select="current()//tei:surname">
<xsl:copy-of select="current()"/>
</xsl:for-each>
<xsl:text> </xsl:text> <!--spazio divide cognome da iniziale-->
<xsl:for-each select="current()//tei:forename">
<xsl:value-of select="concat(substring(current(), 1, 1), '.')" />
</xsl:for-each>
</xsl:element>
<xsl:text>, </xsl:text>
</xsl:for-each>
<!--Traduttore-editor-->
<xsl:if test="current()//tei:editor">
<xsl:for-each select="current()//tei:editor">
<xsl:element name="span">
<xsl:attribute name="class">bEdith</xsl:attribute>
<xsl:for-each select="current()//tei:surname">
<xsl:copy-of select="current()"/>
</xsl:for-each>
<xsl:text> </xsl:text> <!--spazio divide cognome da iniziale-->
<xsl:for-each select="current()//tei:forename">
<xsl:value-of select="concat(substring(current(), 1, 1), '.')" />
</xsl:for-each>
</xsl:element>
<xsl:text>, </xsl:text>
</xsl:for-each>
</xsl:if>
<!--Titolo-->
<xsl:element name="span">
<xsl:attribute name="class">bTitle</xsl:attribute>
<xsl:element name="i">
<xsl:for-each select="current()//tei:title">
<xsl:apply-templates />
<xsl:text>. </xsl:text>
</xsl:for-each>
</xsl:element>
</xsl:element>
<!--Luogo di pubblicazione-->
<xsl:element name="span">
<xsl:attribute name="class">bPlace</xsl:attribute>
<xsl:for-each select="current()//tei:pubPlace">
<xsl:apply-templates />
<xsl:text>, </xsl:text>
</xsl:for-each>
</xsl:element>
<!--Editore-->
<xsl:if test="current()//tei:publisher">
<xsl:element name="span">
<xsl:attribute name="class">bPubl</xsl:attribute>
<xsl:apply-templates select="current()//tei:publisher" />
</xsl:element>
<xsl:text>, </xsl:text>
</xsl:if>
<!--Data-->
<xsl:element name="span">
<xsl:attribute name="class">bDate</xsl:attribute>
<xsl:apply-templates select="current()//tei:date" />
</xsl:element>
<!--Note-->
<xsl:if test="current()//tei:note">
<br />
<xsl:element name="div">
<xsl:attribute name="class">bkDesc</xsl:attribute>
<xsl:apply-templates select="current()//tei:note" />
<br />
</xsl:element>
</xsl:if>
</xsl:element>
</xsl:for-each>
</p>
</div>
<div id="div_respStmt">
<p>
<b>
<xsl:copy-of select="//tei:TEI[not(@xml:id='glossario')]/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:respStmt[1]/tei:resp"/><br/>
</b>
<xsl:for-each select="//tei:TEI[not(@xml:id='glossario')]/tei:teiHeader/tei:fileDesc/tei:editionStmt/tei:respStmt[1]/tei:name">
<xsl:choose>
<xsl:when test="position() = last()">
<xsl:copy-of select="."/>
<xsl:text>. </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
<xsl:text>, </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</p>
<p>
<b>
<xsl:copy-of select="//tei:editionStmt/tei:respStmt[2]/tei:resp"/><br/>
</b>
<xsl:for-each select="//tei:editionStmt/tei:respStmt[2]/tei:name">
<xsl:choose>
<xsl:when test="position() = last()">
<xsl:copy-of select="."/>
<xsl:text>. </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
<xsl:text>, </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<br/>
</p>
</div>
<footer>
<div id="publication">
<p id="publisher"></p>
<p id="licence"></p>
<p id="date"></p>
<script type="text/javascript">
SaxonJS.getResource({
location: "XML/Prolusioni1_1.xml",
type: "xml"
}).then(doc => {
const publisher = SaxonJS.XPath.evaluate(
"//*[local-name()='TEI']/*[local-name()='teiHeader']/*[local-name()='fileDesc']/*[local-name()='publicationStmt']/*[local-name()='publisher']/text()",
doc,
);
const output1 = SaxonJS.serialize(publisher, {method: "xml", indent: true, "omit-xml-declaration":true});
document.getElementById("publisher").innerHTML = output1;
const licence = SaxonJS.XPath.evaluate(
"//*[local-name()='TEI']/*[local-name()='teiHeader']/*[local-name()='fileDesc']/*[local-name()='publicationStmt']/*[local-name()='availability']/*[local-name()='licence']/text()",
doc,
);
const output2 = SaxonJS.serialize(licence, {method: "xml", indent: true, "omit-xml-declaration":true});
document.getElementById("licence").innerHTML = output2;
const date = SaxonJS.XPath.evaluate(
"//*[local-name()='TEI']/*[local-name()='teiHeader']/*[local-name()='fileDesc']/*[local-name()='publicationStmt']/*[local-name()='date']/text()",
doc,
);
const output3 = SaxonJS.serialize(date, {method: "xml", indent: true, "omit-xml-declaration":true});
document.getElementById("date").innerHTML = output3;
})
</script>
</div>
</footer>
</xsl:result-document>
</xsl:template>
<!-- *************************** -->
<!-- IMMAGINI DEL MANOSCRITTO ORIGINALE DIV -->
<!-- Immagini delle lettere scannerizzate e map html -->
<xsl:template match="//tei:facsimile">
<xsl:for-each select="tei:surface/tei:graphic">
<xsl:variable name="position" select="position()"/>
<xsl:element name="img"> <!-- <img usemap="#map1" id="img-scan1" src="immagini/ms_fr_03951_01_1_p001.jpg" class="immagini_scan"> -->
<xsl:attribute name="usemap">
<xsl:value-of select="concat('#map',$position)"/> <!-- usemap="#map1" -->
</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="concat('img-scan' , $position)"/> <!-- id="img-scan1" -->
</xsl:attribute>
<xsl:attribute name="src">
<xsl:value-of select="concat('immagini/', current()/@url)"/> <!-- src="immagini/ms_fr_03951_01_1_p001.jpg-->
</xsl:attribute>
<xsl:attribute name="class">
<xsl:text>immagini_scan</xsl:text>
</xsl:attribute>
<xsl:element name="map"> <!-- <map name="map1"> <area class="scan_p1_class" id="facs_Pericope1" shape="poly" coords=".." href="#ID#facs_Pericope1" onclick="gestoreEvidenziaRiga("ID#facs_Pericope1") ... aree ... -->
<xsl:attribute name="name">
<xsl:value-of select="concat('map',$position)"/>
</xsl:attribute>
<xsl:for-each select="parent::tei:surface/tei:zone">
<xsl:element name="area">
<xsl:attribute name="class">
<xsl:value-of select="concat(parent::tei:surface/@xml:id, '_class')"/> <!-- recupero l'ID del surface padre di zone, class="scan_p1_class"> -->
</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="@xml:id"/>
</xsl:attribute>
<xsl:attribute name="shape">
<xsl:text>poly</xsl:text><!--"poly" se usi i points, "rect" se usi i rettangoli-->
</xsl:attribute>
<xsl:attribute name="coords">
<xsl:value-of select="@points"/>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="concat('#',(substring-after(@xml:id, 'facs_')))"/> <!-- href="facs_HandpageNumber-1" -->
</xsl:attribute>
<xsl:attribute name="onclick">
<xsl:value-of select="'gestoreEvidenziaRiga(id)'"/> <!-- gestoreEvidenziaRiga("facs_HandpageNumber-1") - passo come parametro l'id della zona cliccata-->
</xsl:attribute>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:element>
<script src="JavaScript/image-map-highlighter.js"></script>
<script>
var image = document.querySelector('.immagini_scan');
var highlighter = new ImageMapHighlighter(image, {
strokeColor: 'ff0000',
fill: true,
fillColor: 'ff0000',
});
highlighter.init();
</script>
</xsl:for-each>
</xsl:template>
<!--Box info-->
<xsl:template match="//tei:TEI[not(@xml:id='glossario')]/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:msDesc/tei:history">
<div id="date_di_composizione">
<b>COMPOSIZIONE</b><br/>
<b>Date di composizione </b>
Approssimativamente <xsl:apply-templates select="//tei:origin/tei:origDate" />
<br/>
<b>Luogo </b><xsl:apply-templates select="//tei:origin//tei:origPlace" /><br/>
</div><br/>
</xsl:template>
<xsl:template match="//tei:TEI[not(@xml:id='glossario')]/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:msDesc/tei:msIdentifier">
<div id="archivistica">
<b>ARCHIVISTICA</b><br/>
<b>Luogo </b><xsl:apply-templates select="current()//tei:country" />, <xsl:apply-templates select="current()//tei:settlement" /><br/>
<b>Repository </b><xsl:apply-templates select="current()//tei:repository" /><br/>
<b>Collection </b><xsl:apply-templates select="current()//tei:collection" /><br/>
<b>IDNO </b><xsl:apply-templates select="//tei:idno[@type='inventory']" /><br/>
</div><br/>
</xsl:template>
<xsl:template match="//tei:TEI[not(@xml:id='glossario')]/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:msDesc/tei:physDesc">
<div id="supporto">
<b>SUPPORTO FISICO</b><br/>
<b>Materiale </b><xsl:apply-templates select="current()//tei:support/tei:material" /><br/>
<b>Filigrana </b><xsl:apply-templates select="current()//tei:support/tei:watermark" /><br/>
<b>Estensione </b><xsl:apply-templates select="current()//tei:extent/tei:measureGrp" /><br/>
<b>Dimensioni </b> Altezza: <xsl:apply-templates select="current()//tei:extent/tei:dimensions/tei:height" /> cm - larghezza: <xsl:apply-templates select="current()//tei:extent/tei:dimensions/tei:width" /> cm<br/>
<b>Layout </b><xsl:apply-templates select="current()//tei:collation" /><br/>
<b>Conservazione </b><xsl:apply-templates select="current()//tei:condition" /><br/>
<b>Mani</b><xsl:apply-templates select="current()//tei:handDesc" />
</div><br/>
</xsl:template>
<!--lineNumber-->
<xsl:template match="//tei:lb">
<br/>
<xsl:element name="span">
<xsl:attribute name="class">lineNumber</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="concat('line', @n, '_', substring-after(@xml:id, '_' ))" /> <!--line24_p2-->
</xsl:attribute>
<xsl:value-of select="@n" />
</xsl:element>
</xsl:template>
<!--GAP ?-->
<xsl:template match="//tei:gap">
<span class="gap" > ?</span>
</xsl:template>
<!--DEL-->
<xsl:template match="tei:del">
<del><xsl:apply-templates /></del>
</xsl:template>
<!--ABBR-->
<xsl:template match="//tei:abbr">
<xsl:element name="abbr">
<xsl:attribute name="title">
<xsl:value-of select="current()/following-sibling::tei:expan"/>
</xsl:attribute>
<xsl:value-of select="current()" />
</xsl:element>
</xsl:template>
<!--EXPAN-->
<xsl:template match="//tei:expan">
<!--Se <choice> non è figlio di <term>-->
<xsl:if test="not(current()/parent::tei:choice/parent::tei:term)">
<xsl:element name="span">
<xsl:attribute name="class">expan</xsl:attribute>
<xsl:attribute name="style">display:none;</xsl:attribute>
<xsl:value-of select="current()" />
</xsl:element>
</xsl:if>
<!--Se <choice> è figlio di <term>-->
<xsl:if test="current()/parent::tei:choice/parent::tei:term">
<xsl:element name="span">
<xsl:variable name="testo-hover">
<xsl:variable name="ref">
<xsl:value-of select="substring-after(current()/@ref, '#')"/>
</xsl:variable>
<!--orth-->
<xsl:choose>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]">
<xsl:copy-of select="concat(//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]/tei:form/tei:orth, ': ')"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry[@xml:id=$ref]">
<xsl:copy-of select="concat(//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry[@xml:id=$ref]/tei:form/tei:orth, ': ')"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry/tei:sense/tei:sense[@xml:id=$ref]">
<xsl:copy-of select="concat(//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/ancestor::tei:entry/tei:form/tei:orth, ': ')"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]">
<xsl:copy-of select="concat(//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/ancestor::tei:entry/tei:form/tei:orth, ': ')"/>
</xsl:when>
</xsl:choose>
<!--def-->
<xsl:choose>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]/tei:sense/tei:def">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]/tei:sense/tei:def"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]/tei:sense/tei:cit/tei:quote">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]/tei:sense/tei:cit/tei:quote"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry[@xml:id=$ref]/tei:sense/tei:def">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry[@xml:id=$ref]/tei:sense/tei:def"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def/tei:cit/tei:quote">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def/tei:cit/tei:quote"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:attribute name="class">hovertext</xsl:attribute>
<xsl:attribute name="data-hover">
<xsl:value-of select="$testo-hover"/>
</xsl:attribute>
<xsl:value-of select="current()" />
</xsl:element>
</xsl:if>
</xsl:template>
<!--SIC-->
<xsl:template match="//tei:sic">
<xsl:element name="sic">
<xsl:attribute name="title">
<xsl:value-of select="current()/following-sibling::tei:corr"/>
</xsl:attribute>
<xsl:value-of select="current()" />
</xsl:element>
</xsl:template>
<!--CORR-->
<xsl:template match="//tei:corr">
<!--Se <choice> non è figlio di <term>-->
<xsl:if test="not(current()/parent::tei:choice/parent::tei:term)">
<xsl:element name="corr">
<xsl:attribute name="style">display:none;</xsl:attribute>
<xsl:value-of select="current()" />
</xsl:element>
</xsl:if>
<!--Se <choice> è figlio di <term>-->
<xsl:if test="current()/parent::tei:choice/parent::tei:term">
<xsl:element name="span">
<xsl:variable name="testo-hover">
<xsl:variable name="ref">
<xsl:value-of select="substring-after(current()/@ref, '#')"/>
</xsl:variable>
<!--orth-->
<xsl:choose>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]">
<xsl:copy-of select="concat(//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]/tei:form/tei:orth, ': ')"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry[@xml:id=$ref]">
<xsl:copy-of select="concat(//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry[@xml:id=$ref]/tei:form/tei:orth, ': ')"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry/tei:sense/tei:sense[@xml:id=$ref]">
<xsl:copy-of select="concat(//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/ancestor::tei:entry/tei:form/tei:orth, ': ')"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]">
<xsl:copy-of select="concat(//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/ancestor::tei:entry/tei:form/tei:orth, ': ')"/>
</xsl:when>
</xsl:choose>
<!--def-->
<xsl:choose>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]/tei:sense/tei:def">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]/tei:sense/tei:def"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]/tei:sense/tei:cit/tei:quote">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]/tei:sense/tei:cit/tei:quote"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry[@xml:id=$ref]/tei:sense/tei:def">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry[@xml:id=$ref]/tei:sense/tei:def"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def/tei:cit/tei:quote">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def/tei:cit/tei:quote"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:attribute name="class">hovertext</xsl:attribute>
<xsl:attribute name="data-hover">
<xsl:value-of select="$testo-hover"/>
</xsl:attribute>
<xsl:value-of select="current()" />
</xsl:element>
</xsl:if>
</xsl:template>
<!--ADD place=above-->
<xsl:template match="//tei:add[@place='above']">
<sup><xsl:apply-templates /></sup>
</xsl:template>
<!--ADD place=below-->
<xsl:template match="//tei:add[@place='below']">
<sub><xsl:apply-templates /></sub>
</xsl:template>
<!--ADD place né above né below-->
<xsl:template match="//tei:add[not(@place='above') and not(@place='below')]">
<ins><xsl:apply-templates/></ins>
</xsl:template>
<!--FOREIGN-->
<xsl:template match="//tei:foreign | tei:hi[@rend='italic']">
<i><xsl:apply-templates /></i>
</xsl:template>
<!--BOLD-->
<xsl:template match="//tei:hi[@rend = 'bold']">
<strong><xsl:apply-templates /></strong>
</xsl:template>
<!--UNDERLINE-->
<xsl:template match="//tei:hi[@rend = 'underline']">
<u><xsl:apply-templates /></u>
</xsl:template>
<!--ITALICS-->
<xsl:template match="//tei:hi[@rend = 'italics']">
<i><xsl:apply-templates /></i>
</xsl:template>
<!--Voglio ottenere: <span class="hovertext" data-hover="Hello, this is the tooltip">-->
<!--persName-->
<xsl:template match="//tei:persName">
<xsl:element name="span">
<xsl:variable name="testo-hover">
<xsl:variable name="ref">
<xsl:value-of select="substring-after(current()/@ref, '#')"/>
</xsl:variable>
<xsl:copy-of select="concat(//tei:listPerson/tei:person[@xml:id=$ref]/tei:persName/tei:forename, ' ')"/>
<xsl:copy-of select="concat(//tei:listPerson/tei:person[@xml:id=$ref]/tei:persName/tei:surname, ',')"/>
<xsl:if test="//tei:listPerson/tei:person[@xml:id=$ref]/tei:occupation"><xsl:copy-of select="concat(//tei:listPerson/tei:person[@xml:id=$ref]/tei:occupation, ',')"/></xsl:if>
<xsl:if test="//tei:listPerson/tei:person[@xml:id=$ref]/tei:birth">
<xsl:copy-of select="concat(//tei:listPerson/tei:person[@xml:id=$ref]/tei:birth/tei:date, ' ')"/>
<xsl:copy-of select="concat('(', //tei:listPerson/tei:person[@xml:id=$ref]/tei:birth/tei:placeName/tei:settlement[@type='municipality'], ') - ')"/>
</xsl:if>
<xsl:if test="//tei:listPerson/tei:person[@xml:id=$ref]/tei:death">
<xsl:copy-of select="concat(//tei:listPerson/tei:person[@xml:id=$ref]/tei:death/tei:date, ' ')"/>
<xsl:copy-of select="concat('(', //tei:listPerson/tei:person[@xml:id=$ref]/tei:death/tei:placeName/tei:settlement[@type='municipality'], ') ')"/>
</xsl:if>
<xsl:if test="//tei:listPerson/tei:person[@xml:id=$ref]/tei:note">
<xsl:copy-of select="//tei:listPerson/tei:person[@xml:id=$ref]/tei:note"/>
</xsl:if>
</xsl:variable>
<xsl:attribute name="class">hovertext</xsl:attribute>
<xsl:attribute name="data-hover">
<xsl:value-of select="$testo-hover"/>
</xsl:attribute>
<xsl:value-of select="current()" />
</xsl:element>
</xsl:template>
<!--placeName-->
<xsl:template match="//tei:placeName">
<xsl:element name="span">
<xsl:variable name="testo-hover">
<xsl:variable name="ref">
<xsl:value-of select="substring-after(current()/@ref, '#')"/>
</xsl:variable>
<xsl:copy-of select="concat(//tei:listPlace/tei:place[@xml:id=$ref]/tei:placeName, ',')"/>
<xsl:if test="//tei:listPlace/tei:place[@xml:id=$ref]/tei:note">
<xsl:copy-of select="concat(//tei:listPlace/tei:place[@xml:id=$ref]/tei:note, ' ')"/>
</xsl:if>
<xsl:if test="//tei:listPlace/tei:place[@xml:id=$ref]/tei:settlement">
<xsl:copy-of select="concat(//tei:listPlace/tei:place[@xml:id=$ref]/tei:settlement, ', ')"/>
</xsl:if>
<xsl:copy-of select="concat(//tei:listPlace/tei:place[@xml:id=$ref]/tei:country, ',')"/>
</xsl:variable>
<xsl:attribute name="class">hovertext</xsl:attribute>
<xsl:attribute name="data-hover">
<xsl:value-of select="$testo-hover"/>
</xsl:attribute>
<xsl:value-of select="current()" />
</xsl:element>
</xsl:template>
<!--orgName-->
<xsl:template match="//tei:orgName">
<xsl:element name="span">
<xsl:variable name="testo-hover">
<xsl:variable name="ref">
<xsl:value-of select="substring-after(current()/@ref, '#')"/>
</xsl:variable>
<xsl:copy-of select="concat(//tei:listOrg/tei:org[@xml:id=$ref]/tei:orgName, ': ')"/>
<xsl:copy-of select="concat(//tei:listOrg/tei:org[@xml:id=$ref]/tei:desc, ' ')"/>
<xsl:copy-of select="concat('(',//tei:listOrg/tei:org[@xml:id=$ref]/tei:placeName, ')')"/>
</xsl:variable>
<xsl:attribute name="class">hovertext</xsl:attribute>
<xsl:attribute name="data-hover">
<xsl:value-of select="$testo-hover"/>
</xsl:attribute>
<xsl:value-of select="current()" />
</xsl:element>
</xsl:template>
<!--glossario-->
<xsl:template match="//tei:term">
<xsl:if test="not(current()/parent::tei:choice/parent::tei:term)">
<xsl:element name="span">
<xsl:variable name="testo-hover">
<xsl:variable name="ref">
<xsl:value-of select="substring-after(current()/@ref, '#')"/>
</xsl:variable>
<!--orth-->
<xsl:choose>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]">
<xsl:copy-of select="concat(//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]/tei:form/tei:orth[1], ': ')"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry[@xml:id=$ref]">
<xsl:copy-of select="concat(//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry[@xml:id=$ref]/tei:form/tei:orth, ': ')"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry/tei:sense/tei:sense[@xml:id=$ref]">
<xsl:copy-of select="concat(//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/ancestor::tei:entry/tei:form/tei:orth, ': ')"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]">
<xsl:copy-of select="concat(//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/ancestor::tei:entry/tei:form/tei:orth, ': ')"/>
</xsl:when>
</xsl:choose>
<!--def-->
<xsl:choose>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]/tei:sense/tei:def">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]/tei:sense/tei:def"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]/tei:sense/tei:cit/tei:quote">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry[@xml:id=$ref]/tei:sense/tei:cit/tei:quote"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry[@xml:id=$ref]/tei:sense/tei:def">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry[@xml:id=$ref]/tei:sense/tei:def"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:superEntry/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def/tei:cit/tei:quote">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def/tei:cit/tei:quote"/>
</xsl:when>
<xsl:when test="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def">
<xsl:copy-of select="//tei:TEI[@xml:id='glossario']/tei:text/tei:body/tei:entry/tei:sense/tei:sense[@xml:id=$ref]/tei:def"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:attribute name="class">hovertext</xsl:attribute>
<xsl:attribute name="data-hover">
<xsl:value-of select="$testo-hover"/>
</xsl:attribute>
<xsl:value-of select="current()" />
</xsl:element>
</xsl:if>
</xsl:template>
<!--Numeri scritti a mano-->
<xsl:template match="//tei:group[@xml:id='fr_Prolusioni']/tei:text[1]/tei:body/tei:ab/tei:fw | //tei:group[@xml:id='fr_Prolusioni']/tei:text[1]/tei:body/tei:div/tei:fw">
<xsl:element name="span">
<xsl:attribute name="type">pageNum</xsl:attribute>
<xsl:attribute name="id"><xsl:value-of select="current()/@xml:id"/> </xsl:attribute>
<xsl:attribute name="rend"><xsl:value-of select="current()/@rend"/></xsl:attribute>
<xsl:attribute name="facs"><xsl:value-of select="current()/@facs"/></xsl:attribute>
<xsl:value-of select="current()" />
</xsl:element>
</xsl:template>
<!--Numeri stampati-->
<xsl:template match="//tei:group[@xml:id='fr_Prolusioni']/tei:text[1]/tei:body/tei:ab/tei:stamp">
<xsl:element name="span">
<xsl:attribute name="type">pageNum</xsl:attribute>
<xsl:attribute name="id"><xsl:value-of select="current()/@xml:id"/> </xsl:attribute>
<xsl:attribute name="rend"><xsl:value-of select="current()/@rend"/></xsl:attribute>
<xsl:attribute name="facs"><xsl:value-of select="current()/@facs"/></xsl:attribute>
<xsl:value-of select="current()" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>