forked from cnelsonFLVC/FLVC_Islandora_XSLTs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMARCXML2MODS_DigiTool.xsl
5701 lines (5379 loc) · 196 KB
/
MARCXML2MODS_DigiTool.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
<xsl:stylesheet xmlns="http://www.loc.gov/mods/v3" xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xlink marc" version="1.0">
<!-- <xsl:include href="http://www.loc.gov/standards/marcxml/xslt/MARC21slimUtils.xsl"/> -->
<xsl:include href="MARC21slimUtils.xsl"/>
<xsl:output encoding="UTF-8" indent="yes" method="xml"/>
<xsl:strip-space elements="*"/>
<!--FLVC version continuation, Islandora project, updates by MDemers
v10: (05.2015) implemented LOC correction of bad frequency placement.
v9: (01.2015) added Ind1 to displayLabel mapping for 520/abstract.
v8: (04.2014) added 69x local mappings and "sears" authority as Ind2=8
-->
<!-- FLVC version, written by Caitlin Nelson for the Islandora project
v7: (8-02-2013) edited <dateIssued> fields for de-duping
v6: (7-26-2013) corrected 720 name creation
v5: (7-17-2013) updated relatedIdentifier to handle (parenthetical) @type
v4: (7-11-2013) updated PURL handling
v3. (6-27-2013) merged in LOC updated 1.86; updated marc:collection handling;
v2: (06/2013) removed the modsCollection wrapper option - all records will just have <mods> wrappers
v1: (04/2013) edits to 035 field, 260 field for punctuation, remove duplicate <dateIssued> field
-->
<!-- Maintenance note: For each revision, change the content of <recordInfo><recordOrigin> to reflect the new revision number.
MARC21slim2MODS3-4 (Revision 1.86) 20130610
Revision 1.86 - Refined 653 mapping - tmee 2013/06/10
Revision 1.85 - Fixed 245 $c - tmee 2013/03/07
Revision 1.84 - Fixed 1.35 and 1.36 date mapping for 008 when 008/06=e,p,r,s,t so only 008/07-10 displays, rather than 008/07-14 - tmee 2013/02/01
Revision 1.83 - Deleted mapping for 534 to note - tmee 2013/01/18
Revision 1.82 - Added mapping for 264 ind 0,1,2,3 to originInfo - 2013/01/15 tmee
Revision 1.81 - Added mapping for 336$a$2, 337$a$2, 338$a$2 - 2012/12/03 tmee
Revision 1.80 - Added 100/700 mapping for "family" - 2012/09/10 tmee
Revision 1.79 - Added 245 $s mapping - 2012/07/11 tmee
Revision 1.78 - Fixed 852 mapping <shelfLocation> was changed to <shelfLocator> - 2012/05/07 tmee
Revision 1.77 - Fixed 008-06 when value = 's' - 2012/04/19 tmee
Revision 1.76 - Fixed 242 - 2012/02/01 tmee
Revision 1.75 - Fixed 653 - 2012/01/31 tmee
Revision 1.74 - Fixed 510 note - 2011/07/15 tmee
Revision 1.73 - Fixed 506 540 - 2011/07/11 tmee
Revision 1.72 - Fixed frequency error - 2011/07/07 and 2011/07/14 tmee
Revision 1.71 - Fixed subject titles for subfields t - 2011/04/26 tmee
Revision 1.70 - Added mapping for OCLC numbers in 035s to go into <identifier type="oclc"> 2011/02/27 - tmee
Revision 1.69 - Added mapping for untyped identifiers for 024 - 2011/02/27 tmee
Revision 1.68 - Added <subject><titleInfo> mapping for 600/610/611 subfields t,p,n - 2010/12/22 tmee
Revision 1.67 - Added frequency values and authority="marcfrequency" for 008/18 - 2010/12/09 tmee
Revision 1.66 - Fixed 008/06=c,d,i,m,k,u, from dateCreated to dateIssued - 2010/12/06 tmee
Revision 1.65 - Added back marcsmd and marccategory for 007 cr- 2010/12/06 tmee
Revision 1.64 - Fixed identifiers - removed isInvalid template - 2010/12/06 tmee
Revision 1.63 - Fixed descriptiveStandard value from aacr2 to aacr - 2010/12/06 tmee
Revision 1.62 - Fixed date mapping for 008/06=e,p,r,s,t - 2010/12/01 tmee
Revision 1.61 - Added 007 mappings for marccategory - 2010/11/12 tmee
Revision 1.60 - Added altRepGroups and 880 linkages for relevant fields, see mapping - 2010/11/26 tmee
Revision 1.59 - Added scriptTerm type=text to language for 546b and 066c - 2010/09/23 tmee
Revision 1.58 - Expanded script template to include code conversions for extended scripts - 2010/09/22 tmee
Revision 1.57 - Added Ldr/07 and Ldr/19 mappings - 2010/09/17 tmee
Revision 1.56 - Mapped 1xx usage="primary" - 2010/09/17 tmee
Revision 1.55 - Mapped UT 240/1xx nameTitleGroup - 2010/09/17 tmee
MODS 3.4
Revision 1.54 - Fixed 086 redundancy - 2010/07/27 tmee
Revision 1.53 - Added direct href for MARC21slimUtils - 2010/07/27 tmee
Revision 1.52 - Mapped 046 subfields c,e,k,l - 2010/04/09 tmee
Revision 1.51 - Corrected 856 transform - 2010/01/29 tmee
Revision 1.50 - Added 210 $2 authority attribute in <titleInfo type=”abbreviated”> 2009/11/23 tmee
Revision 1.49 - Aquifer revision 1.14 - Added 240s (version) data to <titleInfo type="uniform"><title> 2009/11/23 tmee
Revision 1.48 - Aquifer revision 1.27 - Added mapping of 242 second indicator (for nonfiling characters) to <titleInfo><nonSort > subelement 2007/08/08 tmee/dlf
Revision 1.47 - Aquifer revision 1.26 - Mapped 300 subfield f (type of unit) - and g (size of unit) 2009 ntra
Revision 1.46 - Aquifer revision 1.25 - Changed mapping of 767 so that <type="otherVersion> 2009/11/20 tmee
Revision 1.45 - Aquifer revision 1.24 - Changed mapping of 765 so that <type="otherVersion> 2009/11/20 tmee
Revision 1.44 - Added <recordInfo><recordOrigin> canned text about the version of this stylesheet 2009 ntra
Revision 1.43 - Mapped 351 subfields a,b,c 2009/11/20 tmee
Revision 1.42 - Changed 856 second indicator=1 to go to <location><url displayLabel=”electronic resource”> instead of to <relatedItem type=”otherVersion”><url> 2009/11/20 tmee
Revision 1.41 - Aquifer revision 1.9 Added variable and choice protocol for adding usage=”primary display” 2009/11/19 tmee
Revision 1.40 - Dropped <note> for 510 and added <relatedItem type="isReferencedBy"> for 510 2009/11/19 tmee
Revision 1.39 - Aquifer revision 1.23 Changed mapping for 762 (Subseries Entry) from <relatedItem type="series"> to <relatedItem type="constituent"> 2009/11/19 tmee
Revision 1.38 - Aquifer revision 1.29 Dropped 007s for electronic versions 2009/11/18 tmee
Revision 1.37 - Fixed date redundancy in output (with questionable dates) 2009/11/16 tmee
Revision 1.36 - If mss material (Ldr/06=d,p,f,t) map 008 dates and 260$c/$g dates to dateCreated 2009/11/24, otherwise map 008 and 260$c/$g to dateIssued 2010/01/08 tmee
Revision 1.35 - Mapped appended detailed dates from 008/07-10 and 008/11-14 to dateIssued or DateCreated w/encoding="marc" 2010/01/12 tmee
Revision 1.34 - Mapped 045b B.C. and C.E. date range info to iso8601-compliant dates in <subject><temporal> 2009/01/08 ntra
Revision 1.33 - Mapped Ldr/06 "o" to <typeOfResource>kit 2009/11/16 tmee
Revision 1.32 - Mapped specific note types from the MODS Note Type list <http://www.loc.gov/standards/mods/mods-notes.html> tmee 2009/11/17
Revision 1.31 - Mapped 540 to <accessCondition type="use and reproduction"> and 506 to <accessCondition type="restriction on access"> and delete mappings of 540 and 506 to <note>
Revision 1.30 - Mapped 037c to <identifier displayLabel=""> 2009/11/13 tmee
Revision 1.29 - Corrected schemaLocation to 3.3 2009/11/13 tmee
Revision 1.28 - Changed mapping from 752,662 g going to mods:hierarchicalGeographic/area instead of "region" 2009/07/30 ntra
Revision 1.27 - Mapped 648 to <subject> 2009/03/13 tmee
Revision 1.26 - Added subfield $s mapping for 130/240/730 2008/10/16 tmee
Revision 1.25 - Mapped 040e to <descriptiveStandard> and Leader/18 to <descriptive standard>aacr2 2008/09/18 tmee
Revision 1.24 - Mapped 852 subfields $h, $i, $j, $k, $l, $m, $t to <shelfLocation> and 852 subfield $u to <physicalLocation> with @xlink 2008/09/17 tmee
Revision 1.23 - Commented out xlink/uri for subfield 0 for 130/240/730, 100/700, 110/710, 111/711 as these are currently unactionable 2008/09/17 tmee
Revision 1.22 - Mapped 022 subfield $l to type "issn-l" subfield $m to output identifier element with corresponding @type and @invalid eq 'yes'2008/09/17 tmee
Revision 1.21 - Mapped 856 ind2=1 or ind2=2 to <relatedItem><location><url> 2008/07/03 tmee
Revision 1.20 - Added genre w/@auth="contents of 2" and type= "musical composition" 2008/07/01 tmee
Revision 1.19 - Added genre offprint for 008/24+ BK code 2 2008/07/01 tmee
Revision 1.18 - Added xlink/uri for subfield 0 for 130/240/730, 100/700, 110/710, 111/711 2008/06/26 tmee
Revision 1.17 - Added mapping of 662 2008/05/14 tmee
Revision 1.16 - Changed @authority from "marc" to "marcgt" for 007 and 008 codes mapped to a term in <genre> 2007/07/10 tmee
Revision 1.15 - For field 630, moved call to part template outside title element 2007/07/10 tmee
Revision 1.14 - Fixed template isValid and fields 010, 020, 022, 024, 028, and 037 to output additional identifier elements with corresponding @type and @invalid eq 'yes' when subfields z or y (in the case of 022) exist in the MARCXML ::: 2007/01/04 17:35:20 cred
Revision 1.13 - Changed order of output under cartographics to reflect schema 2006/11/28 tmee
Revision 1.12 - Updated to reflect MODS 3.2 Mapping 2006/10/11 tmee
Revision 1.11 - The attribute objectPart moved from <languageTerm> to <language> 2006/04/08 jrad
Revision 1.10 - MODS 3.1 revisions to language and classification elements (plus ability to find marc:collection embedded in wrapper elements such as SRU zs: wrappers) 2006/02/06 ggar
Revision 1.09 - Subfield $y was added to field 242 2004/09/02 10:57 jrad
Revision 1.08 - Subject chopPunctuation expanded and attribute fixes 2004/08/12 jrad
Revision 1.07 - 2004/03/25 08:29 jrad
Revision 1.06 - Various validation fixes 2004/02/20 ntra
Revision 1.05 - MODS2 to MODS3 updates, language unstacking and de-duping, chopPunctuation expanded 2003/10/02 16:18:58 ntra
Revision 1.03 - Additional Changes not related to MODS Version 2.0 by ntra
Revision 1.02 - Added Log Comment 2003/03/24 19:37:42 ckeith
-->
<xsl:template match="/">
<xsl:choose>
<xsl:when test="//marc:collection">
<!-- 6/2013 Changed the marc:collection template so that it (1) removes the collection tag, and (2)
takes only the first <marc:record> element (thereby ignoring all other potential records
in the file -->
<!-- <modsCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd">
<xsl:for-each select="//marc:collection/marc:record">
<mods version="3.4">
<xsl:call-template name="marcRecord"/>
</mods>
</xsl:for-each>
</modsCollection> -->
<xsl:for-each select="//marc:record[1]">
<mods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.4"
xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd">
<xsl:call-template name="marcRecord"/>
</mods>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<mods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.4"
xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-4.xsd">
<xsl:for-each select="//marc:record">
<xsl:call-template name="marcRecord"/>
</xsl:for-each>
</mods>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="marcRecord">
<xsl:variable name="leader" select="marc:leader"/>
<xsl:variable name="leader6" select="substring($leader,7,1)"/>
<xsl:variable name="leader7" select="substring($leader,8,1)"/>
<xsl:variable name="leader19" select="substring($leader,20,1)"/>
<xsl:variable name="controlField008" select="marc:controlfield[@tag='008']"/>
<xsl:variable name="typeOf008">
<xsl:choose>
<xsl:when test="$leader6='a'">
<xsl:choose>
<xsl:when
test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'"
>BK</xsl:when>
<xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">SE</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="$leader6='t'">BK</xsl:when>
<xsl:when test="$leader6='p'">MM</xsl:when>
<xsl:when test="$leader6='m'">CF</xsl:when>
<xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
<xsl:when test="$leader6='g' or $leader6='k' or $leader6='o' or $leader6='r'"
>VM</xsl:when>
<xsl:when test="$leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'"
>MU</xsl:when>
</xsl:choose>
</xsl:variable>
<!-- titleInfo -->
<xsl:for-each select="marc:datafield[@tag='245']">
<xsl:call-template name="createTitleInfoFrom245"/>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='210']">
<xsl:call-template name="createTitleInfoFrom210"/>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='246']">
<xsl:call-template name="createTitleInfoFrom246"/>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='240']">
<xsl:call-template name="createTitleInfoFrom240"/>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='740']">
<xsl:call-template name="createTitleInfoFrom740"/>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='130']">
<xsl:call-template name="createTitleInfoFrom130"/>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='730']">
<xsl:call-template name="createTitleInfoFrom730"/>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='242']">
<titleInfo type="translated">
<!--09/01/04 Added subfield $y-->
<xsl:for-each select="marc:subfield[@code='y']">
<xsl:attribute name="lang">
<xsl:value-of select="text()"/>
</xsl:attribute>
</xsl:for-each>
<!-- AQ1.27 tmee/dlf -->
<xsl:variable name="title">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">
<!-- 1/04 removed $h, b -->
<xsl:with-param name="codes">a</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="titleChop">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:value-of select="$title"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="@ind2>0">
<nonSort>
<xsl:value-of select="substring($titleChop,1,@ind2)"/>
</nonSort>
<title>
<xsl:value-of select="substring($titleChop,@ind2+1)"/>
</title>
</xsl:when>
<xsl:otherwise>
<title>
<xsl:value-of select="$titleChop"/>
</title>
</xsl:otherwise>
</xsl:choose>
<!-- 1/04 fix -->
<xsl:call-template name="subtitle"/>
<xsl:call-template name="part"/>
</titleInfo>
</xsl:for-each>
<!-- name -->
<xsl:for-each select="marc:datafield[@tag='100']">
<xsl:call-template name="createNameFrom100"/>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='110']">
<xsl:call-template name="createNameFrom110"/>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='111']">
<xsl:call-template name="createNameFrom111"/>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='700']">
<xsl:call-template name="createNameFrom700"/>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='710']">
<xsl:call-template name="createNameFrom710"/>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='711']">
<xsl:call-template name="createNameFrom711"/>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='720']">
<xsl:call-template name="createNameFrom720"/>
</xsl:for-each>
<!--old 7XXs
<xsl:for-each select="marc:datafield[@tag='700'][not(marc:subfield[@code='t'])]">
<name type="personal">
<xsl:call-template name="nameABCDQ"/>
<xsl:call-template name="affiliation"/>
<xsl:call-template name="role"/>
</name>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='710'][not(marc:subfield[@code='t'])]">
<name type="corporate">
<xsl:call-template name="nameABCDN"/>
<xsl:call-template name="role"/>
</name>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='711'][not(marc:subfield[@code='t'])]">
<name type="conference">
<xsl:call-template name="nameACDEQ"/>
<xsl:call-template name="role"/>
</name>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='720'][not(marc:subfield[@code='t'])]">
<name>
<xsl:if test="@ind1=1">
<xsl:attribute name="type">
<xsl:text>personal</xsl:text>
</xsl:attribute>
</xsl:if>
<namePart>
<xsl:value-of select="marc:subfield[@code='a']"/>
</namePart>
<xsl:call-template name="role"/>
</name>
</xsl:for-each>
-->
<typeOfResource>
<xsl:if test="$leader7='c'">
<xsl:attribute name="collection">yes</xsl:attribute>
</xsl:if>
<xsl:if test="$leader6='d' or $leader6='f' or $leader6='p' or $leader6='t'">
<xsl:attribute name="manuscript">yes</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="$leader6='a' or $leader6='t'">text</xsl:when>
<xsl:when test="$leader6='e' or $leader6='f'">cartographic</xsl:when>
<xsl:when test="$leader6='c' or $leader6='d'">notated music</xsl:when>
<xsl:when test="$leader6='i'">sound recording-nonmusical</xsl:when>
<xsl:when test="$leader6='j'">sound recording-musical</xsl:when>
<xsl:when test="$leader6='k'">still image</xsl:when>
<xsl:when test="$leader6='g'">moving image</xsl:when>
<xsl:when test="$leader6='r'">three dimensional object</xsl:when>
<xsl:when test="$leader6='m'">software, multimedia</xsl:when>
<xsl:when test="$leader6='p'">mixed material</xsl:when>
</xsl:choose>
</typeOfResource>
<xsl:if test="substring($controlField008,26,1)='d'">
<genre authority="marcgt">globe</genre>
</xsl:if>
<xsl:if
test="marc:controlfield[@tag='007'][substring(text(),1,1)='a'][substring(text(),2,1)='r']">
<genre authority="marcgt">remote-sensing image</genre>
</xsl:if>
<xsl:if test="$typeOf008='MP'">
<xsl:variable name="controlField008-25" select="substring($controlField008,26,1)"/>
<xsl:choose>
<xsl:when
test="$controlField008-25='a' or $controlField008-25='b' or $controlField008-25='c' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='j']">
<genre authority="marcgt">map</genre>
</xsl:when>
<xsl:when
test="$controlField008-25='e' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='d']">
<genre authority="marcgt">atlas</genre>
</xsl:when>
</xsl:choose>
</xsl:if>
<xsl:if test="$typeOf008='SE'">
<xsl:variable name="controlField008-21" select="substring($controlField008,22,1)"/>
<xsl:choose>
<xsl:when test="$controlField008-21='d'">
<genre authority="marcgt">database</genre>
</xsl:when>
<xsl:when test="$controlField008-21='l'">
<genre authority="marcgt">loose-leaf</genre>
</xsl:when>
<xsl:when test="$controlField008-21='m'">
<genre authority="marcgt">series</genre>
</xsl:when>
<xsl:when test="$controlField008-21='n'">
<genre authority="marcgt">newspaper</genre>
</xsl:when>
<xsl:when test="$controlField008-21='p'">
<genre authority="marcgt">periodical</genre>
</xsl:when>
<xsl:when test="$controlField008-21='w'">
<genre authority="marcgt">web site</genre>
</xsl:when>
</xsl:choose>
</xsl:if>
<xsl:if test="$typeOf008='BK' or $typeOf008='SE'">
<xsl:variable name="controlField008-24" select="substring($controlField008,25,4)"/>
<xsl:choose>
<xsl:when test="contains($controlField008-24,'a')">
<genre authority="marcgt">abstract or summary</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'b')">
<genre authority="marcgt">bibliography</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'c')">
<genre authority="marcgt">catalog</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'d')">
<genre authority="marcgt">dictionary</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'e')">
<genre authority="marcgt">encyclopedia</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'f')">
<genre authority="marcgt">handbook</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'g')">
<genre authority="marcgt">legal article</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'i')">
<genre authority="marcgt">index</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'k')">
<genre authority="marcgt">discography</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'l')">
<genre authority="marcgt">legislation</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'m')">
<genre authority="marcgt">theses</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'n')">
<genre authority="marcgt">survey of literature</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'o')">
<genre authority="marcgt">review</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'p')">
<genre authority="marcgt">programmed text</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'q')">
<genre authority="marcgt">filmography</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'r')">
<genre authority="marcgt">directory</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'s')">
<genre authority="marcgt">statistics</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'t')">
<genre authority="marcgt">technical report</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'v')">
<genre authority="marcgt">legal case and case notes</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'w')">
<genre authority="marcgt">law report or digest</genre>
</xsl:when>
<xsl:when test="contains($controlField008-24,'z')">
<genre authority="marcgt">treaty</genre>
</xsl:when>
</xsl:choose>
<xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"/>
<xsl:choose>
<xsl:when test="$controlField008-29='1'">
<genre authority="marcgt">conference publication</genre>
</xsl:when>
</xsl:choose>
</xsl:if>
<xsl:if test="$typeOf008='CF'">
<xsl:variable name="controlField008-26" select="substring($controlField008,27,1)"/>
<xsl:choose>
<xsl:when test="$controlField008-26='a'">
<genre authority="marcgt">numeric data</genre>
</xsl:when>
<xsl:when test="$controlField008-26='e'">
<genre authority="marcgt">database</genre>
</xsl:when>
<xsl:when test="$controlField008-26='f'">
<genre authority="marcgt">font</genre>
</xsl:when>
<xsl:when test="$controlField008-26='g'">
<genre authority="marcgt">game</genre>
</xsl:when>
</xsl:choose>
</xsl:if>
<xsl:if test="$typeOf008='BK'">
<xsl:if test="substring($controlField008,25,1)='j'">
<genre authority="marcgt">patent</genre>
</xsl:if>
<xsl:if test="substring($controlField008,25,1)='2'">
<genre authority="marcgt">offprint</genre>
</xsl:if>
<xsl:if test="substring($controlField008,31,1)='1'">
<genre authority="marcgt">festschrift</genre>
</xsl:if>
<xsl:variable name="controlField008-34" select="substring($controlField008,35,1)"/>
<xsl:if
test="$controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d'">
<genre authority="marcgt">biography</genre>
</xsl:if>
<xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/>
<xsl:choose>
<xsl:when test="$controlField008-33='e'">
<genre authority="marcgt">essay</genre>
</xsl:when>
<xsl:when test="$controlField008-33='d'">
<genre authority="marcgt">drama</genre>
</xsl:when>
<xsl:when test="$controlField008-33='c'">
<genre authority="marcgt">comic strip</genre>
</xsl:when>
<xsl:when test="$controlField008-33='l'">
<genre authority="marcgt">fiction</genre>
</xsl:when>
<xsl:when test="$controlField008-33='h'">
<genre authority="marcgt">humor, satire</genre>
</xsl:when>
<xsl:when test="$controlField008-33='i'">
<genre authority="marcgt">letter</genre>
</xsl:when>
<xsl:when test="$controlField008-33='f'">
<genre authority="marcgt">novel</genre>
</xsl:when>
<xsl:when test="$controlField008-33='j'">
<genre authority="marcgt">short story</genre>
</xsl:when>
<xsl:when test="$controlField008-33='s'">
<genre authority="marcgt">speech</genre>
</xsl:when>
</xsl:choose>
</xsl:if>
<xsl:if test="$typeOf008='MU'">
<xsl:variable name="controlField008-30-31" select="substring($controlField008,31,2)"/>
<xsl:if test="contains($controlField008-30-31,'b')">
<genre authority="marcgt">biography</genre>
</xsl:if>
<xsl:if test="contains($controlField008-30-31,'c')">
<genre authority="marcgt">conference publication</genre>
</xsl:if>
<xsl:if test="contains($controlField008-30-31,'d')">
<genre authority="marcgt">drama</genre>
</xsl:if>
<xsl:if test="contains($controlField008-30-31,'e')">
<genre authority="marcgt">essay</genre>
</xsl:if>
<xsl:if test="contains($controlField008-30-31,'f')">
<genre authority="marcgt">fiction</genre>
</xsl:if>
<xsl:if test="contains($controlField008-30-31,'o')">
<genre authority="marcgt">folktale</genre>
</xsl:if>
<xsl:if test="contains($controlField008-30-31,'h')">
<genre authority="marcgt">history</genre>
</xsl:if>
<xsl:if test="contains($controlField008-30-31,'k')">
<genre authority="marcgt">humor, satire</genre>
</xsl:if>
<xsl:if test="contains($controlField008-30-31,'m')">
<genre authority="marcgt">memoir</genre>
</xsl:if>
<xsl:if test="contains($controlField008-30-31,'p')">
<genre authority="marcgt">poetry</genre>
</xsl:if>
<xsl:if test="contains($controlField008-30-31,'r')">
<genre authority="marcgt">rehearsal</genre>
</xsl:if>
<xsl:if test="contains($controlField008-30-31,'g')">
<genre authority="marcgt">reporting</genre>
</xsl:if>
<xsl:if test="contains($controlField008-30-31,'s')">
<genre authority="marcgt">sound</genre>
</xsl:if>
<xsl:if test="contains($controlField008-30-31,'l')">
<genre authority="marcgt">speech</genre>
</xsl:if>
</xsl:if>
<xsl:if test="$typeOf008='VM'">
<xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/>
<xsl:choose>
<xsl:when test="$controlField008-33='a'">
<genre authority="marcgt">art original</genre>
</xsl:when>
<xsl:when test="$controlField008-33='b'">
<genre authority="marcgt">kit</genre>
</xsl:when>
<xsl:when test="$controlField008-33='c'">
<genre authority="marcgt">art reproduction</genre>
</xsl:when>
<xsl:when test="$controlField008-33='d'">
<genre authority="marcgt">diorama</genre>
</xsl:when>
<xsl:when test="$controlField008-33='f'">
<genre authority="marcgt">filmstrip</genre>
</xsl:when>
<xsl:when test="$controlField008-33='g'">
<genre authority="marcgt">legal article</genre>
</xsl:when>
<xsl:when test="$controlField008-33='i'">
<genre authority="marcgt">picture</genre>
</xsl:when>
<xsl:when test="$controlField008-33='k'">
<genre authority="marcgt">graphic</genre>
</xsl:when>
<xsl:when test="$controlField008-33='l'">
<genre authority="marcgt">technical drawing</genre>
</xsl:when>
<xsl:when test="$controlField008-33='m'">
<genre authority="marcgt">motion picture</genre>
</xsl:when>
<xsl:when test="$controlField008-33='n'">
<genre authority="marcgt">chart</genre>
</xsl:when>
<xsl:when test="$controlField008-33='o'">
<genre authority="marcgt">flash card</genre>
</xsl:when>
<xsl:when test="$controlField008-33='p'">
<genre authority="marcgt">microscope slide</genre>
</xsl:when>
<xsl:when
test="$controlField008-33='q' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='q']">
<genre authority="marcgt">model</genre>
</xsl:when>
<xsl:when test="$controlField008-33='r'">
<genre authority="marcgt">realia</genre>
</xsl:when>
<xsl:when test="$controlField008-33='s'">
<genre authority="marcgt">slide</genre>
</xsl:when>
<xsl:when test="$controlField008-33='t'">
<genre authority="marcgt">transparency</genre>
</xsl:when>
<xsl:when test="$controlField008-33='v'">
<genre authority="marcgt">videorecording</genre>
</xsl:when>
<xsl:when test="$controlField008-33='w'">
<genre authority="marcgt">toy</genre>
</xsl:when>
</xsl:choose>
</xsl:if>
<!-- genre -->
<xsl:for-each select="marc:datafield[@tag=047]">
<xsl:call-template name="createGenreFrom047"/>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=336]">
<xsl:call-template name="createGenreFrom336"/>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=655]">
<xsl:call-template name="createGenreFrom655"/>
</xsl:for-each>
<!-- originInfo 250 and 260 -->
<originInfo>
<xsl:variable name="dataField260c">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString"
select="marc:datafield[@tag=260]/marc:subfield[@code='c']"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="controlField008-7-10"
select="normalize-space(substring($controlField008, 8, 4))"/>
<xsl:variable name="controlField008-11-14"
select="normalize-space(substring($controlField008, 12, 4))"/>
<xsl:variable name="controlField008-6"
select="normalize-space(substring($controlField008, 7, 1))"/>
<xsl:call-template name="scriptCode"/>
<xsl:for-each
select="marc:datafield[(@tag=260 or @tag=250) and marc:subfield[@code='a' or code='b' or @code='c' or code='g']]">
<xsl:call-template name="z2xx880"/>
</xsl:for-each>
<xsl:variable name="MARCpublicationCode"
select="normalize-space(substring($controlField008,16,3))"/>
<xsl:if test="translate($MARCpublicationCode,'|','')">
<place>
<placeTerm>
<xsl:attribute name="type">code</xsl:attribute>
<xsl:attribute name="authority">marccountry</xsl:attribute>
<xsl:value-of select="$MARCpublicationCode"/>
</placeTerm>
</place>
</xsl:if>
<xsl:for-each select="marc:datafield[@tag=044]/marc:subfield[@code='c']">
<place>
<placeTerm>
<xsl:attribute name="type">code</xsl:attribute>
<xsl:attribute name="authority">iso3166</xsl:attribute>
<xsl:value-of select="."/>
</placeTerm>
</place>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=260]/marc:subfield[@code='a']">
<place>
<placeTerm>
<xsl:attribute name="type">text</xsl:attribute>
<!-- This code does not remove the preceding bracket, in order to round-trip smoothly back to MARC -->
<!-- <xsl:call-template name="chopPunctuationFront">
<xsl:with-param name="chopString">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString" select="."/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template> -->
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString" select="."/>
<xsl:with-param name="punctuation">
<xsl:text>:,;/ </xsl:text>
</xsl:with-param>
</xsl:call-template>
</placeTerm>
</place>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='m']">
<dateValid point="start">
<xsl:value-of select="."/>
</dateValid>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='n']">
<dateValid point="end">
<xsl:value-of select="."/>
</dateValid>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='j']">
<dateModified>
<xsl:value-of select="."/>
</dateModified>
</xsl:for-each>
<!-- tmee 1.52 -->
<xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='c']">
<dateIssued encoding="marc" point="start">
<xsl:value-of select="."/>
</dateIssued>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='e']">
<dateIssued encoding="marc" point="end">
<xsl:value-of select="."/>
</dateIssued>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='k']">
<dateCreated encoding="marc" point="start">
<xsl:value-of select="."/>
</dateCreated>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='l']">
<dateCreated encoding="marc" point="end">
<xsl:value-of select="."/>
</dateCreated>
</xsl:for-each>
<!-- tmee 1.35 1.36 dateIssued/nonMSS vs dateCreated/MSS -->
<xsl:for-each
select="marc:datafield[@tag=260]/marc:subfield[@code='b' or @code='c' or @code='g']">
<xsl:choose>
<xsl:when test="@code='b'">
<publisher>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString" select="."/>
<xsl:with-param name="punctuation">
<xsl:text>:,;/ </xsl:text>
</xsl:with-param>
</xsl:call-template>
</publisher>
</xsl:when>
<xsl:when test="(@code='c')">
<xsl:if test="$leader6='d' or $leader6='f' or $leader6='p' or $leader6='t'">
<dateCreated>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString" select="."/>
</xsl:call-template>
</dateCreated>
</xsl:if>
<!-- FLVC edit: there are so many statements to create a <dateIssued>... I added a check to see if the pub-date matches the 008 date to
stop duplication of <dateIssued> field -->
<xsl:if
test="not($leader6='d' or $leader6='f' or $leader6='p' or $leader6='t') and ($dataField260c != $controlField008-7-10)">
<dateIssued>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString" select="."/>
</xsl:call-template>
</dateIssued>
</xsl:if>
</xsl:when>
<xsl:when test="@code='g'">
<xsl:if test="$leader6='d' or $leader6='f' or $leader6='p' or $leader6='t'">
<dateCreated>
<xsl:value-of select="."/>
</dateCreated>
</xsl:if>
<xsl:if
test="not($leader6='d' or $leader6='f' or $leader6='p' or $leader6='t')">
<dateCreated>
<xsl:value-of select="."/>
</dateCreated>
</xsl:if>
</xsl:when>
</xsl:choose>
</xsl:for-each>
<!-- tmee 1.35 and 1.36 and 1.84-->
<xsl:if
test="($controlField008-6='e' or $controlField008-6='p' or $controlField008-6='r' or $controlField008-6='s' or $controlField008-6='t') and ($leader6='d' or $leader6='f' or $leader6='p' or $leader6='t')">
<xsl:if test="$controlField008-7-10 and ($controlField008-7-10 != $dataField260c)">
<dateCreated encoding="marc">
<xsl:value-of select="$controlField008-7-10"/>
</dateCreated>
</xsl:if>
</xsl:if>
<xsl:if
test="($controlField008-6='e' or $controlField008-6='p' or $controlField008-6='r' or $controlField008-6='s' or $controlField008-6='t') and not($leader6='d' or $leader6='f' or $leader6='p' or $leader6='t')">
<xsl:if test="$controlField008-7-10 and ($controlField008-7-10 != $dataField260c)">
<dateIssued encoding="marc">
<xsl:value-of select="$controlField008-7-10"/></dateIssued>
</xsl:if>
</xsl:if>
<xsl:if
test="$controlField008-6='c' or $controlField008-6='d' or $controlField008-6='i' or $controlField008-6='k' or $controlField008-6='m' or $controlField008-6='u'">
<xsl:if test="$controlField008-7-10">
<dateIssued encoding="marc" point="start">
<xsl:value-of select="$controlField008-7-10"/>
</dateIssued>
</xsl:if>
</xsl:if>
<xsl:if
test="$controlField008-6='c' or $controlField008-6='d' or $controlField008-6='i' or $controlField008-6='k' or $controlField008-6='m' or $controlField008-6='u'">
<xsl:if test="$controlField008-11-14">
<dateIssued encoding="marc" point="end">
<xsl:value-of select="$controlField008-11-14"/>
</dateIssued>
</xsl:if>
</xsl:if>
<xsl:if test="$controlField008-6='q'">
<xsl:if test="$controlField008-7-10">
<dateIssued encoding="marc" point="start" qualifier="questionable">
<xsl:value-of select="$controlField008-7-10"/>
</dateIssued>
</xsl:if>
</xsl:if>
<xsl:if test="$controlField008-6='q'">
<xsl:if test="$controlField008-11-14">
<dateIssued encoding="marc" point="end" qualifier="questionable">
<xsl:value-of select="$controlField008-11-14"/>
</dateIssued>
</xsl:if>
</xsl:if>
<!-- tmee 1.77 008-06 dateIssued for value 's' -->
<xsl:if test="$controlField008-6='s'">
<xsl:if test="$controlField008-7-10">
<dateIssued encoding="marc">
<xsl:value-of select="$controlField008-7-10"/>
</dateIssued>
</xsl:if>
</xsl:if>
<xsl:if test="$controlField008-6='t'">
<xsl:if test="$controlField008-11-14">
<copyrightDate encoding="marc">
<xsl:value-of select="$controlField008-11-14"/>
</copyrightDate>
</xsl:if>
</xsl:if>
<xsl:for-each
select="marc:datafield[@tag=033][@ind1=0 or @ind1=1]/marc:subfield[@code='a']">
<dateCaptured encoding="iso8601">
<xsl:value-of select="."/>
</dateCaptured>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=033][@ind1=2]/marc:subfield[@code='a'][1]">
<dateCaptured encoding="iso8601" point="start">
<xsl:value-of select="."/>
</dateCaptured>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=033][@ind1=2]/marc:subfield[@code='a'][2]">
<dateCaptured encoding="iso8601" point="end">
<xsl:value-of select="."/>
</dateCaptured>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=250]/marc:subfield[@code='a']">
<edition>
<xsl:value-of select="."/>
</edition>
</xsl:for-each>
<xsl:for-each select="marc:leader">
<issuance>
<xsl:choose>
<xsl:when
test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'"
>monographic</xsl:when>
<xsl:when test="$leader7='b'">continuing</xsl:when>
<xsl:when
test="$leader7='m' and ($leader19='a' or $leader19='b' or $leader19='c')"
>multipart monograph</xsl:when>
<xsl:when test="$leader7='m' and ($leader19='#')">single unit</xsl:when>
<xsl:when test="$leader7='i'">integrating resource</xsl:when>
<xsl:when test="$leader7='s'">serial</xsl:when>
</xsl:choose>
</issuance>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=310]|marc:datafield[@tag=321]">
<frequency authority="marcfrequency">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">ab</xsl:with-param>
</xsl:call-template>
</frequency>
</xsl:for-each>
<!-- 1.67 1.72 updated fixed location issue 201308 1.86 -->
<xsl:if test="$typeOf008='SE'">
<xsl:for-each select="marc:controlfield[@tag=008]">
<xsl:variable name="controlField008-18" select="substring($controlField008,19,1)"/>
<xsl:variable name="frequency">
<frequency>
<xsl:choose>
<xsl:when test="$controlField008-18='a'">Annual</xsl:when>
<xsl:when test="$controlField008-18='b'">Bimonthly</xsl:when>
<xsl:when test="$controlField008-18='c'">Semiweekly</xsl:when>
<xsl:when test="$controlField008-18='d'">Daily</xsl:when>
<xsl:when test="$controlField008-18='e'">Biweekly</xsl:when>
<xsl:when test="$controlField008-18='f'">Semiannual</xsl:when>
<xsl:when test="$controlField008-18='g'">Biennial</xsl:when>
<xsl:when test="$controlField008-18='h'">Triennial</xsl:when>
<xsl:when test="$controlField008-18='i'">Three times a week</xsl:when>
<xsl:when test="$controlField008-18='j'">Three times a month</xsl:when>
<xsl:when test="$controlField008-18='k'">Continuously updated</xsl:when>
<xsl:when test="$controlField008-18='m'">Monthly</xsl:when>
<xsl:when test="$controlField008-18='q'">Quarterly</xsl:when>
<xsl:when test="$controlField008-18='s'">Semimonthly</xsl:when>
<xsl:when test="$controlField008-18='t'">Three times a year</xsl:when>
<xsl:when test="$controlField008-18='u'">Unknown</xsl:when>
<xsl:when test="$controlField008-18='w'">Weekly</xsl:when>
<!-- 1.95 20141219-->
<xsl:when test="$controlField008-18=' '">Completely irregular</xsl:when>
<xsl:when test="$controlField008-18='#'">Completely irregular</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</frequency>
</xsl:variable>
<xsl:if test="$frequency!=''">
<frequency>
<xsl:value-of select="$frequency"/>
</frequency>
</xsl:if>
</xsl:for-each>
</xsl:if>
</originInfo>
<!-- originInfo - 264 -->
<xsl:for-each select="marc:datafield[@tag=264][@ind2=0]">
<originInfo displayLabel="producer">
<!-- Template checks for altRepGroup - 880 $6 -->
<xsl:call-template name="xxx880"/>
<place>
<placeTerm>
<xsl:value-of select="marc:subfield[@code='a']"/>
</placeTerm>
</place>
<publisher>
<xsl:value-of select="marc:subfield[@code='b']"/>
</publisher>
<dateOther type="production">
<xsl:value-of select="marc:subfield[@code='c']"/>
</dateOther>
</originInfo>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=264][@ind2=1]">
<originInfo displayLabel="publisher">
<!-- Template checks for altRepGroup - 880 $6 -->
<xsl:call-template name="xxx880"/>
<place>
<placeTerm>
<xsl:value-of select="marc:subfield[@code='a']"/>
</placeTerm>
</place>
<publisher>
<xsl:value-of select="marc:subfield[@code='b']"/>
</publisher>
<dateIssued>
<xsl:value-of select="marc:subfield[@code='c']"/>
</dateIssued>
</originInfo>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=264][@ind2=2]">
<originInfo displayLabel="distributor">
<!-- Template checks for altRepGroup - 880 $6 -->
<xsl:call-template name="xxx880"/>
<place>