-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathas-ead-html-jmu.xsl
1348 lines (1279 loc) · 63.9 KB
/
as-ead-html-jmu.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
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:ns2="http://www.w3.org/1999/xlink"
xmlns:local="http://www.yoursite.org/namespace"
xmlns:ead="urn:isbn:1-931666-22-9"
xmlns:functx="http://www.functx.com"
version="2.0" exclude-result-prefixes="#all">
<!--
*******************************************************************
* *
* VERSION: 1.0 *
* *
* AUTHOR: Winona Salesky *
* wsalesky@gmail.com *
* *
* DATE: 2013-08-21 *
* *
* ABOUT: This file has been created for use with *
* EAD xml files exported from the *
* ArchivesSpace web application. *
* *
* Modified 2019-07-23 by Rebecca B. French *
*******************************************************************
-->
<xsl:output indent="yes" method="html"
exclude-result-prefixes="#all"
omit-xml-declaration="yes"
encoding="utf-8"/>
<xsl:strip-space elements="*"/>
<!-- Calls a stylesheet with local functions and lists for languages and subject authorities -->
<xsl:include href="as-helper-functions-jmu.xsl"/>
<!-- RBF Replacement functions for OpenURL -->
<xsl:variable name="fr" select="('A Guide to the ', 'A Guide to ', '&', '"', ' ')"/>
<xsl:variable name="to" select="('', '', '%26', '%22', '%20')"/>
<xsl:function name="functx:replace-multi" as="xs:string?"
xmlns:functx="http://www.functx.com">
<xsl:param name="arg" as="xs:string?"/>
<xsl:param name="changeFrom" as="xs:string*"/>
<xsl:param name="changeTo" as="xs:string*"/>
<xsl:sequence select="
if (count($changeFrom) > 0)
then functx:replace-multi(
replace($arg, $changeFrom[1],
functx:if-absent($changeTo[1],'')),
$changeFrom[position() > 1],
$changeTo[position() > 1])
else $arg
"/>
</xsl:function>
<xsl:function name="functx:if-absent" as="item()*"
xmlns:functx="http://www.functx.com">
<xsl:param name="arg" as="item()*"/>
<xsl:param name="value" as="item()*"/>
<xsl:sequence select="
if (exists($arg))
then $arg
else $value
"/>
</xsl:function>
<!-- RBF variable to construct openURL for Aeon request link -->
<xsl:variable name="openurl">
<xsl:text>https://aeon.lib.jmu.edu/logon?Action=10&Form=30&genre=manuscript&title=</xsl:text>
<xsl:value-of select='functx:replace-multi(replace(normalize-space(ead:ead/ead:eadheader/ead:filedesc/ead:titlestmt/ead:titleproper/text()), "'", "%27"), $fr, $to)'/>
<xsl:text>&author=</xsl:text>
<xsl:for-each select="ead:ead/ead:archdesc/ead:did/ead:origination[not(@label='source')]">
<xsl:value-of select='functx:replace-multi(replace(normalize-space(.), "'", "%27"), $fr, $to)'/>
<xsl:if test="not(position()=last())">
<xsl:text>;%20</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>&callnumber=</xsl:text>
<xsl:value-of select="replace(ead:ead/ead:archdesc/ead:did/ead:unitid[not(@audience='internal')], ' ', '%20')"/>
</xsl:variable>
<!-- Named template for a generic p element with a link back to the the top of the page -->
<xsl:template name="top">
<p class="top"><a href="#main"><strong>^</strong> Top</a></p>
</xsl:template>
<xsl:template match="/">
<div id="content" class="full ascontent">
<xsl:apply-templates select="ead:ead/ead:archdesc" mode="toc"/>
<xsl:apply-templates select="ead:ead/ead:archdesc"/>
</div>
</xsl:template>
<!-- Build table of contents -->
<xsl:template match="ead:archdesc" mode="toc">
<div id="toc">
<!-- RBF add request button -->
<div id="requestlink">
<button type="request" class="btn request" onclick="window.open('{$openurl}', '_blank')">Request for use in Special Collections</button>
</div>
<!-- RBF changes end -->
<ul>
<xsl:if test="ead:did">
<li><a href="#{local:buildID(ead:did)}"><xsl:value-of select="local:tagName(ead:did)"/></a></li>
</xsl:if>
<xsl:if test="ead:bioghist">
<li><a href="#{local:buildID(ead:bioghist[1])}"><xsl:value-of select="local:tagName(ead:bioghist[1])"/></a></li>
</xsl:if>
<xsl:if test="ead:scopecontent">
<li><a href="#{local:buildID(ead:scopecontent[1])}"><xsl:value-of select="local:tagName(ead:scopecontent[1])"/></a></li>
</xsl:if>
<xsl:if test="ead:arrangement">
<li><a href="#{local:buildID(ead:arrangement[1])}"><xsl:value-of select="local:tagName(ead:arrangement[1])"/></a></li>
</xsl:if>
<xsl:if test="ead:fileplan">
<li><a href="#{local:buildID(ead:fileplan[1])}"><xsl:value-of select="local:tagName(ead:fileplan[1])"/></a></li>
</xsl:if>
<!-- Administrative Information -->
<xsl:if test="ead:accessrestrict or ead:userestrict or
ead:custodhist or ead:accruals or ead:altformavail or ead:acqinfo or
ead:processinfo or ead:appraisal or ead:originalsloc or
/ead:ead/ead:eadheader/ead:filedesc/ead:publicationstmt or /ead:ead/ead:eadheader/ead:revisiondesc">
<li><a href="#adminInfo">Administrative Information</a></li>
</xsl:if>
<!-- Related Materials -->
<xsl:if test="ead:relatedmaterial or ead:separatedmaterial">
<li><a href="#relMat">Related Materials</a></li>
</xsl:if>
<xsl:if test="ead:controlaccess">
<li><a href="#{local:buildID(ead:controlaccess[1])}"><xsl:value-of select="local:tagName(ead:controlaccess[1])"/></a></li>
</xsl:if>
<xsl:if test="ead:otherfindaid">
<li><a href="#{local:buildID(ead:otherfindaid[1])}"><xsl:value-of select="local:tagName(ead:otherfindaid[1])"/></a></li>
</xsl:if>
<xsl:if test="ead:phystech">
<li><a href="#{local:buildID(ead:phystech[1])}"><xsl:value-of select="local:tagName(ead:phystech[1])"/></a></li>
</xsl:if>
<xsl:if test="ead:odd">
<li><a href="#{local:buildID(ead:odd[1])}"><xsl:value-of select="local:tagName(ead:odd[1])"/></a></li>
</xsl:if>
<xsl:if test="ead:bibliography">
<li><a href="#{local:buildID(ead:bibliography[1])}"><xsl:value-of select="local:tagName(ead:bibliography[1])"/></a></li>
</xsl:if>
<xsl:if test="ead:index">
<li><a href="#{local:buildID(ead:index[1])}"><xsl:value-of select="local:tagName(ead:index[1])"/></a></li>
</xsl:if>
<!-- Build Container List menu and submenu -->
<xsl:for-each select="ead:dsc">
<xsl:if test="child::*">
<li><a href="#{local:buildID(.)}"><xsl:value-of select="local:tagName(.)"/></a></li>
</xsl:if>
<!--Creates a submenu for collections, record groups and series and fonds-->
<xsl:for-each select="child::*[@level = 'collection']
| child::*[@level = 'recordgrp'] | child::*[@level = 'series'] | child::*[@level = 'fonds']">
<li class="submenu">
<a href="#{local:buildID(.)}">
<xsl:choose>
<xsl:when test="ead:head">
<xsl:apply-templates select="child::*/ead:head"/>
</xsl:when>
<xsl:otherwise>
<!-- RBF add ID -->
<xsl:apply-templates select="child::*/ead:unitid"/>
<xsl:text>: </xsl:text>
<!-- RBF changes end -->
<xsl:apply-templates select="child::*/ead:unittitle"/>
</xsl:otherwise>
</xsl:choose>
</a>
</li>
<!-- Creates a submenu for subfonds, subgrp or subseries -->
<xsl:for-each select="child::*[@level = 'subfonds'] | child::*[@level = 'subgrp'] | child::*[@level = 'subseries']">
<li class="submenu2">
<a href="#{local:buildID(.)}">
<xsl:choose>
<xsl:when test="ead:head">
<xsl:apply-templates select="child::*/ead:head"/>
</xsl:when>
<xsl:otherwise>
<!-- RBF add ID -->
<xsl:apply-templates select="child::*/ead:unitid"/>
<xsl:text>: </xsl:text>
<!-- RBF changes end -->
<xsl:apply-templates select="child::*/ead:unittitle"/>
</xsl:otherwise>
</xsl:choose>
</a>
</li>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</ul>
</div>
</xsl:template>
<!--
Formats children of archdesc. This template orders the children of the archdesc,
if order is changed, remeber to also change it in the table of contents as well.
-->
<!-- Calls and organizes children of the archdesc -->
<xsl:template match="ead:archdesc">
<div id="archdesc">
<!-- RBF remove title -->
<!-- <xsl:apply-templates select="/ead:ead/ead:eadheader/ead:filedesc/ead:titlestmt"/> -->
<xsl:apply-templates select="ead:did"/>
<xsl:apply-templates select="ead:bioghist"/>
<xsl:apply-templates select="ead:scopecontent"/>
<xsl:apply-templates select="ead:arrangement"/>
<xsl:apply-templates select="ead:fileplan"/>
<!-- Administrative Information -->
<xsl:if test="ead:accessrestrict or ead:userestrict or
ead:custodhist or ead:accruals or ead:altformavail or ead:acqinfo or
ead:processinfo or ead:appraisal or ead:originalsloc or
/ead:ead/ead:eadheader/ead:filedesc/ead:publicationstmt or /ead:ead/ead:eadheader/ead:revisiondesc">
<div class="section">
<h2 id="adminInfo">Administrative Information</h2>
<xsl:apply-templates select="ead:accessrestrict | ead:userestrict |
ead:custodhist | ead:accruals | ead:altformavail | ead:acqinfo |
ead:processinfo | ead:appraisal | ead:originalsloc |
/ead:ead/ead:eadheader/ead:revisiondesc"/>
<!-- RBF move publication statement -->
<xsl:apply-templates select="/ead:ead/ead:eadheader/ead:filedesc/ead:publicationstmt"/>
<xsl:call-template name="top"/>
</div>
</xsl:if>
<!-- Related Materials -->
<xsl:if test="ead:relatedmaterial or ead:separatedmaterial">
<div class="section">
<h2 id="relMat">Related Materials</h2>
<xsl:apply-templates select="ead:relatedmaterial | ead:separatedmaterial"/>
<xsl:call-template name="top"/>
</div>
</xsl:if>
<xsl:apply-templates select="ead:controlaccess"/>
<xsl:apply-templates select="ead:otherfindaid"/>
<xsl:apply-templates select="ead:phystech"/>
<xsl:apply-templates select="ead:odd"/>
<xsl:apply-templates select="ead:bibliography"/>
<xsl:apply-templates select="ead:index"/>
<xsl:apply-templates select="ead:dsc"/>
</div>
</xsl:template>
<!-- Finding aid title -->
<xsl:template match="ead:titlestmt">
<div id="header">
<h1>
<!-- RBF replace title -->
<!-- <xsl:choose>
<xsl:when test="ead:titleproper[@type='filing']">
<xsl:apply-templates select="ead:titleproper[@type='filing']"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="ead:titleproper[1]"/>
</xsl:otherwise>
</xsl:choose> -->
<xsl:value-of select="normalize-space(ead:titleproper/text())"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="ead:titleproper/ead:num"/>
<!-- RBF changes end -->
</h1>
<xsl:if test="ead:subtitle">
<h2><xsl:apply-templates select="ead:subtitle"/></h2>
</xsl:if>
</div>
</xsl:template>
<!-- Formats archdesc did -->
<xsl:template match="ead:archdesc/ead:did">
<div class="section">
<h2 id="{local:buildID(.)}">Summary Information</h2>
<div class="sectionContent">
<!--
Determines the order in which elements from the archdesc did appear,
to change the order of appearance for the children of did
by changing the order of the following statements.
-->
<dl class="summary">
<xsl:apply-templates select="ead:repository" mode="overview"/>
<xsl:apply-templates select="ead:origination" mode="overview"/>
<xsl:apply-templates select="ead:unittitle" mode="overview"/>
<xsl:apply-templates select="ead:unitid" mode="overview"/>
<!-- RBF display all dates on one line -->
<!--<xsl:apply-templates select="ead:unitdate" mode="overview"/>-->
<xsl:if test="ead:unitdate">
<dt>
<xsl:value-of select="local:tagName(./ead:unitdate[1])"/>
<xsl:text>: </xsl:text>
</dt>
<dd>
<xsl:for-each select="./ead:unitdate[not(@type='bulk')]">
<xsl:value-of select="."/>
<xsl:if test="not(position()=last())">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:if test="./ead:unitdate[@type='bulk']">
<xsl:text> (bulk </xsl:text>
<xsl:value-of select="./ead:unitdate[@type='bulk']"/>
<xsl:text>)</xsl:text>
</xsl:if>
</dd>
</xsl:if>
<!-- RBF changes end -->
<xsl:apply-templates select="ead:physdesc" mode="overview"/>
<!-- <xsl:apply-templates select="ead:physloc" mode="overview"/> -->
<xsl:apply-templates select="ead:dao" mode="overview"/>
<xsl:apply-templates select="ead:daogrp" mode="overview"/>
<xsl:apply-templates select="ead:langmaterial" mode="overview"/>
<xsl:apply-templates select="ead:materialspec" mode="overview"/>
<xsl:apply-templates select="ead:container" mode="overview"/>
<xsl:apply-templates select="ead:abstract" mode="overview"/>
<xsl:apply-templates select="ead:note" mode="overview"/>
</dl>
<xsl:apply-templates select="../ead:prefercite" mode="overview"/>
</div>
<xsl:call-template name="top"/>
</div>
</xsl:template>
<!-- Formats prefercite in the summary -->
<xsl:template match="ead:prefercite" mode="overview">
<div class="citation">
<div class="section">
<h3><xsl:value-of select="local:tagName(.)"/></h3>
<div class="sectionContent">
<xsl:apply-templates/>
</div>
</div>
</div>
</xsl:template>
<!-- Formats children of archdesc/did -->
<!-- RBF removed ead:origination, ead:unitid, and ead:physdesc; created separate templates -->
<!-- RBF removed ead:unitdate and moved to template ead:archdesc/ead:did -->
<xsl:template match="ead:repository | ead:unittitle
| ead:physloc | ead:dao | ead:daogrp | ead:langmaterial | ead:materialspec | ead:container
| ead:abstract | ead:note" mode="overview">
<dt>
<xsl:choose>
<!-- Test for label attribute used by origination element -->
<xsl:when test="@label">
<xsl:value-of select="concat(upper-case(substring(@label,1,1)),substring(@label,2))"></xsl:value-of>
<!-- RBF remove type -->
<!-- <xsl:if test="@type"> [<xsl:value-of select="@type"/>]</xsl:if> -->
<!-- RBF remove roles -->
<!-- <xsl:if test="self::ead:origination">
<xsl:choose>
<xsl:when test="ead:persname[@role != ''] and contains(ead:persname/@role,' (')">
- <xsl:value-of select="substring-before(ead:persname/@role,' (')"/>
</xsl:when>
<xsl:when test="ead:persname[@role != '']">
- <xsl:value-of select="ead:persname/@role"/>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:if> -->
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="local:tagName(.)"/>
<!-- RBF remove type -->
<!-- Test for type attribute used by unitdate -->
<!-- <xsl:if test="@type"> [<xsl:value-of select="@type"/>]</xsl:if> -->
</xsl:otherwise>
</xsl:choose>:
</dt>
<dd>
<!-- RBF add id for Aeon -->
<xsl:choose>
<xsl:when test="self::ead:unittitle">
<span id="Aeon_title">
<xsl:apply-templates/>
</span>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</dd>
</xsl:template>
<!-- Adds space between extents -->
<xsl:template match="ead:extent"><xsl:apply-templates/><xsl:text> </xsl:text></xsl:template>
<!-- RBF new template for archdesc/did/origination -->
<xsl:template match="ead:origination" mode="overview">
<!-- Don't display origination elements with @label=source -->
<xsl:if test="not(self::ead:origination[@label='source'])">
<dt>
<xsl:value-of select="concat(upper-case(substring(@label,1,1)),substring(@label,2))"/>
<xsl:text>: </xsl:text>
</dt>
<dd>
<span id="Aeon_creator">
<xsl:apply-templates/>
</span>
</dd>
</xsl:if>
</xsl:template>
<!-- RBF new template for archdesc/did/unitid -->
<xsl:template match="ead:unitid" mode="overview">
<!-- Only display unitid element if @audience is not internal -->
<xsl:if test="self::ead:unitid[not(@audience='internal')]">
<dt>
<xsl:value-of select="local:tagName(.)"/>
<xsl:text>: </xsl:text>
</dt>
<dd>
<span id="Aeon_callnum">
<xsl:apply-templates/>
</span>
</dd>
</xsl:if>
</xsl:template>
<!-- RBF new template for archdesc/did/unitdate -->
<!--<xsl:template match="ead:did" mode="overview">
<xsl:if test="ead:unitdate">
<dt>
<xsl:value-of select="local:tagName(.)"/>
<xsl:text>: </xsl:text>
</dt>
<dd>
<xsl:for-each select=".[@type='inclusive']">
<xsl:value-of select="."/>
<xsl:if test="not(position()=last())">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:if test=".[@type='bulk']">
<xsl:text>(bulk </xsl:text>
<xsl:value-of select="."/>
<xsl:text>)</xsl:text>
</xsl:if>
</dd>
</xsl:if>
</xsl:template>-->
<!-- RBF new template for archdesc/did/physdesc -->
<xsl:template match="ead:physdesc" mode="overview">
<!-- Only display physdesc element if extent has @altrender -->
<xsl:if test="self::ead:physdesc/ead:extent[@altrender]">
<dt>
<xsl:value-of select="local:tagName(.)"/>
<xsl:text>: </xsl:text>
</dt>
<dd>
<xsl:for-each select="./ead:extent[@altrender]/..">
<xsl:if test="./ead:extent[@altrender='carrier']">
<xsl:value-of select="./ead:extent[@altrender='carrier']/text()"/>
<xsl:if test="./ead:extent[not(@altrender='carrier')]">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:if>
<xsl:for-each select="./ead:extent[not(@altrender='carrier')]">
<xsl:value-of select="./text()"/>
<xsl:if test="not(position()=last())">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:if test="not(position()=last())">
<xsl:text>; </xsl:text>
</xsl:if>
</xsl:for-each>
</dd>
</xsl:if>
</xsl:template>
<!-- Formats children of archdesc -->
<xsl:template match="ead:bibliography | ead:odd | ead:phystech | ead:otherfindaid |
ead:bioghist | ead:scopecontent | ead:arrangement | ead:fileplan">
<div class="section">
<h2 id="{local:buildID(.)}"><xsl:value-of select="local:tagName(.)"/></h2>
<div class="sectionContent">
<xsl:apply-templates/>
</div>
<xsl:call-template name="top"/>
</div>
</xsl:template>
<!-- Formats children of archdesc in administrative and related materials sections -->
<xsl:template match="ead:relatedmaterial | ead:separatedmaterial | ead:accessrestrict | ead:userestrict |
ead:custodhist | ead:accruals | ead:altformavail | ead:acqinfo |
ead:processinfo | ead:appraisal | ead:originalsloc">
<div class="section">
<h3 id="{local:buildID(.)}"><xsl:value-of select="local:tagName(.)"/></h3>
<div class="sectionContent">
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
<!-- Publication statement included in administrative information section -->
<xsl:template match="ead:publicationstmt">
<div class="section">
<h3 id="{local:buildID(.)}"><xsl:value-of select="local:tagName(.)"/></h3>
<div class="sectionContent">
<p><xsl:apply-templates select="ead:publisher"/>
<xsl:if test="ead:date"><xsl:text> </xsl:text><xsl:apply-templates select="ead:date"/></xsl:if>
</p>
<xsl:apply-templates select="ead:address"/>
</div>
</div>
</xsl:template>
<!-- Formats address elements -->
<xsl:template match="ead:address">
<p>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="ead:addressline">
<xsl:choose>
<xsl:when test="contains(.,'@')">
<span class="addressLine">
<a href="mailto:{.}"><xsl:apply-templates/></a>
</span>
</xsl:when>
<xsl:otherwise>
<span class="addressLine">
<xsl:apply-templates/>
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Formats revision description -->
<xsl:template match="ead:revisiondesc">
<div class="section">
<h3 id="{local:buildID(.)}"><xsl:value-of select="local:tagName(.)"/></h3>
<div class="sectionContent">
<xsl:for-each select="ead:change">
<p>
<xsl:if test="./ead:item"><xsl:apply-templates select="./ead:item"/></xsl:if>
<xsl:if test="./ead:date"><xsl:text> </xsl:text><xsl:apply-templates select="./ead:date"/></xsl:if>
</p>
</xsl:for-each>
</div>
</div>
</xsl:template>
<!-- Formats controlled access terms -->
<xsl:template match="ead:controlaccess">
<div class="section">
<h2 id="{local:buildID(.)}"><xsl:value-of select="local:tagName(.)"/></h2>
<xsl:for-each-group select="child::*" group-by="name(.)">
<xsl:sort select="current-grouping-key()"/>
<div class="section">
<h3 id="{local:buildID(.)}"><xsl:value-of select="local:tagName(.)"/></h3>
<div class="sectionContent">
<ul>
<xsl:for-each select="current-group()">
<li><xsl:apply-templates/></li>
</xsl:for-each>
</ul>
</div>
</div>
</xsl:for-each-group>
<xsl:call-template name="top"/>
</div>
</xsl:template>
<xsl:template match="ead:controlaccess/child::*">
<li><xsl:apply-templates/></li>
</xsl:template>
<!-- Formats index and child elements, groups indexentry elements by type (i.e. corpname, subject...) -->
<xsl:template match="ead:index">
<div class="section">
<h2 id="{local:buildID(.)}"><xsl:value-of select="local:tagName(.)"/></h2>
<div class="sectionContent">
<xsl:apply-templates select="child::*[not(self::ead:indexentry)]"/>
<ul>
<xsl:apply-templates select="ead:indexentry"/>
</ul>
</div>
<xsl:call-template name="top"/>
</div>
</xsl:template>
<xsl:template match="ead:indexentry">
<li><xsl:apply-templates/></li>
</xsl:template>
<xsl:template match="ead:indexentry/ead:ref">
<span class="ref"><xsl:apply-templates/></span>
</xsl:template>
<!--Formats a simple table. The width of each column is defined by the colwidth attribute in a colspec element. -->
<xsl:template match="ead:table">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="ead:table/ead:thead">
<h4><xsl:apply-templates/></h4>
</xsl:template>
<xsl:template match="ead:tgroup">
<table>
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="ead:colspec">
<td width="{@colwidth}"/>
</xsl:template>
<xsl:template match="ead:thead">
<xsl:apply-templates mode="thead"/>
</xsl:template>
<xsl:template match="ead:tbody">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="ead:row" mode="thead">
<tr class="thead"><xsl:apply-templates/></tr>
</xsl:template>
<xsl:template match="ead:row">
<tr><xsl:apply-templates/></tr>
</xsl:template>
<xsl:template match="ead:entry">
<td><xsl:apply-templates/></td>
</xsl:template>
<!--Bibref citation inline, if there is a p parent element.-->
<xsl:template match="ead:p/ead:bibref">
<xsl:choose>
<xsl:when test="@*:href">
<a href="{@*:href}"><xsl:apply-templates/></a>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--Bibref citation on its own line, typically when it is a child of the bibliography element-->
<xsl:template match="ead:bibref">
<p class="list">
<xsl:choose>
<xsl:when test="@*:href">
<a href="{@*:href}"><xsl:apply-templates/></a>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</p>
</xsl:template>
<!-- Output for a variety of list types -->
<xsl:template match="ead:list">
<xsl:apply-templates select="ead:head"/>
<!-- Selects list type -->
<xsl:choose>
<xsl:when test="ead:listhead">
<table class="tlist">
<tr>
<th><xsl:value-of select="ead:listhead/ead:head01"/></th>
<th><xsl:value-of select="ead:listhead/ead:head02"/></th>
</tr>
<xsl:apply-templates select="ead:defitem" mode="listTable"/>
</table>
</xsl:when>
<xsl:when test="@type = 'simple'">
<ul class="simple">
<xsl:apply-templates select="ead:item"/>
</ul>
</xsl:when>
<xsl:when test="@type = 'deflist'">
<dl>
<xsl:apply-templates select="ead:defitem"/>
</dl>
</xsl:when>
<xsl:when test="@type = 'marked'">
<ul>
<xsl:apply-templates select="ead:item"/>
</ul>
</xsl:when>
<xsl:when test="@type = 'ordered'">
<ol>
<xsl:if test="@numeration">
<xsl:attribute name="class"><xsl:value-of select="@numeration"/></xsl:attribute>
</xsl:if>
<xsl:apply-templates select="ead:item"/>
</ol>
</xsl:when>
<xsl:otherwise>
<ul class="simple">
<xsl:apply-templates select="ead:item"/>
</ul>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="ead:list/ead:item">
<li><xsl:apply-templates/></li>
</xsl:template>
<xsl:template match="ead:defitem">
<dt><xsl:apply-templates select="ead:label"/></dt>
<dd><xsl:apply-templates select="ead:item"/></dd>
</xsl:template>
<!-- Formats list as table if list has listhead element -->
<xsl:template match="ead:defitem" mode="listTable">
<tr>
<td><xsl:apply-templates select="ead:label"/></td>
<td><xsl:apply-templates select="ead:item"/></td>
</tr>
</xsl:template>
<!-- Output chronlist and children in a table -->
<xsl:template match="ead:chronlist">
<table>
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="ead:chronlist/ead:listhead">
<tr>
<th><xsl:apply-templates select="ead:head01"/></th>
<th><xsl:apply-templates select="ead:head02"/></th>
</tr>
</xsl:template>
<xsl:template match="ead:chronlist/ead:head">
<tr>
<th colspan="2"><xsl:apply-templates/></th>
</tr>
</xsl:template>
<xsl:template match="ead:chronitem">
<tr>
<!-- Adds alternating colors to table rows -->
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="(position() mod 2 = 0)">odd</xsl:when>
<xsl:otherwise>even</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td><xsl:apply-templates select="ead:date"/></td>
<td><xsl:apply-templates select="descendant::ead:event"/></td>
</tr>
</xsl:template>
<xsl:template match="ead:event">
<xsl:choose>
<xsl:when test="following-sibling::*">
<xsl:apply-templates/><br/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Formats notestmt and notes -->
<xsl:template match="ead:notestmt">
<h4>Note</h4>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="ead:note">
<xsl:choose>
<xsl:when test="parent::ead:notestmt">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="@label"><h4><xsl:value-of select="@label"/></h4><xsl:apply-templates/></xsl:when>
<xsl:otherwise><h4>Note</h4><xsl:apply-templates/></xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Formats legalstatus -->
<xsl:template match="ead:legalstatus">
<p><span class="strong"><xsl:value-of select="local:tagName(.)"/>:</span><xsl:text> </xsl:text><xsl:apply-templates/></p>
</xsl:template>
<!-- General headings -->
<!-- Most head tags are handled by local:tagName function -->
<xsl:template match="ead:head[parent::*/parent::ead:archdesc]"/>
<xsl:template match="ead:head">
<h4 id="{local:buildID(parent::*)}"><xsl:apply-templates/></h4>
</xsl:template>
<!-- Linking elmenets -->
<xsl:template match="ead:ref">
<a href="#{@target}">
<xsl:if test="@*:title">
<xsl:attribute name="title"><xsl:value-of select="@*:title"/></xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="text()">
<xsl:value-of select="."/>
</xsl:when>
<xsl:when test="@*:title">
<xsl:value-of select="@*:title"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@target"/>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:template>
<xsl:template match="ead:ptr">
<a href="#{@taget}">
<xsl:if test="@*:title">
<xsl:attribute name="title"><xsl:value-of select="@*:title"/></xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="child::*">
<xsl:apply-templates/>
</xsl:when>
<xsl:when test="@*:title">
<xsl:value-of select="@*:title"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@target"/>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:template>
<xsl:template match="ead:extref">
<a href="{@*:href}">
<xsl:if test="@*:title">
<xsl:attribute name="title"><xsl:value-of select="@*:title"/></xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="text()">
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@*:href"/>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:template>
<xsl:template match="ead:extrefloc">
<a href="{@*:href}">
<xsl:if test="@*:title">
<xsl:attribute name="title"><xsl:value-of select="@*:title"/></xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="text()">
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@*:href"/>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:template>
<xsl:template match="ead:extptr[@*:entityref]">
<a href="{@*:entityref}">
<xsl:choose>
<xsl:when test="@*:title"><xsl:value-of select="@*:title"/></xsl:when>
<xsl:otherwise><xsl:value-of select="@*:entityref"/></xsl:otherwise>
</xsl:choose>
</a>
</xsl:template>
<xsl:template match="ead:extptr[@*:href]">
<a href="{@*:href}">
<xsl:choose>
<xsl:when test="@*:title"><xsl:value-of select="@*:title"/></xsl:when>
<xsl:otherwise><xsl:value-of select="@*:href"/></xsl:otherwise>
</xsl:choose>
</a>
</xsl:template>
<xsl:template match="ead:dao">
<a href="{@*:href}">
<xsl:if test="@*:title">
<xsl:attribute name="title"><xsl:value-of select="@*:title"/></xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="child::*">
<xsl:value-of select="."/>
</xsl:when>
<xsl:when test="@*:title">
<xsl:value-of select="@*:title"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@*:href"/>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:template>
<xsl:template match="ead:daogrp">
<div>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="ead:daoloc">
<a href="{@*:href}">
<xsl:if test="@*:title">
<xsl:attribute name="title"><xsl:value-of select="@*:title"/></xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="text()">
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@*:href"/>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:template>
<!--Render elements -->
<xsl:template match="*[@render = 'bold'] | *[@altrender = 'bold'] ">
<xsl:if test="preceding-sibling::*"> <xsl:text> </xsl:text></xsl:if><strong><xsl:apply-templates/></strong>
</xsl:template>
<xsl:template match="*[@render = 'bolddoublequote'] | *[@altrender = 'bolddoublequote']">
<xsl:if test="preceding-sibling::*"> <xsl:text> </xsl:text></xsl:if><strong>"<xsl:apply-templates/>"</strong>
</xsl:template>
<xsl:template match="*[@render = 'boldsinglequote'] | *[@altrender = 'boldsinglequote']">
<xsl:if test="preceding-sibling::*"> <xsl:text> </xsl:text></xsl:if><strong>'<xsl:apply-templates/>'</strong>
</xsl:template>
<xsl:template match="*[@render = 'bolditalic'] | *[@altrender = 'bolditalic']">
<xsl:if test="preceding-sibling::*"> <xsl:text> </xsl:text></xsl:if><strong><em><xsl:apply-templates/></em></strong>
</xsl:template>
<xsl:template match="*[@render = 'boldsmcaps'] | *[@altrender = 'boldsmcaps']">
<xsl:if test="preceding-sibling::*"> <xsl:text> </xsl:text></xsl:if><strong><span class="smcaps"><xsl:apply-templates/></span></strong>
</xsl:template>
<xsl:template match="*[@render = 'boldunderline'] | *[@altrender = 'boldunderline']">
<xsl:if test="preceding-sibling::*"> <xsl:text> </xsl:text></xsl:if><strong><span class="underline"><xsl:apply-templates/></span></strong>
</xsl:template>
<xsl:template match="*[@render = 'doublequote'] | *[@altrender = 'doublequote']">
<xsl:if test="preceding-sibling::*"> <xsl:text> </xsl:text></xsl:if>"<xsl:apply-templates/>"
</xsl:template>
<xsl:template match="*[@render = 'italic'] | *[@altrender = 'italic']">
<xsl:if test="preceding-sibling::*"> <xsl:text> </xsl:text></xsl:if><em><xsl:apply-templates/></em>
</xsl:template>
<xsl:template match="*[@render = 'singlequote'] | *[@altrender = 'singlequote']">
<xsl:if test="preceding-sibling::*"> <xsl:text> </xsl:text></xsl:if>'<xsl:apply-templates/>'
</xsl:template>
<xsl:template match="*[@render = 'smcaps'] | *[@altrender = 'smcaps']">
<xsl:if test="preceding-sibling::*"> <xsl:text> </xsl:text></xsl:if><span class="smcaps"><xsl:apply-templates/></span>
</xsl:template>
<xsl:template match="*[@render = 'sub'] | *[@altrender = 'sub']">
<xsl:if test="preceding-sibling::*"> <xsl:text> </xsl:text></xsl:if><sub><xsl:apply-templates/></sub>
</xsl:template>
<xsl:template match="*[@render = 'super'] | *[@altrender = 'super']">
<xsl:if test="preceding-sibling::*"> <xsl:text> </xsl:text></xsl:if><sup><xsl:apply-templates/></sup>
</xsl:template>
<xsl:template match="*[@render = 'underline'] | *[@altrender = 'underline']">
<xsl:if test="preceding-sibling::*"> <xsl:text> </xsl:text></xsl:if><span class="underline"><xsl:apply-templates/></span>
</xsl:template>
<!-- formatting elements -->
<xsl:template match="ead:p">
<p><xsl:apply-templates/></p>
</xsl:template>
<xsl:template match="ead:lb"><br/></xsl:template>
<xsl:template match="ead:blockquote">
<blockquote><xsl:apply-templates/></blockquote>
</xsl:template>
<xsl:template match="ead:emph[not(@render)]"><em><xsl:apply-templates/></em></xsl:template>
<!-- Collection Inventory (dsc) templates -->
<xsl:template match="ead:archdesc/ead:dsc">
<div class="section">
<h2 id="{local:buildID(.)}"><xsl:value-of select="local:tagName(.)"/></h2>
<table class="dsc">
<xsl:if test="child::*[@level][1][@level='item' or @level='file' or @level='otherlevel']">
<xsl:call-template name="tableHeaders"/>
</xsl:if>
<xsl:apply-templates select="*[not(self::ead:head)]"/>
<tr>
<td/>
<td style="width: 12%;"/>
<td style="width: 12%;"/>
<td style="width: 12%;"/>
</tr>
</table>
</div>
</xsl:template>
<!--
Calls the clevel template passes the calculates the level of current component in xml tree and passes it to clevel template via the level parameter
Adds a row to with a link to top if level series
-->
<xsl:template match="ead:c | ead:c01 | ead:c02 | ead:c03 | ead:c04 | ead:c05 | ead:c06 | ead:c07 | ead:c08 | ead:c09 | ead:c10 | ead:c11 | ead:c12">
<xsl:variable name="findClevel" select="count(ancestor::*[not(ead:dsc or ead:archdesc or ead:ead)])"/>
<xsl:call-template name="clevel">
<xsl:with-param name="level" select="$findClevel"></xsl:with-param>
</xsl:call-template>
<xsl:if test="self::*[@level='series']">
<tr>
<td colspan="4">
<xsl:call-template name="top"/>
</td>
</tr>
</xsl:if>