-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path05-2XX.xml
1460 lines (1390 loc) · 78.1 KB
/
05-2XX.xml
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'?>
<rules xmlns="http://www.loc.gov/bf2marc"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:bf="http://id.loc.gov/ontologies/bibframe/"
xmlns:bflc="http://id.loc.gov/ontologies/bflc/"
xmlns:madsrdf="http://www.loc.gov/mads/rdf/v1#"
xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<df tag="210" lang-xpath="bf:mainTitle">
<context xpath="bf:Instance/bf:title/*[local-name() = 'AbbreviatedTitle' or rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/AbbreviatedTitle']] |
bf:Work/bf:title/*[local-name() = 'AbbreviatedTitle' or rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/AbbreviatedTitle']]">
<ind1 default="0"/>
<ind2 default="0">
<switch>
<case test="bf:assigner/bf:Agent/bf:code = 'issnkey'"><text> </text></case>
</switch>
</ind2>
<sf code="a" chopPunct="true" repeatable="false"><select xpath="bf:mainTitle"/></sf>
<sf code="b" chopPunct="false" repeatable="false">
<select xpath="bf:qualifier" />
</sf>
<switch>
<case test="bf:assigner/bf:Agent[not(bf:code='issnkey')]">
<sf code="2" chopPunct="true">
<select xpath="bf:assigner/bf:Agent[not(bf:code='issnkey')]/bf:code"/>
</sf>
</case>
</switch>
</context>
</df>
<df tag="222" lang-xpath="bf:mainTitle">
<context xpath="bf:Work/bf:title/*[local-name() = 'KeyTitle' or rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/KeyTitle']]">
<ind1 default=" "/>
<ind2 default="0">
<switch>
<case test="bflc:nonSortNum">
<transform>
<xsl:value-of select="bflc:nonSortNum"/>
</transform>
</case>
<case test="bflc:titleSortKey and (string-length(bflc:titleSortKey) < string-length(bf:mainTitle))">
<transform>
<xsl:value-of select="string-length(bf:mainTitle) - string-length(bflc:titleSortKey)"/>
</transform>
</case>
</switch>
</ind2>
<sf code="a" chopPunct="true" repeatable="false"><select xpath="bf:mainTitle"/></sf>
<sf code="b" chopPunct="false" repeatable="false"><select xpath="bf:qualifier"/></sf>
</context>
</df>
<!--
This handles the relationship/Relationship pattern for what will
become a Name/Title or Title added entry.
It is predicated on a Hub being referenced.
-->
<df tag="240" lang-xpath="rdfs:label" lang-prefer="transliterated">
<context xpath="bf:Work/bf:expressionOf[contains(@rdf:resource, 'hubs')][../bf:contribution/*[local-name()='PrimaryContribution'] or ../bf:contribution/*/rdf:type[contains(@rdf:resource, '/PrimaryContribution')]] |
bf:Work/bf:expressionOf/bf:*[contains(@rdf:about, 'hubs') or bflc:marcKey or marc:record][../../bf:contribution/*[local-name()='PrimaryContribution'] or ../../bf:contribution/*/rdf:type[contains(@rdf:resource, '/PrimaryContribution')]]
">
<var name="relURI">
<switch>
<case test="contains(@rdf:resource,'id.loc.gov/resources/hubs')"><transform><xsl:value-of select="@rdf:resource"/></transform></case>
<case test="contains(@rdf:about,'id.loc.gov/resources/hubs')"><transform><xsl:value-of select="@rdf:about"/></transform></case>
</switch>
</var>
<var name="vRelResourcePreNS">
<transform>
<xsl:call-template name="tGetRelResource">
<xsl:with-param name="pRelUri" select="$relURI"/>
<xsl:with-param name="pContext" select="."/>
</xsl:call-template>
</transform>
</var>
<var name="vRelResource" xpath="exsl:node-set($vRelResourcePreNS)" />
<switch>
<case test="$xslProcessor='libxslt' and contains($relURI, 'resources/hubs') and not(bflc:marcKey)">
<transform>
<xsl:message>Record <xsl:value-of select="$vRecordId"/>: Unprocessed expressionOf node/Hub. No 240 output.</xsl:message>
</transform>
</case>
</switch>
<ind1 default="1"/>
<ind2 default="0" />
<switch>
<case test="$vRelResource//marc:datafield[@tag = '240']">
<!-- This was from a looked up resource, so a fuller MARC record, not a marcKey, -->
<transform>
<xsl:for-each select="$vRelResource//marc:datafield[@tag = '240']/marc:subfield">
<marc:subfield>
<xsl:attribute name="code"><xsl:value-of select="@code"/></xsl:attribute>
<xsl:value-of select="."/>
</marc:subfield>
</xsl:for-each>
</transform>
</case>
<case test="$vRelResource//marc:datafield[starts-with(@tag, '1')]">
<transform>
<xsl:for-each select="$vRelResource//marc:datafield[starts-with(@tag, '1')]/marc:subfield[(@code = 't' or preceding-sibling::marc:subfield[@code = 't']) and contains('dgfhklmnoprst',@code)]">
<marc:subfield>
<xsl:attribute name="code"><xsl:value-of select="translate(@code, 't', 'a')"/></xsl:attribute>
<xsl:value-of select="."/>
</marc:subfield>
</xsl:for-each>
</transform>
</case>
</switch>
<sf code="1">
<switch>
<case test="$relURI != ''">
<transform><xsl:value-of select="$relURI"/></transform>
</case>
</switch>
</sf>
</context>
</df>
<df tag="240" repeatable="false" lang-xpath="bf:mainTitle" lang-prefer="transliterated">
<!-- This should be copied from tag 130 for all subfields -->
<context xpath="bf:Work/bf:expressionOf/child::node()[
not(contains(@rdf:resource, 'hubs')) and not(contains(@rdf:about, 'hubs')) and
not(contains(@rdf:resource, 'REPLACE')) and not(contains(@rdf:about, 'REPLACE')) and
not(bflc:marcKey or marc:record) and
(local-name() = 'Hub' or local-name() = 'Work') and bf:title][../../bf:contribution/*[local-name()='PrimaryContribution'] or ../../bf:contribution/*/rdf:type[contains(@rdf:resource, '/PrimaryContribution')]]">
<ind1 default="1"/>
<ind2 default="0">
<switch>
<case test="bf:title/bf:Title/bflc:nonSortNum">
<transform>
<xsl:value-of select="bf:title/bf:Title/bflc:nonSortNum"/>
</transform>
</case>
<case test="bf:title/bf:Title/bflc:titleSortKey and (string-length(bf:title/bf:Title/bflc:titleSortKey) < string-length(bf:title/bf:Title/bf:mainTitle))">
<transform>
<xsl:value-of select="string-length(bf:title/bf:Title/bf:mainTitle) - string-length(bf:title/bf:Title/bflc:titleSortKey)"/>
</transform>
</case>
</switch>
</ind2>
<sf code="a" chopPunct="true" repeatable="false">
<switch>
<case test="bf:title/bf:Title/bf:mainTitle">
<select xpath="bf:title/bf:Title/bf:mainTitle"/>
</case>
</switch>
</sf>
<sf code="d"><select xpath="bf:legalDate"/></sf>
<sf code="f" repeatable="false"><select xpath="bf:originDate"/></sf>
<sf code="m" chopPunct="true"><select xpath="bf:musicMedium/bf:MusicMedium/rdfs:label"/></sf>
<sf code="n" chopPunct="true"><select xpath="bf:title/bf:Title/bf:partNumber"/></sf>
<sf code="p" chopPunct="true"><select xpath="bf:title/bf:Title/bf:partName"/></sf>
<switch>
<case test="rdf:type/@rdf:resource='http://id.loc.gov/ontologies/bibframe/Arrangement'">
<sf code="o">arranged</sf>
</case>
</switch>
<sf code="r" chopPunct="true"><select xpath="bf:musicKey"/></sf>
<sf code="s" chopPunct="true"><select xpath="bf:version"/></sf>
<sf code="0">
<select xpath="bf:identifiedBy/bf:Identifier">
<transform>
<xsl:variable name="vIdType">
<xsl:call-template name="tChopPunct">
<xsl:with-param name="pString" select="bf:source/bf:Source/bf:code"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$vIdType != ''"><xsl:value-of select="concat('(',$vIdType,')',rdf:value)"/></xsl:when>
<xsl:otherwise><xsl:value-of select="rdf:value"/></xsl:otherwise>
</xsl:choose>
</transform>
</select>
</sf>
<sf code="2"><select xpath="bf:source/bf:Source/bf:code"/></sf>
</context>
</df>
<df tag="242" lang-xpath="bf:mainTitle">
<context xpath="bf:Instance/bf:title/*[(local-name() = 'VariantTitle' or rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/VariantTitle']) and bf:variantType = 'translated']">
<ind1 default="1"/>
<ind2 default="0">
<switch>
<case test="bflc:nonSortNum">
<transform>
<xsl:value-of select="bflc:nonSortNum"/>
</transform>
</case>
<case test="bflc:titleSortKey and (string-length(bflc:titleSortKey) < string-length(bf:mainTitle))">
<transform>
<xsl:value-of select="string-length(bf:mainTitle) - string-length(bflc:titleSortKey)"/>
</transform>
</case>
</switch>
</ind2>
<sf code="a" chopPunct="true" repeatable="false"><select xpath="bf:mainTitle"/></sf>
<sf code="b" chopPunct="true" repeatable="false"><select xpath="bf:subtitle"/></sf>
<sf code="n" chopPunct="true"><select xpath="bf:partNumber"/></sf>
<sf code="p" chopPunct="true"><select xpath="bf:partName"/></sf>
<var name="langCode">
<lookup map="languages" targetField="iso6392">
<lookupField name="xmllang" xpath="bf:mainTitle/@xml:lang"/>
</lookup>
</var>
<switch>
<case test="$langCode != ''">
<sf code="y">
<transform>
<xsl:value-of select="$langCode" />
</transform>
</sf>
</case>
<case test="bf:mainTitle/@xml:lang != ''">
<sf code="y">
<transform>
<xsl:value-of select="bf:mainTitle/@xml:lang " />
</transform>
</sf>
</case>
</switch>
</context>
</df>
<df tag="243" repeatable="false" lang-xpath="bf:mainTitle" lang-prefer="transliterated">
<context xpath="bf:Work/bf:title/*[
local-name()='CollectiveTitle' or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/CollectiveTitle']
]">
<ind1 default="1"/>
<ind2 default="0">
<switch>
<case test="bflc:nonSortNum">
<transform>
<xsl:value-of select="bflc:nonSortNum"/>
</transform>
</case>
<case test="bflc:titleSortKey and (string-length(bflc:titleSortKey) < string-length(bf:mainTitle))">
<transform>
<xsl:value-of select="string-length(bf:mainTitle) - string-length(bflc:titleSortKey)"/>
</transform>
</case>
</switch>
</ind2>
<sf code="a" chopPunct="true" repeatable="false"><select xpath="bf:mainTitle"/></sf>
</context>
</df>
<!-- 245 (paired with 880) -->
<!-- $6 occurence number for 245 is always 01 -->
<!-- this is kind of inelegant; would be better to have this be a mode of the df element -->
<df tag="245" repeatable="false">
<context xpath="bf:Instance[not(rdf:type/@rdf:resource='http://id.loc.gov/ontologies/bflc/SecondaryInstance')]/bf:title/bf:Title[not(rdf:type)]|bf:Work[not(../bf:Instance/bf:title/bf:Title[not(rdf:type)])]/bf:title/bf:Title[not(rdf:type)]">
<ind1 default="0">
<switch>
<case test="/rdf:RDF/bf:Work/bf:contribution/*[local-name()='PrimaryContribution' or rdf:type[contains(@rdf:resource, '/PrimaryContribution')]]">1</case>
</switch>
</ind1>
<ind2 default="0">
<switch>
<case test="bflc:nonSortNum[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<transform>
<xsl:value-of select="bflc:nonSortNum[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/>
</transform>
</case>
<case test="bflc:titleSortKey[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))] and
(string-length(bflc:titleSortKey[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]) < string-length(bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]))">
<transform>
<xsl:value-of select="string-length(bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]) - string-length(bflc:titleSortKey[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))])"/>
</transform>
</case>
</switch>
</ind2>
<switch>
<case test="count(bf:mainTitle)=2 and bf:mainTitle[@xml:lang] and bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<sf code="6">880-02</sf>
</case>
</switch>
<sf code="a" chopPunct="true" repeatable="false">
<!-- The main title -->
<switch>
<case test="bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<select xpath="bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/>
</case>
<case test="count(bf:mainTitle)=1 and bf:mainTitle[@xml:lang]">
<select xpath="bf:mainTitle[@xml:lang]" />
</case>
</switch>
<switch>
<!-- If there is a partNumber, do a period. -->
<case test="
bf:partNumber[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))] and
not(
substring(
bf:mainTitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))],
string-length(bf:mainTitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]),
1) = '.'
)
">
<transform><xsl:text>.</xsl:text></transform>
</case>
<!-- If there is a partName, do a period. -->
<case test="bf:partName[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<transform><xsl:text>.</xsl:text></transform>
</case>
<!-- If there is a subtitle and no partnumber or partname, put a colon in. -->
<case test="bf:subtitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<transform><xsl:text> :</xsl:text></transform>
</case>
<case test="count(bf:subtitle)=1 and bf:subtitle[@xml:lang]">
<transform><xsl:text> :</xsl:text></transform>
</case>
<!-- If there is no partnumber or partname or subtitle, but there's a responStatement, put a slash in. -->
<case test="ancestor::bf:Instance/bf:responsibilityStatement[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<transform><xsl:text> /</xsl:text></transform>
</case>
<case test="count(ancestor::bf:Instance/bf:responsibilityStatement)=1 and ancestor::bf:Instance/bf:responsibilityStatement[@xml:lang]">
<transform><xsl:text> /</xsl:text></transform>
</case>
</switch>
</sf>
<sf code="n" chopPunct="true">
<var name="nExists">
<switch>
<case test="bf:partNumber[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<transform><xsl:value-of select="'1'" /></transform>
</case>
<case test="count(bf:partNumber)=1 and bf:partNumber[@xml:lang]">
<transform><xsl:value-of select="'1'" /></transform>
</case>
</switch>
</var>
<switch>
<case test="bf:partNumber[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<select xpath="bf:partNumber[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/>
</case>
<case test="count(bf:partNumber)=1 and bf:partNumber[@xml:lang]">
<select xpath="bf:partNumber[@xml:lang]" />
</case>
</switch>
<switch>
<!-- If there is a partName, do a period. -->
<case test="$nExists='1' and bf:partName[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<transform><xsl:text>,</xsl:text></transform>
</case>
<!-- If there is a subtitle and no partnumber or partname, put a colon in. -->
<case test="$nExists='1' and bf:subtitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<transform><xsl:text> :</xsl:text></transform>
</case>
<case test="$nExists='1' and count(bf:subtitle)=1 and bf:subtitle[@xml:lang]">
<transform><xsl:text> :</xsl:text></transform>
</case>
<!-- If there is no partnumber or partname or subtitle, but there's a responStatement, put a slash in. -->
<case test="$nExists='1' and ancestor::bf:Instance/bf:responsibilityStatement[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<transform><xsl:text> /</xsl:text></transform>
</case>
<case test="$nExists='1' and count(ancestor::bf:Instance/bf:responsibilityStatement)=1 and ancestor::bf:Instance/bf:responsibilityStatement[@xml:lang]">
<transform><xsl:text> /</xsl:text></transform>
</case>
</switch>
</sf>
<sf code="p" chopPunct="true">
<var name="pExists">
<switch>
<case test="bf:partName[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<transform><xsl:value-of select="'1'" /></transform>
</case>
<case test="count(bf:partName)=1 and bf:partName[@xml:lang]">
<transform><xsl:value-of select="'1'" /></transform>
</case>
</switch>
</var>
<switch>
<case test="bf:partName[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<select xpath="bf:partName[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/>
</case>
<case test="count(bf:partName)=1 and bf:partName[@xml:lang]">
<select xpath="bf:partName[@xml:lang]" />
</case>
</switch>
<switch>
<!-- If there is a subtitle and no partnumber or partname, put a colon in. -->
<case test="$pExists='1' and bf:subtitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<transform><xsl:text> :</xsl:text></transform>
</case>
<case test="$pExists='1' and count(bf:subtitle)=1 and bf:subtitle[@xml:lang]">
<transform><xsl:text> :</xsl:text></transform>
</case>
<!-- If there is no partnumber or partname or subtitle, but there's a responStatement, put a slash in. -->
<case test="$pExists='1' and ancestor::bf:Instance/bf:responsibilityStatement[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<transform><xsl:text> /</xsl:text></transform>
</case>
<case test="$pExists='1' and count(ancestor::bf:Instance/bf:responsibilityStatement)=1 and ancestor::bf:Instance/bf:responsibilityStatement[@xml:lang]">
<transform><xsl:text> /</xsl:text></transform>
</case>
</switch>
</sf>
<sf code="b" chopPunct="true" repeatable="false">
<var name="bExists">
<switch>
<case test="bf:subtitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<transform><xsl:value-of select="'1'" /></transform>
</case>
<case test="count(bf:subtitle)=1 and bf:subtitle[@xml:lang]">
<transform><xsl:value-of select="'1'" /></transform>
</case>
</switch>
</var>
<switch>
<case test="bf:subtitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<select xpath="bf:subtitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/>
</case>
<case test="count(bf:subtitle)=1 and bf:subtitle[@xml:lang]">
<select xpath="bf:subtitle[@xml:lang]" />
</case>
</switch>
<switch>
<!-- If there is no partnumber or partname or subtitle, but there's a responStatement, put a slash in. -->
<case test="$bExists='1' and ancestor::bf:Instance/bf:responsibilityStatement[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<transform><xsl:text> /</xsl:text></transform>
</case>
<case test="$bExists='1' and count(ancestor::bf:Instance/bf:responsibilityStatement)=1 and ancestor::bf:Instance/bf:responsibilityStatement[@xml:lang]">
<transform><xsl:text> /</xsl:text></transform>
</case>
</switch>
</sf>
<sf code="c" chopPunct="false" repeatable="false">
<switch>
<case test="ancestor::bf:Instance/bf:responsibilityStatement[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<select xpath="ancestor::bf:Instance/bf:responsibilityStatement[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/>
<var name="vEndsWith">
<transform>
<xsl:call-template name="tEndsWith">
<xsl:with-param name="pStr" select="ancestor::bf:Instance/bf:responsibilityStatement[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/>
<xsl:with-param name="pEndChar" select="'.'"/>
</xsl:call-template>
</transform>
</var>
<transform>
<xsl:if test="$vEndsWith = '0'">
<xsl:text>.</xsl:text>
</xsl:if>
</transform>
</case>
<case test="count(ancestor::bf:Instance/bf:responsibilityStatement)=1 and ancestor::bf:Instance/bf:responsibilityStatement[@xml:lang]">
<select xpath="ancestor::bf:Instance/bf:responsibilityStatement[@xml:lang]" />
<var name="vEndsWith">
<transform>
<xsl:call-template name="tEndsWith">
<xsl:with-param name="pStr" select="ancestor::bf:Instance/bf:responsibilityStatement[@xml:lang]"/>
<xsl:with-param name="pEndChar" select="'.'"/>
</xsl:call-template>
</transform>
</var>
<transform>
<xsl:if test="$vEndsWith = '0'">
<xsl:text>.</xsl:text>
</xsl:if>
</transform>
</case>
</switch>
</sf>
</context>
</df>
<select xpath="bf:Instance[not(rdf:type/@rdf:resource='http://id.loc.gov/ontologies/bflc/SecondaryInstance')]/bf:title/bf:Title[not(rdf:type)]|bf:Work[not(../bf:Instance/bf:title/bf:Title[not(rdf:type)])]/bf:title/bf:Title[not(rdf:type)]">
<var name="v880Script">
<lookup map="df880script" targetField="code">
<lookupField name="lang" xpath="translate(substring-after(bf:mainTitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]/@xml:lang,'-'),$upper,$lower)"/>
</lookup>
</var>
<switch>
<case test="position()=1 and (count(bf:mainTitle)=2 and bf:mainTitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))] and bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))])">
<df tag="880">
<ind1 default="0">
<switch>
<case test="/rdf:RDF/bf:Work/bf:contribution/*[local-name()='PrimaryContribution' or rdf:type[contains(@rdf:resource, '/PrimaryContribution')]]">1</case>
</switch>
</ind1>
<ind2 default="0">
<switch>
<case test="bflc:nonSortNum[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<transform>
<xsl:value-of select="bflc:nonSortNum[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]"/>
</transform>
</case>
<case test="bflc:titleSortKey[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))] and
(string-length(bflc:titleSortKey[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]) < string-length(bf:mainTitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]))">
<transform>
<xsl:value-of select="string-length(bf:mainTitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]) - string-length(bflc:titleSortKey[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))])"/>
</transform>
</case>
</switch>
</ind2>
<sf code="6">
<switch>
<case test="$v880Script != ''">
<transform><xsl:value-of select="concat('245-02/',$v880Script)"/></transform>
</case>
<case test="default">245-01</case>
</switch>
</sf>
<sf code="a" chopPunct="true" repeatable="false">
<switch>
<case test="bf:mainTitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<select xpath="bf:mainTitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]"/>
</case>
</switch>
<switch>
<!-- If there is a partNumber, do a period. -->
<case test="
bf:partNumber[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))] and
not(
substring(
bf:mainTitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))],
string-length(bf:mainTitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]),
1) = '.'
)
">
<transform><xsl:text>.</xsl:text></transform>
</case>
<!-- If there is a partName, do a period. -->
<case test="bf:partName[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<transform><xsl:text>.</xsl:text></transform>
</case>
<!-- If there is a subtitle and no partnumber or partname, put a colon in. -->
<case test="bf:subtitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<transform><xsl:text> :</xsl:text></transform>
</case>
<!-- If there is no partnumber or partname or subtitle, but there's a responStatement, put a slash in. -->
<case test="ancestor::bf:Instance/bf:responsibilityStatement[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<transform><xsl:text> /</xsl:text></transform>
</case>
</switch>
</sf>
<sf code="n" chopPunct="true">
<var name="nExists">
<switch>
<case test="bf:partNumber[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<transform><xsl:value-of select="'1'" /></transform>
</case>
</switch>
</var>
<switch>
<case test="bf:partNumber[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<select xpath="bf:partNumber[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]"/>
</case>
</switch>
<switch>
<!-- If there is a partName, do a period. -->
<case test="$nExists='1' and bf:partName[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<transform><xsl:text>.</xsl:text></transform>
</case>
<!-- If there is a subtitle and no partnumber or partname, put a colon in. -->
<case test="$nExists='1' and bf:subtitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<transform><xsl:text> :</xsl:text></transform>
</case>
<!-- If there is no partnumber or partname or subtitle, but there's a responStatement, put a slash in. -->
<case test="$nExists='1' and ancestor::bf:Instance/bf:responsibilityStatement[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<transform><xsl:text> /</xsl:text></transform>
</case>
</switch>
</sf>
<sf code="p" chopPunct="true">
<var name="pExists">
<switch>
<case test="bf:partName[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<transform><xsl:value-of select="'1'" /></transform>
</case>
</switch>
</var>
<switch>
<case test="bf:partName[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<select xpath="bf:partName[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]"/>
</case>
</switch>
<switch>
<!-- If there is a subtitle and no partnumber or partname, put a colon in. -->
<case test="$pExists='1' and bf:subtitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<transform><xsl:text> :</xsl:text></transform>
</case>
<!-- If there is no partnumber or partname or subtitle, but there's a responStatement, put a slash in. -->
<case test="$pExists='1' and ancestor::bf:Instance/bf:responsibilityStatement[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<transform><xsl:text> /</xsl:text></transform>
</case>
</switch>
</sf>
<sf code="b" chopPunct="true" repeatable="false">
<var name="bExists">
<switch>
<case test="bf:subtitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<transform><xsl:value-of select="'1'" /></transform>
</case>
</switch>
</var>
<switch>
<case test="bf:subtitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<select xpath="bf:subtitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]"/>
</case>
</switch>
<switch>
<!-- If there is no partnumber or partname or subtitle, but there's a responStatement, put a slash in. -->
<case test="$bExists='1' and ancestor::bf:Instance/bf:responsibilityStatement[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<transform><xsl:text> /</xsl:text></transform>
</case>
</switch>
</sf>
<sf code="c" chopPunct="false" repeatable="false">
<switch>
<case test="ancestor::bf:Instance/bf:responsibilityStatement[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]">
<select xpath="ancestor::bf:Instance/bf:responsibilityStatement[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]"/>
<var name="vEndsWith">
<transform>
<xsl:call-template name="tEndsWith">
<xsl:with-param name="pStr" select="ancestor::bf:Instance/bf:responsibilityStatement[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))]"/>
<xsl:with-param name="pEndChar" select="'.'"/>
</xsl:call-template>
</transform>
</var>
<transform>
<xsl:if test="$vEndsWith = '0'">
<xsl:text>.</xsl:text>
</xsl:if>
</transform>
</case>
</switch>
</sf>
</df>
</case>
</switch>
</select>
<select xpath="
bf:*[local-name()='Instance' or local-name()='Work']/bf:title/bf:*[(
local-name()='VariantTitle' or
local-name()='ParallelTitle' or
local-name()='TranscribedTitle' or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/VariantTitle'] or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/ParallelTitle'] or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bflc/TranscribedTitle']
) and
not(bf:variantType = 'translated') and
not(bf:variantType = 'former') and
bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]
]
|
bf:Instance/bf:hasItem/bf:Item/bf:title/bf:*[
bflc:applicableInstitution/*/bf:code='DLC' and
(
local-name()='VariantTitle' or
local-name()='ParallelTitle' or
local-name()='TranscribedTitle' or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/VariantTitle'] or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/ParallelTitle'] or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bflc/TranscribedTitle']
) and
not(bf:variantType = 'translated') and
not(bf:variantType = 'former') and
bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]
]
">
<var name="vOccurrenceNumber">
<transform>
<xsl:if test="count(bf:mainTitle)=2 and bf:mainTitle[@xml:lang] and bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<xsl:variable name="prevTitleCount" select="count(parent::bf:title/preceding-sibling::bf:title/*[(
local-name()='VariantTitle' or
local-name()='ParallelTitle' or
local-name()='TranscribedTitle' or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/VariantTitle'] or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/ParallelTitle'] or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bflc/TranscribedTitle']
) and
not(bf:variantType = 'translated') and
not(bf:variantType = 'former') and
bf:mainTitle[@xml:lang]])" />
<xsl:value-of select="3 + $prevTitleCount" />
</xsl:if>
</transform>
</var>
<df tag="246">
<ind1 default="1">
<switch>
<case test="local-name()='ParallelTitle' or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/ParallelTitle']">3</case>
<case test="bf:variantType = 'portion'">3</case>
</switch>
</ind1>
<ind2 default=" ">
<switch>
<case test="local-name()='ParallelTitle' or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/ParallelTitle']">1</case>
<case test="bf:variantType = 'portion'">0</case>
<case test="bf:variantType = 'distinctive'">2</case>
<case test="bf:variantType = 'cover'">4</case>
<case test="bf:variantType = 'added title page'">5</case>
<case test="bf:variantType = 'caption'">6</case>
<case test="bf:variantType = 'running'">7</case>
<case test="bf:variantType = 'spine'">8</case>
</switch>
</ind2>
<switch>
<case test="count(bf:mainTitle)=2 and bf:mainTitle[@xml:lang] and bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<sf code="6"><transform><xsl:value-of select="concat('880-0', $vOccurrenceNumber)" /></transform></sf>
</case>
</switch>
<sf code="i" chopPunct="true" repeatable="false">
<select xpath="bf:note/bf:Note/rdfs:label"/>
</sf>
<sf code="a" chopPunct="true" repeatable="false"><select xpath="bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/></sf>
<sf code="b" chopPunct="true" repeatable="false"><select xpath="bf:subtitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/></sf>
<sf code="f" chopPunct="true" repeatable="false"><select xpath="bf:date[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/></sf>
<sf code="n" chopPunct="true"><select xpath="bf:partNumber[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/></sf>
<sf code="p" chopPunct="true"><select xpath="bf:partName[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/></sf>
<sf code="5" repeatable="false"><select xpath="bflc:applicableInstitution/bf:Agent/bf:code"/></sf>
</df>
<switch>
<case test="count(bf:mainTitle)=2 and bf:mainTitle[@xml:lang] and bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<var name="vLangTag" xpath="bf:mainTitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))][1]/@xml:lang" />
<var name="vScript"><transform><xsl:value-of select="translate(substring-after($vLangTag,'-'),$upper,$lower)" /></transform></var>
<var name="v880Script">
<lookup map="df880script" targetField="code">
<lookupField name="lang" xpath="$vScript"/>
</lookup>
</var>
<df tag="880">
<ind1 default="1">
<switch>
<case test="local-name()='ParallelTitle' or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/ParallelTitle']">3</case>
<case test="bf:variantType = 'portion'">3</case>
</switch>
</ind1>
<ind2 default=" ">
<switch>
<case test="local-name()='ParallelTitle' or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/ParallelTitle']">1</case>
<case test="bf:variantType = 'portion'">0</case>
<case test="bf:variantType = 'distinctive'">2</case>
<case test="bf:variantType = 'cover'">4</case>
<case test="bf:variantType = 'added title page'">5</case>
<case test="bf:variantType = 'caption'">6</case>
<case test="bf:variantType = 'running'">7</case>
<case test="bf:variantType = 'spine'">8</case>
</switch>
</ind2>
<sf code="6"><transform><xsl:value-of select="concat('246-0', $vOccurrenceNumber, '/' , $v880Script)" /></transform></sf>
<sf code="i" chopPunct="true" repeatable="false">
<select xpath="bf:note/bf:Note/rdfs:label"/>
</sf>
<sf code="a" chopPunct="true" repeatable="false"><select xpath="bf:mainTitle[contains(translate(@xml:lang,$upper,$lower), $vScript)]"/></sf>
<sf code="b" chopPunct="true" repeatable="false"><select xpath="bf:subtitle[contains(translate(@xml:lang,$upper,$lower), $vScript)]"/></sf>
<sf code="f" chopPunct="true" repeatable="false"><select xpath="bf:date[contains(translate(@xml:lang,$upper,$lower), $vScript)]"/></sf>
<sf code="n" chopPunct="true"><select xpath="bf:partNumber[contains(translate(@xml:lang,$upper,$lower), $vScript)]"/></sf>
<sf code="p" chopPunct="true"><select xpath="bf:partName[contains(translate(@xml:lang,$upper,$lower), $vScript)]"/></sf>
<sf code="5" repeatable="false"><select xpath="bflc:applicableInstitution/bf:Agent/bf:code"/></sf>
</df>
</case>
</switch>
</select>
<select xpath="bf:Work/bf:title/*[(
local-name()='VariantTitle' or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/VariantTitle']
) and
bf:variantType = 'former' and
(
bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))] or
rdfs:label[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]
)
] |
bf:Instance[rdf:type/@rdf:resource!='http://id.loc.gov/ontologies/bflc/SecondaryInstance']/bf:title/*[(
local-name()='VariantTitle' or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/VariantTitle']
) and
bf:variantType = 'former' and
(
bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))] or
rdfs:label[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]
)
]">
<var name="vOccurrenceNumber">
<transform>
<xsl:if test="count(bf:mainTitle)=2 and bf:mainTitle[@xml:lang] and bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<xsl:variable name="prevTitleCount" select="count(parent::bf:title/preceding-sibling::bf:title/*[(
local-name()='VariantTitle' or
rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/VariantTitle']
) and
bf:variantType = 'former' and
bf:mainTitle[@xml:lang]])" />
<xsl:value-of select="7 + $prevTitleCount" />
</xsl:if>
</transform>
</var>
<df tag="247">
<ind1 default="1"/>
<ind2 default="0"/>
<switch>
<case test="count(bf:mainTitle)=2 and bf:mainTitle[@xml:lang] and bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<sf code="6"><transform><xsl:value-of select="concat('880-0', $vOccurrenceNumber)" /></transform></sf>
</case>
</switch>
<sf code="a" chopPunct="true" repeatable="false">
<switch>
<case test="bf:mainTitle"><select xpath="bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/></case>
<case test="rdfs:label"><select xpath="rdfs:label[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/></case>
</switch>
</sf>
<sf code="b" chopPunct="true" repeatable="false">
<select xpath="bf:subtitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/>
</sf>
<sf code="f" chopPunct="true" repeatable="false">
<select xpath="bf:date[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/>
</sf>
<sf code="g" chopPunct="true" repeatable="false">
<select xpath="bf:qualifier[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<transform>
<xsl:value-of select="concat('(',.,')')"/>
</transform>
</select>
</sf>
<sf code="n" chopPunct="true">
<select xpath="bf:partNumber[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/>
</sf>
<sf code="p" chopPunct="true">
<select xpath="bf:partName[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]"/>
</sf>
<sf code="x" repeatable="false">
<select xpath="bf:identifiedBy/*[local-name()='Issn' or rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/Issn']]/rdf:value"/>
</sf>
</df>
<switch>
<case test="count(bf:mainTitle)=2 and bf:mainTitle[@xml:lang] and bf:mainTitle[not(@xml:lang) or contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower))]">
<var name="vLangTag" xpath="bf:mainTitle[@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))][1]/@xml:lang" />
<var name="vScript"><transform><xsl:value-of select="translate(substring-after($vLangTag,'-'),$upper,$lower)" /></transform></var>
<var name="v880Script">
<lookup map="df880script" targetField="code">
<lookupField name="lang" xpath="$vScript"/>
</lookup>
</var>
<df tag="880">
<ind1 default="1"/>
<ind2 default="0"/>
<sf code="6"><transform><xsl:value-of select="concat('247-0', $vOccurrenceNumber, '/' , $v880Script)" /></transform></sf>
<sf code="a" chopPunct="true" repeatable="false">
<switch>
<case test="bf:mainTitle"><select xpath="bf:mainTitle[contains(translate(@xml:lang,$upper,$lower), $vScript)]"/></case>
<case test="rdfs:label"><select xpath="rdfs:label[contains(translate(@xml:lang,$upper,$lower), $vScript)]"/></case>
</switch>
</sf>
<sf code="b" chopPunct="true" repeatable="false">
<select xpath="bf:subtitle[contains(translate(@xml:lang,$upper,$lower), $vScript)]"/>
</sf>
<sf code="f" chopPunct="true" repeatable="false">
<select xpath="bf:date[contains(translate(@xml:lang,$upper,$lower), $vScript)]"/>
</sf>
<sf code="g" chopPunct="true" repeatable="false">
<select xpath="bf:qualifier[contains(translate(@xml:lang,$upper,$lower), $vScript)]">
<transform>
<xsl:value-of select="concat('(',.,')')"/>
</transform>
</select>
</sf>
<sf code="n" chopPunct="true">
<select xpath="bf:partNumber[contains(translate(@xml:lang,$upper,$lower), $vScript)]"/>
</sf>
<sf code="p" chopPunct="true">
<select xpath="bf:partName[contains(translate(@xml:lang,$upper,$lower), $vScript)]"/>
</sf>
<sf code="x" repeatable="false">
<select xpath="bf:identifiedBy/*[local-name()='Issn' or rdf:type[@rdf:resource='http://id.loc.gov/ontologies/bibframe/Issn']]/rdf:value"/>
</sf>
</df>
</case>
</switch>
</select>
<!-- 250/880 -->
<select xpath="bf:Instance/bf:editionStatement">
<var name="v880Script">
<switch>
<case test="@xml:lang and not(contains(translate(@xml:lang,$upper,$lower),translate($pCatScript,$upper,$lower)))">
<lookup map="df880script" targetField="code">
<lookupField name="lang" xpath="translate(substring-after(@xml:lang,'-'),$upper,$lower)"/>
</lookup>
</case>
</switch>
</var>
<switch>
<case test="$v880Script != ''">
<df tag="880">
<ind1 default=" "/>
<ind2 default=" "/>
<switch>
<case test="ancestor::bf:Instance/bf:editionStatement[not(@xml:lang)]">
<sf code="6"><transform><xsl:value-of select="concat('250-24/',$v880Script)"/></transform></sf>
</case>
<case test="default"><sf code="6"><transform><xsl:value-of select="concat('250-25/',$v880Script)"/></transform></sf></case>
</switch>
<sf code="a" chopPunct="false">
<transform>
<xsl:value-of select="."></xsl:value-of>
<xsl:variable name="vEndsWith">
<transform>
<xsl:call-template name="tEndsWith">
<xsl:with-param name="pStr" select="."/>
<xsl:with-param name="pEndChar" select="'.'"/>
</xsl:call-template>
</transform>
</xsl:variable>
<xsl:if test="$vEndsWith = '0'">
<xsl:text>.</xsl:text>
</xsl:if>
</transform>
</sf>
</df>
</case>
<case test="default">
<df tag="250">
<ind1 default=" "/>
<ind2 default=" "/>
<switch>
<case test="ancestor::bf:Instance/bf:editionStatement[@xml:lang]">
<sf code="6"><transform><xsl:value-of select="'880-24'"/></transform></sf>
</case>
</switch>
<sf code="a" chopPunct="false">
<transform>
<xsl:value-of select="."></xsl:value-of>
<xsl:variable name="vEndsWith">
<transform>
<xsl:call-template name="tEndsWith">
<xsl:with-param name="pStr" select="."/>
<xsl:with-param name="pEndChar" select="'.'"/>
</xsl:call-template>
</transform>
</xsl:variable>
<xsl:if test="$vEndsWith = '0'">
<xsl:text>.</xsl:text>
</xsl:if>
</transform>
</sf>
</df>
</case>
</switch>
</select>
<df tag="255">
<context xpath="bf:Work/bf:scale[not(bf:Scale)]">
<ind1 default=" "/>