-
Notifications
You must be signed in to change notification settings - Fork 0
/
as-ead-pdf.xsl
1705 lines (1645 loc) · 87 KB
/
as-ead-pdf.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: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:fo="http://www.w3.org/1999/XSL/Format" version="2.0" exclude-result-prefixes="#all">
<!--
*******************************************************************
* *
* VERSION: 1.0 *
* *
* AUTHOR: Winona Salesky *
* *
* DATE: 2013-08-21 *
* *
* ABOUT: This file has been created for use with *
* EAD xml files exported from the *
* ArchivesSpace web application. *
* *
*******************************************************************
-->
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
<!-- Calls a stylesheet with local functions and lookup lists for languages and subject authorities -->
<xsl:include href="as-helper-functions.xsl"/>
<xsl:strip-space elements="*"/>
<xsl:param name="pdf_image"/>
<!-- The following attribute sets are reusable styles used throughout the stylesheet. -->
<!-- Headings -->
<xsl:attribute-set name="h1">
<xsl:attribute name="font-size">22pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="margin-top">16pt</xsl:attribute>
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="h2">
<xsl:attribute name="font-size">16pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="border-top">4pt solid #333</xsl:attribute>
<xsl:attribute name="border-bottom">1pt dotted #333</xsl:attribute>
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
<xsl:attribute name="margin-top">4pt</xsl:attribute>
<xsl:attribute name="padding-top">8pt</xsl:attribute>
<xsl:attribute name="padding-bottom">8pt</xsl:attribute>
<xsl:attribute name="keep-with-next.within-page">always</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="h3">
<xsl:attribute name="font-size">14pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="margin-bottom">4pt</xsl:attribute>
<xsl:attribute name="padding-bottom">0</xsl:attribute>
<xsl:attribute name="keep-with-next.within-page">always</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="h4">
<xsl:attribute name="font-size">12pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="margin-bottom">4pt</xsl:attribute>
<xsl:attribute name="padding-bottom">0</xsl:attribute>
<xsl:attribute name="keep-with-next.within-page">always</xsl:attribute>
</xsl:attribute-set>
<!-- Headings with id attribute -->
<xsl:attribute-set name="h1ID" use-attribute-sets="h1">
<xsl:attribute name="id"><xsl:value-of select="local:buildID(.)"/></xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="h2ID" use-attribute-sets="h2">
<xsl:attribute name="id"><xsl:value-of select="local:buildID(.)"/></xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="h3ID" use-attribute-sets="h3">
<xsl:attribute name="id"><xsl:value-of select="local:buildID(.)"/></xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="h4ID" use-attribute-sets="h4">
<xsl:attribute name="id"><xsl:value-of select="local:buildID(.)"/></xsl:attribute>
</xsl:attribute-set>
<!-- Linking attributes styles -->
<xsl:attribute-set name="ref">
<xsl:attribute name="color">#0D6CB6</xsl:attribute>
<xsl:attribute name="text-decoration">underline</xsl:attribute>
</xsl:attribute-set>
<!-- Standard margin and padding for most fo:block elements, including paragraphs -->
<xsl:attribute-set name="smp">
<xsl:attribute name="margin">4pt</xsl:attribute>
<xsl:attribute name="padding">4pt</xsl:attribute>
</xsl:attribute-set>
<!-- Standard margin and padding for elements with in the dsc table -->
<xsl:attribute-set name="smpDsc">
<xsl:attribute name="margin">2pt</xsl:attribute>
<xsl:attribute name="padding">2pt</xsl:attribute>
</xsl:attribute-set>
<!-- Styles for main sections -->
<xsl:attribute-set name="section">
<xsl:attribute name="margin">4pt</xsl:attribute>
<xsl:attribute name="padding">4pt</xsl:attribute>
</xsl:attribute-set>
<!-- Table attributes for tables with borders -->
<xsl:attribute-set name="tableBorder">
<xsl:attribute name="table-layout">fixed</xsl:attribute>
<xsl:attribute name="width">100%</xsl:attribute>
<xsl:attribute name="border">.5pt solid #ccc</xsl:attribute>
<xsl:attribute name="border-collapse">separate</xsl:attribute>
<xsl:attribute name="space-after">12pt</xsl:attribute>
</xsl:attribute-set>
<!-- Table headings -->
<xsl:attribute-set name="th">
<xsl:attribute name="background-color">#ccc</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="text-align">left</xsl:attribute>
</xsl:attribute-set>
<!-- Table cells with borders -->
<xsl:attribute-set name="tdBorder">
<xsl:attribute name="border">.5pt solid #ccc</xsl:attribute>
<xsl:attribute name="border-collapse">separate</xsl:attribute>
</xsl:attribute-set>
<!-- Start main page design and layout -->
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-size="12pt" font-family="KurintoText,KurintoTextJP,KurintoTextKR,KurintoTextSC,NotoSerif">
<!-- Set up page types and page layouts -->
<fo:layout-master-set>
<!-- Page master for Cover Page -->
<fo:simple-page-master master-name="cover-page" page-width="8.5in" page-height="11in" margin="0.5in">
<fo:region-body margin="0.5in 0.5in 1in 0.5in"/>
<fo:region-before extent="0.2in"/>
<fo:region-after extent="2in"/>
</fo:simple-page-master>
<!-- Page master for Table of Contents -->
<fo:simple-page-master master-name="toc" page-width="8.5in" page-height="11in" margin="0.5in">
<fo:region-body margin-top="0.25in" margin-bottom="0.25in"/>
<fo:region-before extent="0.5in"/>
<fo:region-after extent="0.2in"/>
</fo:simple-page-master>
<!-- Page master for Finding Aid Contents -->
<fo:simple-page-master master-name="contents" page-width="8.5in" page-height="11in" margin="0.5in">
<fo:region-body margin-top="0.25in" margin-bottom="0.25in"/>
<fo:region-before extent="0.5in"/>
<fo:region-after extent="0.2in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<!-- Builds PDF bookmarks for all major sections -->
<xsl:apply-templates select="/ead:ead/ead:archdesc" mode="bookmarks"/>
<!-- The fo:page-sequence establishes headers, footers and the body of the page.-->
<!-- Cover page layout -->
<fo:page-sequence master-reference="cover-page">
<xsl:if test="/ead:ead/ead:eadheader/ead:filedesc/ead:publicationstmt">
<fo:static-content flow-name="xsl-region-after">
<xsl:apply-templates select="/ead:ead/ead:eadheader/ead:filedesc/ead:publicationstmt" mode="coverPage"/>
</fo:static-content>
</xsl:if>
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="/ead:ead/ead:eadheader/ead:filedesc/ead:titlestmt" mode="coverPage"/>
</fo:flow>
</fo:page-sequence>
<!-- Table of Contents layout -->
<fo:page-sequence master-reference="toc">
<!-- Page header -->
<fo:static-content flow-name="xsl-region-before" margin-top=".15in">
<fo:block color="dimgray" font-size="10pt" text-align="center">
<xsl:apply-templates select="ead:ead/ead:eadheader/ead:filedesc/ead:titlestmt" mode="pageHeader"/>
</fo:block>
</fo:static-content>
<!-- Page footer-->
<fo:static-content flow-name="xsl-region-after">
<fo:block text-align="center" color="dimgray">
<xsl:text>- Page </xsl:text>
<fo:page-number/>
<xsl:text> -</xsl:text>
</fo:block>
</fo:static-content>
<!-- Content of page -->
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="/ead:ead/ead:archdesc" mode="toc"/>
</fo:flow>
</fo:page-sequence>
<!-- All the rest -->
<fo:page-sequence master-reference="contents">
<!-- Page header -->
<fo:static-content flow-name="xsl-region-before" margin-top=".15in">
<fo:block color="dimgray" font-size="10pt" text-align="center">
<xsl:apply-templates select="ead:ead/ead:eadheader/ead:filedesc/ead:titlestmt" mode="pageHeader"/>
</fo:block>
</fo:static-content>
<!-- Page footer-->
<fo:static-content flow-name="xsl-region-after">
<fo:block text-align="center">
<xsl:text>- Page </xsl:text>
<fo:page-number/>
<xsl:text>- </xsl:text>
</fo:block>
</fo:static-content>
<!-- Content of page -->
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="/ead:ead/ead:archdesc"/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<!-- Named template to link back to the table of contents -->
<xsl:template name="toc">
<fo:block font-size="11pt" margin-top="12pt" margin-bottom="18pt">
<fo:basic-link text-decoration="none" internal-destination="toc" color="#0D6CB6"><fo:inline font-weight="bold">^</fo:inline> Return to Table of Contents </fo:basic-link>
</fo:block>
</xsl:template>
<!-- Cover page templates -->
<!-- Builds title -->
<xsl:template match="ead:titlestmt" mode="pageHeader">
<!-- Uses filing type title if present -->
<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:template>
<xsl:template match="ead:titlestmt" mode="coverPage">
<!-- Calls template with links to archive icon -->
<xsl:call-template name="icon"/>
<fo:block border-bottom="1pt solid #666" margin-top="1in" id="cover-page">
<fo:block xsl:use-attribute-sets="h1">
<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>
</fo:block>
<xsl:if test="ead:subtitle">
<fo:block font-size="16" font-weight="bold"><xsl:apply-templates select="ead:subtitle"/></fo:block>
</xsl:if>
<!-- HARVARD CUSTOMIZATION: display the sponsor -->
<xsl:if test="ead:sponsor">
<fo:block font-size="12">
<xsl:apply-templates select="ead:sponsor"/>
</fo:block>
</xsl:if>
</fo:block>
<fo:block margin-top="8pt">
<xsl:apply-templates select="/ead:ead/ead:eadheader/ead:profiledesc"/>
</fo:block>
<fo:block margin-top="8pt">
<xsl:apply-templates select="/ead:ead/ead:eadheader/ead:filedesc/ead:editionstmt"/>
</fo:block>
</xsl:template>
<xsl:template match="ead:publicationstmt" mode="coverPage">
<fo:block margin="0 1in">
<fo:block>
<xsl:apply-templates select="ead:publisher"/>
<xsl:if test="ead:date"> <xsl:apply-templates select="ead:date"/></xsl:if>
</fo:block>
<xsl:apply-templates select="ead:address"/>
</fo:block>
</xsl:template>
<xsl:template match="ead:profiledesc/child::*">
<fo:block><xsl:apply-templates/></fo:block>
</xsl:template>
<xsl:template match="ead:profiledesc/ead:language"> <xsl:value-of select="."/></xsl:template>
<xsl:template match="ead:profiledesc/ead:creation/ead:date">
<!--
Uses local function to format date into Month, day year.
To print date as seen in xml change to select="."
-->
<xsl:apply-templates select="local:parseDate(.)"/>
</xsl:template>
<!--
This template can be modified to include repository specific icons,
use the template as an example. PDF exports only support this single
icon template for an image in this directory specified by filename
i.e. src="myicon.png"
-->
<xsl:template name="icon">
<fo:block-container max-width="6.5in" max-height="4in">
<fo:block text-align="left">
<fo:external-graphic content-width="scale-down-to-fit"
content-height="scale-down-to-fit" width="100%" height="100%"
scaling="uniform">
<xsl:attribute name="src"><xsl:value-of select="$pdf_image"/></xsl:attribute>
</fo:external-graphic>
</fo:block>
</fo:block-container>
</xsl:template>
<!-- Generates PDF Bookmarks -->
<xsl:template match="ead:archdesc" mode="bookmarks">
<fo:bookmark-tree>
<fo:bookmark internal-destination="cover-page">
<fo:bookmark-title>Title Page</fo:bookmark-title>
</fo:bookmark>
<xsl:if test="ead:did">
<fo:bookmark internal-destination="{local:buildID(ead:did)}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:did)"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:bioghist">
<fo:bookmark internal-destination="{local:buildID(ead:bioghist[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:bioghist[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:scopecontent">
<fo:bookmark internal-destination="{local:buildID(ead:scopecontent[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:scopecontent[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:arrangement">
<fo:bookmark internal-destination="{local:buildID(ead:arrangement[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:arrangement[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:fileplan">
<fo:bookmark internal-destination="{local:buildID(ead:fileplan[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:fileplan[1])"/></fo:bookmark-title>
</fo:bookmark>
</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">
<fo:bookmark internal-destination="adminInfo">
<fo:bookmark-title>Administrative Information</fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<!-- Related Materials -->
<xsl:if test="ead:relatedmaterial or ead:separatedmaterial">
<fo:bookmark internal-destination="relMat">
<fo:bookmark-title>Related Materials</fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:controlaccess">
<fo:bookmark internal-destination="{local:buildID(ead:controlaccess[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:controlaccess[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:otherfindaid">
<fo:bookmark internal-destination="{local:buildID(ead:otherfindaid[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:otherfindaid[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:phystech">
<fo:bookmark internal-destination="{local:buildID(ead:phystech[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:phystech[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:odd">
<fo:bookmark internal-destination="{local:buildID(ead:odd[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:odd[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:bibliography">
<fo:bookmark internal-destination="{local:buildID(ead:bibliography[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:bibliography[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<xsl:if test="ead:index">
<fo:bookmark internal-destination="{local:buildID(ead:index[1])}">
<fo:bookmark-title><xsl:value-of select="local:tagName(ead:index[1])"/></fo:bookmark-title>
</fo:bookmark>
</xsl:if>
<!-- Build Container List menu and submenu -->
<xsl:for-each select="ead:dsc">
<xsl:if test="child::*">
<fo:bookmark internal-destination="{local:buildID(.)}">
<fo:bookmark-title><xsl:value-of select="local:tagName(.)"/></fo:bookmark-title>
</fo:bookmark>
</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']">
<fo:bookmark internal-destination="{local:buildID(.)}">
<fo:bookmark-title>
<xsl:choose>
<xsl:when test="ead:head">
<xsl:apply-templates select="child::*/ead:head"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="ead:did/ead:unittitle"/>
</xsl:otherwise>
</xsl:choose>
</fo:bookmark-title>
</fo:bookmark>
<!-- Creates a submenu for subfonds, subgrp or subseries -->
<xsl:for-each select="child::*[@level = 'subfonds'] | child::*[@level = 'subgrp'] | child::*[@level = 'subseries']">
<fo:bookmark internal-destination="{local:buildID(.)}">
<fo:bookmark-title>
<xsl:choose>
<xsl:when test="ead:head">
<xsl:apply-templates select="child::*/ead:head"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="ead:did/ead:unittitle"/>
</xsl:otherwise>
</xsl:choose>
</fo:bookmark-title>
</fo:bookmark>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</fo:bookmark-tree>
</xsl:template>
<!-- Table of Contents -->
<xsl:template match="ead:archdesc" mode="toc">
<fo:block line-height="18pt" margin-top="0.25in">
<fo:block xsl:use-attribute-sets="h2" id="toc">Table of Contents</fo:block>
<fo:block xsl:use-attribute-sets="section">
<xsl:if test="ead:did">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:did)}"><xsl:value-of select="local:tagName(ead:did)"/></fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="{local:buildID(ead:did)}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:bioghist">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:bioghist[1])}"><xsl:value-of select="local:tagName(ead:bioghist[1])"/></fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="{local:buildID(ead:bioghist[1])}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:scopecontent">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:scopecontent[1])}"><xsl:value-of select="local:tagName(ead:scopecontent[1])"/></fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="{local:buildID(ead:scopecontent[1])}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:arrangement">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:arrangement[1])}"><xsl:value-of select="local:tagName(ead:arrangement[1])"/></fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="{local:buildID(ead:arrangement[1])}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:fileplan">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:fileplan[1])}"><xsl:value-of select="local:tagName(ead:fileplan[1])"/></fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="{local:buildID(ead:fileplan[1])}"/>
</fo:block>
</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">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="adminInfo">Administrative Information</fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="adminInfo"/>
</fo:block>
</xsl:if>
<!-- Related Materials -->
<xsl:if test="ead:relatedmaterial or ead:separatedmaterial">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="relMat">Related Materials</fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="relMat"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:controlaccess">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:controlaccess[1])}"><xsl:value-of select="local:tagName(ead:controlaccess[1])"/></fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="{local:buildID(ead:controlaccess[1])}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:otherfindaid">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:otherfindaid[1])}"><xsl:value-of select="local:tagName(ead:otherfindaid[1])"/></fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="{local:buildID(ead:otherfindaid[1])}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:phystech">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:phystech[1])}"><xsl:value-of select="local:tagName(ead:phystech[1])"/></fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="{local:buildID(ead:phystech[1])}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:odd">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:odd[1])}"><xsl:value-of select="local:tagName(ead:odd[1])"/></fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="{local:buildID(ead:odd[1])}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:bibliography">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:bibliography[1])}"><xsl:value-of select="local:tagName(ead:bibliography[1])"/></fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="{local:buildID(ead:bibliography[1])}"/>
</fo:block>
</xsl:if>
<xsl:if test="ead:index">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(ead:index[1])}"><xsl:value-of select="local:tagName(ead:index[1])"/></fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="{local:buildID(ead:index[1])}"/>
</fo:block>
</xsl:if>
<!-- Build Container List menu and submenu -->
<xsl:for-each select="ead:dsc">
<xsl:if test="child::*">
<fo:block text-align-last="justify">
<fo:basic-link internal-destination="{local:buildID(.)}"><xsl:value-of select="local:tagName(.)"/></fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="{local:buildID(.)}"/>
</fo:block>
</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']">
<fo:block text-align-last="justify" margin-left="8pt">
<fo:basic-link internal-destination="{local:buildID(.)}">
<xsl:choose>
<xsl:when test="ead:head">
<xsl:apply-templates select="child::*/ead:head"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="child::*/ead:unittitle"/>
</xsl:otherwise>
</xsl:choose>
</fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="{local:buildID(.)}"/>
</fo:block>
<!-- Creates a submenu for subfonds, subgrp or subseries -->
<xsl:for-each select="child::*[@level = 'subfonds'] | child::*[@level = 'subgrp'] | child::*[@level = 'subseries']">
<fo:block text-align-last="justify" margin-left="16pt">
<fo:basic-link internal-destination="{local:buildID(.)}">
<xsl:choose>
<xsl:when test="ead:head">
<xsl:apply-templates select="child::*/ead:head"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="child::*/ead:unittitle"/>
</xsl:otherwise>
</xsl:choose>
</fo:basic-link>
<xsl:text>  </xsl:text>
<fo:leader leader-pattern="dots"/>
<xsl:text>  </xsl:text>
<fo:page-number-citation ref-id="{local:buildID(.)}"/>
</fo:block>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</fo:block>
</fo:block>
</xsl:template>
<!--
Formats children of archdesc. This template orders the children of the archdesc,
if order is changed it must also be changed in the table of contents.
-->
<xsl:template match="ead:archdesc">
<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">
<fo:block xsl:use-attribute-sets="section">
<fo:block xsl:use-attribute-sets="h2" id="adminInfo">Administrative Information</fo:block>
<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:filedesc/ead:publicationstmt | /ead:ead/ead:eadheader/ead:revisiondesc"/>
<xsl:call-template name="toc"/>
</fo:block>
</xsl:if>
<!-- Related Materials -->
<xsl:if test="ead:relatedmaterial or ead:separatedmaterial">
<fo:block xsl:use-attribute-sets="section">
<fo:block xsl:use-attribute-sets="h2" id="relMat">Related Materials</fo:block>
<xsl:apply-templates select="ead:relatedmaterial | ead:separatedmaterial"/>
<xsl:call-template name="toc"/>
</fo:block>
</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"/>
</xsl:template>
<!-- Formats archdesc did -->
<xsl:template match="ead:archdesc/ead:did">
<fo:block xsl:use-attribute-sets="section">
<fo:block xsl:use-attribute-sets="h2ID">Summary Information</fo:block>
<!--
Determines the order in wich elements from the archdesc did appear,
to change the order of appearance change the order of the following
apply-template statements.
-->
<fo:table table-layout="fixed" width="100%">
<fo:table-column column-width="2in"/>
<fo:table-column column-width="5in"/>
<fo:table-body>
<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"/>
<xsl:apply-templates select="ead:unitdate" mode="overview"/>
<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"/>
</fo:table-body>
</fo:table>
<!-- Adds prefered citation to summary information -->
<xsl:apply-templates select="../ead:prefercite" mode="overview"/>
<!-- Link back to table of contents -->
<xsl:call-template name="toc"/>
</fo:block>
</xsl:template>
<!-- Formats prefercite in the summary -->
<xsl:template match="ead:prefercite" mode="overview">
<fo:block xsl:use-attribute-sets="section" border="1pt solid #333">
<fo:block xsl:use-attribute-sets="h3ID"><xsl:value-of select="local:tagName(.)"/></fo:block>
<fo:block xsl:use-attribute-sets="smp">
<xsl:apply-templates/>
</fo:block>
</fo:block>
</xsl:template>
<!-- Formats children of arcdesc/did -->
<xsl:template match="ead:repository | ead:origination | ead:unittitle | ead:unitdate | ead:unitid
| ead:physdesc | ead:physloc | ead:dao | ead:daogrp | ead:langmaterial | ead:materialspec | ead:container
| ead:abstract | ead:note" mode="overview">
<fo:table-row>
<fo:table-cell padding-bottom="8pt" padding-right="16pt" text-align="right" font-weight="bold">
<fo:block>
<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>
<xsl:if test="@type"> [<xsl:value-of select="@type"/>]</xsl:if>
<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(.)"/>
<!-- Test for type attribute used by unitdate -->
<xsl:if test="@type"> [<xsl:value-of select="@type"/>]</xsl:if>
</xsl:otherwise>
</xsl:choose>:
</fo:block>
</fo:table-cell>
<fo:table-cell padding-bottom="2pt">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:template>
<!-- Adds space between extents -->
<xsl:template match="ead:extent"><xsl:apply-templates/> </xsl:template>
<!-- Formats children of arcdesc not in administrative or related materials sections-->
<xsl:template match="ead:bibliography | ead:odd | ead:phystech | ead:otherfindaid |
ead:bioghist | ead:scopecontent | ead:arrangement | ead:fileplan">
<fo:block xsl:use-attribute-sets="section">
<fo:block xsl:use-attribute-sets="h2ID"><xsl:value-of select="local:tagName(.)"/></fo:block>
<xsl:apply-templates/>
<xsl:call-template name="toc"/>
</fo:block>
</xsl:template>
<!-- Formats children of arcdesc 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">
<fo:block xsl:use-attribute-sets="section">
<fo:block xsl:use-attribute-sets="h3ID"><xsl:value-of select="local:tagName(.)"/></fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<!-- Publication statement included in administrative information section -->
<xsl:template match="ead:publicationstmt">
<fo:block xsl:use-attribute-sets="section">
<fo:block xsl:use-attribute-sets="h3"><xsl:value-of select="local:tagName(.)"/></fo:block>
<fo:block xsl:use-attribute-sets="smp">
<xsl:apply-templates select="ead:publisher"/>
<xsl:if test="ead:date"> <xsl:apply-templates select="ead:date"/></xsl:if>
</fo:block>
<xsl:apply-templates select="ead:address"/>
</fo:block>
</xsl:template>
<!-- Formats Address elements -->
<xsl:template match="ead:address">
<fo:block xsl:use-attribute-sets="smp">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="ead:addressline">
<xsl:choose>
<xsl:when test="contains(.,'@')">
<fo:block>
<fo:basic-link external-destination="url('mailto:{.}')" xsl:use-attribute-sets="ref">
<xsl:value-of select="."/>
</fo:basic-link>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Templates for revision description -->
<xsl:template match="ead:revisiondesc">
<fo:block xsl:use-attribute-sets="section">
<fo:block xsl:use-attribute-sets="h3ID"><xsl:value-of select="local:tagName(.)"/></fo:block>
<xsl:if test="ead:change/ead:item"><xsl:value-of select="ead:change/ead:item"/></xsl:if>
<xsl:if test="ead:change/ead:date"> <xsl:value-of select="ead:change/ead:date"/></xsl:if>
</fo:block>
</xsl:template>
<!-- Formats controlled access terms -->
<xsl:template match="ead:controlaccess">
<fo:block xsl:use-attribute-sets="section">
<fo:block xsl:use-attribute-sets="h2ID"><xsl:value-of select="local:tagName(.)"/></fo:block>
<fo:list-block xsl:use-attribute-sets="smp">
<xsl:apply-templates/>
</fo:list-block>
</fo:block>
</xsl:template>
<xsl:template match="ead:controlaccess/child::*">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>•</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:template>
<!-- Formats index and child elements, groups indexentry elements by type (i.e. corpname, subject...) -->
<xsl:template match="ead:index">
<fo:block xsl:use-attribute-sets="section">
<fo:block xsl:use-attribute-sets="h2ID"><xsl:value-of select="local:tagName(.)"/></fo:block>
<xsl:apply-templates select="child::*[not(self::ead:indexentry)]"/>
<fo:list-block xsl:use-attribute-sets="smp">
<xsl:apply-templates select="ead:indexentry"/>
</fo:list-block>
</fo:block>
</xsl:template>
<xsl:template match="ead:indexentry">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>•</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</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">
<fo:block xsl:use-attribute-sets="h4ID"><xsl:apply-templates/></fo:block>
</xsl:template>
<xsl:template match="ead:tgroup">
<fo:table xsl:use-attribute-sets="tableBorder">
<xsl:apply-templates/>
<fo:table-body>
<xsl:apply-templates select="*[not(ead:colspec)]"/>
</fo:table-body>
</fo:table>
</xsl:template>
<xsl:template match="ead:colspec">
<fo:table-column column-width="{@colwidth}"/>
</xsl:template>
<xsl:template match="ead:thead">
<xsl:apply-templates mode="thead"/>
</xsl:template>
<xsl:template match="ead:tbody">
<fo:table-body>
<xsl:apply-templates/>
</fo:table-body>
</xsl:template>
<xsl:template match="ead:row" mode="thead">
<fo:table-row xsl:use-attribute-sets="th"><xsl:apply-templates/></fo:table-row>
</xsl:template>
<xsl:template match="ead:row">
<fo:table-row><xsl:apply-templates/></fo:table-row>
</xsl:template>
<xsl:template match="ead:entry">
<fo:table-cell xsl:use-attribute-sets="tdBorder">
<fo:block xsl:use-attribute-sets="smp">
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
</xsl:template>
<!--Bibref citation inline, if there is a parent element.-->
<xsl:template match="ead:p/ead:bibref">
<xsl:choose>
<xsl:when test="@*:href">
<fo:basic-link external-destination="url('{@*:href}')" xsl:use-attribute-sets="ref">
<xsl:apply-templates/>
</fo:basic-link>
</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">
<fo:block>
<xsl:choose>
<xsl:when test="@*:href">
<fo:basic-link external-destination="url('{@*:href}')" xsl:use-attribute-sets="ref"><xsl:apply-templates/></fo:basic-link>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</xsl:template>
<!-- Lists -->
<!-- Lists with listhead element are output as tables -->
<xsl:template match="ead:list[ead:listhead]">
<xsl:apply-templates select="ead:head"/>
<fo:table xsl:use-attribute-sets="tableBorder">
<fo:table-body>
<fo:table-row xsl:use-attribute-sets="th">
<fo:table-cell xsl:use-attribute-sets="tdBorder">
<fo:block xsl:use-attribute-sets="smp">
<xsl:value-of select="ead:listhead/ead:head01"/>
</fo:block>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="tdBorder">
<fo:block>
<xsl:value-of select="ead:listhead/ead:head02"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:apply-templates select="ead:defitem" mode="listTable"/>
</fo:table-body>
</fo:table>
</xsl:template>
<!-- Formats ordered and definition lists -->
<xsl:template match="ead:list">
<xsl:apply-templates select="ead:head"/>
<fo:list-block xsl:use-attribute-sets="smp">
<xsl:choose>
<xsl:when test="@type='deflist'">
<xsl:apply-templates select="ead:defitem"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="ead:item"/>
</xsl:otherwise>
</xsl:choose>
</fo:list-block>
</xsl:template>
<xsl:template match="ead:item">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>
<xsl:choose>
<xsl:when test="../@type='ordered' and ../@numeration = 'arabic'">
<xsl:number format="1"/>
</xsl:when>
<xsl:when test="../@type='ordered' and ../@numeration = 'upperalpha'">
<xsl:number format="A"/>
</xsl:when>
<xsl:when test="../@type='ordered' and ../@numeration = 'loweralpha'">
<xsl:number format="a"/>
</xsl:when>
<xsl:when test="../@type='ordered' and ../@numeration = 'upperroman'">
<xsl:number format="I"/>
</xsl:when>
<xsl:when test="../@type='ordered' and ../@numeration = 'upperalpha'">
<xsl:number format="i"/>
</xsl:when>
<xsl:when test="../@type='ordered' and not(../@numeration)">
<xsl:number format="1"/>
</xsl:when>
<xsl:otherwise>•</xsl:otherwise>
</xsl:choose>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:template>
<xsl:template match="ead:defitem">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block/>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block font-weight="bold">
<xsl:apply-templates select="ead:label"/>
</fo:block>
<fo:block margin-left="18pt">
<xsl:apply-templates select="ead:item" mode="deflist"/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:template>
<!-- Formats list as table if list has listhead element -->
<xsl:template match="ead:defitem" mode="listTable">
<fo:table-row>