bibframe_ruby 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +24 -2
- data/docs/superpowers/plans/2026-09-09-marc-conversion.md +537 -0
- data/docs/superpowers/specs/2026-09-09-marc-conversion-design.md +110 -0
- data/lib/bibframe_ruby/marc_converter.rb +67 -0
- data/lib/bibframe_ruby/parser.rb +4 -2
- data/lib/bibframe_ruby/version.rb +1 -1
- data/lib/bibframe_ruby.rb +7 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-001-007.xsl +2276 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-006,008.xsl +1295 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-010-048.xsl +1712 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-050-088.xsl +713 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-1XX,7XX,8XX-names.xsl +1141 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-200-247not240-Titles.xsl +771 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-240andX30-UnifTitle.xsl +535 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-250-270.xsl +283 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-3XX.xsl +2245 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-460-468-SeriesTreat.xsl +135 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-490-510-Links.xsl +145 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-5XX.xsl +1448 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-600-662.xsl +1417 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-720+740to755.xsl +333 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-758.xsl +102 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-760-788-Links.xsl +771 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-841-887.xsl +328 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-880.xsl +119 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-ControlSubfields.xsl +495 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-LDR.xsl +183 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-Preprocess0-Splitting.xsl +765 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-Process6-Series.xsl +627 -0
- data/vendor/marc2bibframe2/xsl/ConvSpec-Process8-ProvAct.xsl +1021 -0
- data/vendor/marc2bibframe2/xsl/conf/abbreviations.xml +13 -0
- data/vendor/marc2bibframe2/xsl/conf/code-to-script.xml +399 -0
- data/vendor/marc2bibframe2/xsl/conf/codeMaps.xml +723 -0
- data/vendor/marc2bibframe2/xsl/conf/exclusions.xml +4 -0
- data/vendor/marc2bibframe2/xsl/conf/iso6392-to-1.xml +615 -0
- data/vendor/marc2bibframe2/xsl/conf/languageCrosswalk.xml +1503 -0
- data/vendor/marc2bibframe2/xsl/conf/map880.xml +175 -0
- data/vendor/marc2bibframe2/xsl/conf/scriptCrosswalk.xml +210 -0
- data/vendor/marc2bibframe2/xsl/conf/subjectThesaurus.xml +29 -0
- data/vendor/marc2bibframe2/xsl/marc2bibframe2.xsl +610 -0
- data/vendor/marc2bibframe2/xsl/naco-normalize.xsl +205 -0
- data/vendor/marc2bibframe2/xsl/utils.xsl +963 -0
- data/vendor/marc2bibframe2/xsl/variables.xsl +108 -0
- metadata +68 -1
|
@@ -0,0 +1,765 @@
|
|
|
1
|
+
<?xml version='1.0'?>
|
|
2
|
+
<xsl:stylesheet version="1.0"
|
|
3
|
+
xmlns:marc="http://www.loc.gov/MARC21/slim"
|
|
4
|
+
xmlns:exsl="http://exslt.org/common"
|
|
5
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
6
|
+
exclude-result-prefixes="xsl">
|
|
7
|
+
|
|
8
|
+
<xsl:output encoding="UTF-8" method="xml" indent="yes"/>
|
|
9
|
+
|
|
10
|
+
<!-- base for minting URIs -->
|
|
11
|
+
<xsl:param name="baseuri" select="'http://example.org/'"/>
|
|
12
|
+
|
|
13
|
+
<!--
|
|
14
|
+
MARC field in which to find the record ID
|
|
15
|
+
Defaults to subfield $a, to use a different subfield,
|
|
16
|
+
add to the end of the tag (e.g. "035a")
|
|
17
|
+
-->
|
|
18
|
+
<xsl:param name="idfield" select="'001'"/>
|
|
19
|
+
|
|
20
|
+
<!--
|
|
21
|
+
Use field conversion for locally defined fields.
|
|
22
|
+
Some fields in the conversion (e.g. 859) are locally defined by
|
|
23
|
+
LoC for conversion. By default these fields will not be
|
|
24
|
+
converted unless this parameter evaluates to true()
|
|
25
|
+
-->
|
|
26
|
+
<xsl:param name="localfields" select="true()" />
|
|
27
|
+
|
|
28
|
+
<!--
|
|
29
|
+
Infer script from BCP47 code.
|
|
30
|
+
If true, BCP47 codes will not include
|
|
31
|
+
the script component when it can be inferred from the language component.
|
|
32
|
+
If false, the script component (the "-cyrl" of ru-cyrl) will be included in
|
|
33
|
+
the code. At all times codes will be lowercased.
|
|
34
|
+
-->
|
|
35
|
+
<xsl:param name="bcp47inferrence" select="true()" />
|
|
36
|
+
|
|
37
|
+
<xsl:include href="variables.xsl"/>
|
|
38
|
+
<xsl:include href="utils.xsl"/>
|
|
39
|
+
|
|
40
|
+
<xsl:template match="/">
|
|
41
|
+
<marc:collection>
|
|
42
|
+
<xsl:apply-templates />
|
|
43
|
+
</marc:collection>
|
|
44
|
+
</xsl:template>
|
|
45
|
+
|
|
46
|
+
<xsl:template match="marc:record[@type='Bibliographic' or not(@type)]">
|
|
47
|
+
<xsl:variable name="recordno"><xsl:value-of select="position()"/></xsl:variable>
|
|
48
|
+
<xsl:variable name="recordid">
|
|
49
|
+
<xsl:apply-templates mode="recordid" select=".">
|
|
50
|
+
<xsl:with-param name="baseuri" select="$baseuri"/>
|
|
51
|
+
<xsl:with-param name="idfield" select="$idfield"/>
|
|
52
|
+
<xsl:with-param name="recordno" select="$recordno"/>
|
|
53
|
+
</xsl:apply-templates>
|
|
54
|
+
</xsl:variable>
|
|
55
|
+
|
|
56
|
+
<xsl:variable name="leader06" select="substring(marc:leader,7,1)"/>
|
|
57
|
+
<xsl:variable name="count006" select="count(marc:controlfield[@tag='006'])"/>
|
|
58
|
+
<xsl:variable name="count007" select="count(marc:controlfield[@tag='007'])"/>
|
|
59
|
+
<xsl:variable name="count007minusC" select="count(marc:controlfield[@tag='007' and substring(.,1,1) != 'c'])"/>
|
|
60
|
+
<xsl:variable name="countOrig300" select="count(marc:datafield[@tag='300'])"/>
|
|
61
|
+
|
|
62
|
+
<xsl:variable name="groups">
|
|
63
|
+
<marc:groups>
|
|
64
|
+
<xsl:variable name="the300s">
|
|
65
|
+
<xsl:apply-templates select="marc:datafield[@tag='300']" mode="groupify">
|
|
66
|
+
<xsl:with-param name="pLeader06" select="$leader06" />
|
|
67
|
+
<xsl:with-param name="pcountOrig300" select="$countOrig300" />
|
|
68
|
+
</xsl:apply-templates>
|
|
69
|
+
</xsl:variable>
|
|
70
|
+
<xsl:variable name="the300sNS" select="exsl:node-set($the300s)"/>
|
|
71
|
+
|
|
72
|
+
<!-- <xsl:message><xsl:copy-of select="$the300sNS" /></xsl:message> -->
|
|
73
|
+
|
|
74
|
+
<xsl:variable name="df3XXs" select="marc:datafield[
|
|
75
|
+
@tag='336' or @tag='337' or @tag='338' or
|
|
76
|
+
@tag='344' or
|
|
77
|
+
@tag='346' or @tag='347' or @tag='348'
|
|
78
|
+
]"/>
|
|
79
|
+
<xsl:for-each select="$the300sNS/marc:datafield">
|
|
80
|
+
<marc:group>
|
|
81
|
+
<xsl:copy-of select="." />
|
|
82
|
+
<xsl:for-each select="marc:subfield[@code='3']">
|
|
83
|
+
<xsl:variable name="c3" select="."/>
|
|
84
|
+
<xsl:apply-templates select="$df3XXs[marc:subfield[@code='3' and contains(., $c3)]]">
|
|
85
|
+
<xsl:with-param name="genId">1</xsl:with-param>
|
|
86
|
+
</xsl:apply-templates>
|
|
87
|
+
<xsl:apply-templates select="$df3XXs[not(marc:subfield[@code='3']) and marc:subfield[@code='a' and .=$c3]]">
|
|
88
|
+
<xsl:with-param name="genId">1</xsl:with-param>
|
|
89
|
+
</xsl:apply-templates>
|
|
90
|
+
</xsl:for-each>
|
|
91
|
+
</marc:group>
|
|
92
|
+
</xsl:for-each>
|
|
93
|
+
</marc:groups>
|
|
94
|
+
</xsl:variable>
|
|
95
|
+
<xsl:variable name="groupsNS" select="exsl:node-set($groups)" />
|
|
96
|
+
<xsl:variable name="count300" select="count($groupsNS/marc:groups/marc:group/marc:datafield[@tag='300'])"/>
|
|
97
|
+
|
|
98
|
+
<!-- <xsl:message><xsl:copy-of select="$groups" /></xsl:message> -->
|
|
99
|
+
|
|
100
|
+
<xsl:variable name="viable856s">
|
|
101
|
+
<xsl:for-each select="marc:datafield[
|
|
102
|
+
@tag='856' and
|
|
103
|
+
(@ind2=' ' or @ind2='0' or @ind2='1' or @ind2='8') and
|
|
104
|
+
marc:subfield[@code='u'] and
|
|
105
|
+
not( contains(marc:subfield[@code='3'], 'able of contents') ) and
|
|
106
|
+
not( contains(marc:subfield[@code='a'], 'able of contents') ) and
|
|
107
|
+
not(contains(../marc:datafield[@tag='300'][1]/marc:subfield[@code='a'], 'nline resource'))
|
|
108
|
+
]">
|
|
109
|
+
<xsl:variable name="theU" select="marc:subfield[@code='u']" />
|
|
110
|
+
<xsl:if test="count($exclusions/exclusions/exclusion/@text[contains($theU, .)]) = 0">
|
|
111
|
+
<xsl:copy-of select="."/>
|
|
112
|
+
</xsl:if>
|
|
113
|
+
</xsl:for-each>
|
|
114
|
+
</xsl:variable>
|
|
115
|
+
<xsl:variable name="viable856sNS" select="exsl:node-set($viable856s)" />
|
|
116
|
+
<xsl:variable name="countViable856s" select="count($viable856sNS/marc:datafield)" />
|
|
117
|
+
|
|
118
|
+
<xsl:variable name="viable859s">
|
|
119
|
+
<xsl:if test="$localfields">
|
|
120
|
+
<xsl:for-each select="marc:datafield[
|
|
121
|
+
@tag='859' and
|
|
122
|
+
(@ind2=' ' or @ind2='0' or @ind2='1' or @ind2='8') and
|
|
123
|
+
marc:subfield[@code='u'] and
|
|
124
|
+
not( contains(marc:subfield[@code='3'], 'able of contents') ) and
|
|
125
|
+
not( contains(marc:subfield[@code='a'], 'able of contents') ) and
|
|
126
|
+
not(contains(../marc:datafield[@tag='300'][1]/marc:subfield[@code='a'], 'nline resource'))
|
|
127
|
+
]">
|
|
128
|
+
<xsl:variable name="theU" select="marc:subfield[@code='u']" />
|
|
129
|
+
<xsl:if test="count($exclusions/exclusions/exclusion/@text[contains($theU, .)]) = 0">
|
|
130
|
+
<xsl:copy-of select="."/>
|
|
131
|
+
</xsl:if>
|
|
132
|
+
</xsl:for-each>
|
|
133
|
+
</xsl:if>
|
|
134
|
+
</xsl:variable>
|
|
135
|
+
<xsl:variable name="viable859sNS" select="exsl:node-set($viable859s)" />
|
|
136
|
+
<xsl:variable name="countViable859s" select="count($viable859sNS/marc:datafield)" />
|
|
137
|
+
|
|
138
|
+
<!-- Going to want to check if this record is already a 'split' record and, if so, just return it. -->
|
|
139
|
+
<!-- But until then.... -->
|
|
140
|
+
|
|
141
|
+
<xsl:choose>
|
|
142
|
+
<xsl:when test="$count007minusC < 2 and $countViable856s = 0 and $countViable859s = 0 and $countOrig300 = 1">
|
|
143
|
+
<!--
|
|
144
|
+
There is either no 007 or one 007, no 856s, and one 300. Basically let's pass this through.
|
|
145
|
+
In this scenario, even if the 300 indicates additional materials, the assumption is that they
|
|
146
|
+
are all bundled together.
|
|
147
|
+
-->
|
|
148
|
+
<marc:record>
|
|
149
|
+
<marc:leader xml:space="preserve"><xsl:value-of select="marc:leader" /></marc:leader>
|
|
150
|
+
<xsl:apply-templates select="marc:controlfield" />
|
|
151
|
+
<xsl:apply-templates select="marc:datafield" />
|
|
152
|
+
</marc:record>
|
|
153
|
+
</xsl:when>
|
|
154
|
+
<!--<xsl:when test="$count007 < 2 and $countViable856s > 0">
|
|
155
|
+
<!-\-
|
|
156
|
+
There is either no 007 or one 007, and at least one 856. Create one Principal Instance.
|
|
157
|
+
If there is an 007 that is not a 'c', make it part of the Principal Instance. Otherwise, ignore any 007.
|
|
158
|
+
Create mini MARC records - Secondary Instances - from the 856s.
|
|
159
|
+
-\->
|
|
160
|
+
<marc:record>
|
|
161
|
+
<marc:leader xml:space="preserve"><xsl:value-of select="marc:leader" /></marc:leader>
|
|
162
|
+
<xsl:apply-templates select="marc:controlfield[@tag != '007' and substring(., 1, 1) != 'c']" />
|
|
163
|
+
<xsl:apply-templates select="marc:datafield[@tag != '856']" />
|
|
164
|
+
<xsl:apply-templates select="marc:datafield[@tag = '856' and (@ind2='2' or @ind2='3' or @ind2='4') and marc:subfield[@code='u']]" />
|
|
165
|
+
</marc:record>
|
|
166
|
+
|
|
167
|
+
<xsl:for-each select="marc:datafield[
|
|
168
|
+
@tag='856' and
|
|
169
|
+
(@ind2=' ' or @ind2='0' or @ind2='1' or @ind2='8') and
|
|
170
|
+
(
|
|
171
|
+
contains(marc:subfield[@code='u'], 'loc.gov') or
|
|
172
|
+
contains(marc:subfield[@code='u'], 'fdlp.gov') or
|
|
173
|
+
contains(marc:subfield[@code='u'], 'gpo.gov') or
|
|
174
|
+
contains(marc:subfield[@code='u'], 'congress.gov') or
|
|
175
|
+
contains(marc:subfield[@code='u'], 'hathitrust.org') or
|
|
176
|
+
contains(marc:subfield[@code='u'], 'hdl.handle.net')
|
|
177
|
+
) and not( contains(marc:subfield[@code='3'], 'able of contents') )
|
|
178
|
+
]">
|
|
179
|
+
<xsl:apply-templates select="." mode="split">
|
|
180
|
+
<xsl:with-param name="base_recordid" select="$recordid" />
|
|
181
|
+
<xsl:with-param name="pos" select="position()" />
|
|
182
|
+
</xsl:apply-templates>
|
|
183
|
+
</xsl:for-each>
|
|
184
|
+
|
|
185
|
+
</xsl:when>-->
|
|
186
|
+
<xsl:otherwise>
|
|
187
|
+
<!--
|
|
188
|
+
There are two or more 007s and an unknown number of 856s.
|
|
189
|
+
Create a Principal Instance and use the first 007 (if any).
|
|
190
|
+
Associate the first 300 with the Principal Instance.
|
|
191
|
+
-->
|
|
192
|
+
<marc:record>
|
|
193
|
+
<marc:leader xml:space="preserve"><xsl:value-of select="marc:leader" /></marc:leader>
|
|
194
|
+
<marc:controlfield xml:space="preserve" tag="001"><xsl:value-of select="marc:controlfield[@tag = '001']" /></marc:controlfield>
|
|
195
|
+
<!-- <xsl:for-each select="marc:controlfield[@tag != preceding-sibling::marc:controlfield[1]/@tag and substring(.,1,1) != 'c']"> -->
|
|
196
|
+
<xsl:for-each select="marc:controlfield[@tag='003'][1]|
|
|
197
|
+
marc:controlfield[@tag='005'][1]|
|
|
198
|
+
marc:controlfield[@tag='006'][1]|
|
|
199
|
+
marc:controlfield[@tag='007' and substring(.,1,1) != 'c'][1]|
|
|
200
|
+
marc:controlfield[@tag='008'][1]
|
|
201
|
+
">
|
|
202
|
+
<xsl:sort select="@tag"/>
|
|
203
|
+
<marc:controlfield>
|
|
204
|
+
<xsl:attribute name="xml:space">preserve</xsl:attribute>
|
|
205
|
+
<xsl:attribute name="tag"><xsl:value-of select="@tag"/></xsl:attribute>
|
|
206
|
+
<xsl:value-of select="." />
|
|
207
|
+
</marc:controlfield>
|
|
208
|
+
</xsl:for-each>
|
|
209
|
+
<xsl:for-each select="marc:datafield[@tag < 300]">
|
|
210
|
+
<xsl:sort select="@tag"/>
|
|
211
|
+
<xsl:apply-templates select="." />
|
|
212
|
+
</xsl:for-each>
|
|
213
|
+
<xsl:copy-of select="$groupsNS/marc:groups/marc:group[1]/marc:datafield" />
|
|
214
|
+
<xsl:for-each select="marc:datafield[@tag='336' or @tag='337' or @tag='338' or @tag='344' or @tag='346' or @tag='347' or @tag='348']">
|
|
215
|
+
<xsl:variable name="dfId" select="generate-id(.)" />
|
|
216
|
+
<xsl:if test="not($groupsNS/marc:groups/marc:group/marc:datafield[@id = $dfId])">
|
|
217
|
+
<xsl:apply-templates select="." />
|
|
218
|
+
</xsl:if>
|
|
219
|
+
</xsl:for-each>
|
|
220
|
+
<xsl:if test="not(marc:controlfield[@tag='007' and substring(.,1,1) != 'c'][1]) and not(marc:datafield[@tag='337'])">
|
|
221
|
+
<xsl:apply-templates select="$groupsNS/marc:groups/marc:group[1]/marc:datafield[@tag='300']" mode="add337" />
|
|
222
|
+
</xsl:if>
|
|
223
|
+
<xsl:for-each select="marc:datafield[
|
|
224
|
+
@tag > 300 and
|
|
225
|
+
@tag != '856' and @tag != '859' and
|
|
226
|
+
@tag != '336' and @tag != '337' and @tag != '338' and
|
|
227
|
+
@tag != '344' and @tag != '346' and @tag != '347' and @tag != '348']">
|
|
228
|
+
<xsl:sort select="@tag"/>
|
|
229
|
+
<xsl:apply-templates select="." />
|
|
230
|
+
</xsl:for-each>
|
|
231
|
+
<xsl:apply-templates select="marc:datafield[(@tag = '856' or @tag = '859') and (@ind2='2' or @ind2='3' or @ind2='4') and marc:subfield[@code='u']]" />
|
|
232
|
+
<xsl:apply-templates select="marc:datafield[
|
|
233
|
+
(@tag = '856' or @tag = '859') and
|
|
234
|
+
(@ind2=' ' or @ind2='0' or @ind2='1' or @ind2='8') and
|
|
235
|
+
marc:subfield[@code='u'] and
|
|
236
|
+
(
|
|
237
|
+
contains(marc:subfield[@code='3'], 'able of contents') or
|
|
238
|
+
contains(marc:subfield[@code='a'], 'able of contents')
|
|
239
|
+
)
|
|
240
|
+
]" />
|
|
241
|
+
</marc:record>
|
|
242
|
+
|
|
243
|
+
<!--
|
|
244
|
+
Create Secondary Instances from any 007s, other than the initial one, that do not begin with 'c'.
|
|
245
|
+
The split code will associate any positional 300 with each 007. Second 300 goes with second 007,
|
|
246
|
+
third 300 goes with third 007, etc.
|
|
247
|
+
-->
|
|
248
|
+
<xsl:for-each select="marc:controlfield[@tag='007' and substring(.,1,1) != 'c']">
|
|
249
|
+
<xsl:if test="position() > 1">
|
|
250
|
+
<xsl:apply-templates select="." mode="split">
|
|
251
|
+
<xsl:with-param name="base_recordid" select="$recordid" />
|
|
252
|
+
<xsl:with-param name="pos" select="position()" />
|
|
253
|
+
<xsl:with-param name="groupsNS" select="$groupsNS" />
|
|
254
|
+
</xsl:apply-templates>
|
|
255
|
+
</xsl:if>
|
|
256
|
+
</xsl:for-each>
|
|
257
|
+
|
|
258
|
+
<!--
|
|
259
|
+
If there are any 856s that fit the criteria (electronic resource, electronic version, LC URL, etc.)
|
|
260
|
+
generate Secondary Instances from them.
|
|
261
|
+
This will take any existing 007 in the source MARC that begins with a 'c' and use it for the Secondary Instance
|
|
262
|
+
or it will create a canned one.
|
|
263
|
+
-->
|
|
264
|
+
<xsl:if test="count($viable856sNS/marc:datafield|$viable859sNS/marc:datafield) > 0">
|
|
265
|
+
<xsl:variable name="record" select="." />
|
|
266
|
+
<xsl:for-each select="$viable856sNS/marc:datafield|$viable859sNS/marc:datafield">
|
|
267
|
+
<xsl:apply-templates select="." mode="split">
|
|
268
|
+
<xsl:with-param name="base_recordid" select="$recordid" />
|
|
269
|
+
<xsl:with-param name="pos" select="position()" />
|
|
270
|
+
<xsl:with-param name="record" select="$record" />
|
|
271
|
+
</xsl:apply-templates>
|
|
272
|
+
</xsl:for-each>
|
|
273
|
+
</xsl:if>
|
|
274
|
+
|
|
275
|
+
<xsl:if test="$count300 > 1 and $count300 > $count007minusC">
|
|
276
|
+
<!--
|
|
277
|
+
This 'if' statement establishes that we have more 300s than we do 007s.
|
|
278
|
+
The 'extra' 300s will not be outputted via the logic above and we need to make sure we output them.
|
|
279
|
+
-->
|
|
280
|
+
<xsl:variable name="record" select="." />
|
|
281
|
+
<xsl:for-each select="$groupsNS/marc:groups/marc:group/marc:datafield[@tag='300']">
|
|
282
|
+
<xsl:choose>
|
|
283
|
+
<xsl:when test="$count007minusC > 0 and position() > $count007minusC">
|
|
284
|
+
<!-- There are Cs and extra 300s. -->
|
|
285
|
+
<xsl:apply-templates select="." mode="split">
|
|
286
|
+
<xsl:with-param name="base_recordid" select="$recordid" />
|
|
287
|
+
<xsl:with-param name="pos" select="position()" />
|
|
288
|
+
<xsl:with-param name="record" select="$record" />
|
|
289
|
+
</xsl:apply-templates>
|
|
290
|
+
</xsl:when>
|
|
291
|
+
<xsl:when test="$count007minusC = 0 and position() > 1">
|
|
292
|
+
<!--
|
|
293
|
+
We have multiple 300s but no Cs, basically.
|
|
294
|
+
But the first 300 has been output already, by default.
|
|
295
|
+
-->
|
|
296
|
+
<xsl:apply-templates select="." mode="split">
|
|
297
|
+
<xsl:with-param name="base_recordid" select="$recordid" />
|
|
298
|
+
<xsl:with-param name="pos" select="position()" />
|
|
299
|
+
<xsl:with-param name="record" select="$record" />
|
|
300
|
+
</xsl:apply-templates>
|
|
301
|
+
</xsl:when>
|
|
302
|
+
</xsl:choose>
|
|
303
|
+
</xsl:for-each>
|
|
304
|
+
|
|
305
|
+
</xsl:if>
|
|
306
|
+
</xsl:otherwise>
|
|
307
|
+
</xsl:choose>
|
|
308
|
+
</xsl:template>
|
|
309
|
+
|
|
310
|
+
<xsl:template match="marc:controlfield[@tag = '007']" mode="split">
|
|
311
|
+
<xsl:param name="base_recordid" />
|
|
312
|
+
<xsl:param name="pos" />
|
|
313
|
+
<xsl:param name="groupsNS" />
|
|
314
|
+
<xsl:variable name="cf007-01" select="substring(.,1,1)"/>
|
|
315
|
+
<marc:record>
|
|
316
|
+
<marc:leader xml:space="preserve"><xsl:value-of select="../marc:leader" /></marc:leader>
|
|
317
|
+
<marc:controlfield xml:space="preserve" tag="001"><xsl:value-of select="concat(../marc:controlfield[@tag = '001'], '-0', $pos)" /></marc:controlfield>
|
|
318
|
+
<marc:controlfield xml:space="preserve" tag="005"><xsl:value-of select="../marc:controlfield[@tag = '005']" /></marc:controlfield>
|
|
319
|
+
<marc:controlfield xml:space="preserve" tag="007"><xsl:value-of select="." /></marc:controlfield>
|
|
320
|
+
<marc:controlfield xml:space="preserve" tag="008"><xsl:value-of select="../marc:controlfield[@tag = '008']" /></marc:controlfield>
|
|
321
|
+
<xsl:apply-templates select="../marc:datafield[@tag = '040']" />
|
|
322
|
+
<marc:datafield tag="245" ind1="0" ind2="0">
|
|
323
|
+
<marc:subfield code="a">
|
|
324
|
+
<xsl:call-template name="getTitleStr">
|
|
325
|
+
<xsl:with-param name="df300" select="$groupsNS/marc:groups/marc:group[$pos]/marc:datafield[@tag = '300']" />
|
|
326
|
+
<xsl:with-param name="cf007" select="." />
|
|
327
|
+
</xsl:call-template>
|
|
328
|
+
</marc:subfield>
|
|
329
|
+
</marc:datafield>
|
|
330
|
+
<xsl:if test="$groupsNS/marc:groups/marc:group[$pos]/marc:datafield[@tag = '300']">
|
|
331
|
+
<xsl:for-each select="$groupsNS/marc:groups/marc:group[$pos]/marc:datafield">
|
|
332
|
+
<xsl:variable name="thisID" select="@id"/>
|
|
333
|
+
<xsl:variable name="thisPos" select="position()"/>
|
|
334
|
+
<xsl:variable name="processed" select="$groupsNS/marc:groups/marc:group[$pos]/marc:datafield[@id = $thisID and position() < $thisPos]"/>
|
|
335
|
+
<xsl:if test="not($processed)">
|
|
336
|
+
<xsl:copy-of select="." />
|
|
337
|
+
</xsl:if>
|
|
338
|
+
</xsl:for-each>
|
|
339
|
+
<!-- <xsl:copy-of select="$groupsNS/marc:groups/marc:group[$pos]/marc:datafield[@id != preceding::marc:datafield/@id]" /> -->
|
|
340
|
+
</xsl:if>
|
|
341
|
+
<marc:datafield tag="758" ind1=" " ind2=" ">
|
|
342
|
+
<marc:subfield code="4">http://id.loc.gov/ontologies/bibframe/instanceOf</marc:subfield>
|
|
343
|
+
<marc:subfield code="1"><xsl:value-of select="concat($base_recordid, '#Work')" /></marc:subfield>
|
|
344
|
+
</marc:datafield>
|
|
345
|
+
<marc:datafield tag="958" ind1=" " ind2=" ">
|
|
346
|
+
<marc:subfield code="a">SplitMARC</marc:subfield>
|
|
347
|
+
</marc:datafield>
|
|
348
|
+
</marc:record>
|
|
349
|
+
</xsl:template>
|
|
350
|
+
|
|
351
|
+
<xsl:template match="marc:datafield[@tag = '300']" mode="split">
|
|
352
|
+
<xsl:param name="base_recordid" />
|
|
353
|
+
<xsl:param name="pos" />
|
|
354
|
+
<xsl:param name="record" />
|
|
355
|
+
<xsl:variable name="pos_offset" select="count($record/marc:controlfield[@tag='007' and substring(.,1,1) != 'c']) + count($record/marc:datafield[@tag='856']) + $pos"/>
|
|
356
|
+
<marc:record>
|
|
357
|
+
<marc:leader xml:space="preserve"><xsl:value-of select="$record/marc:leader" /></marc:leader>
|
|
358
|
+
<marc:controlfield xml:space="preserve" tag="001"><xsl:value-of select="concat($record/marc:controlfield[@tag = '001'], '-0', $pos_offset)" /></marc:controlfield>
|
|
359
|
+
<marc:controlfield xml:space="preserve" tag="005"><xsl:value-of select="$record/marc:controlfield[@tag = '005']" /></marc:controlfield>
|
|
360
|
+
<marc:controlfield xml:space="preserve" tag="008"><xsl:value-of select="$record/marc:controlfield[@tag = '008']" /></marc:controlfield>
|
|
361
|
+
<xsl:apply-templates select="$record/marc:datafield[@tag = '040']" />
|
|
362
|
+
<marc:datafield tag="245" ind1="0" ind2="0">
|
|
363
|
+
<marc:subfield code="a">
|
|
364
|
+
<xsl:call-template name="getTitleStr">
|
|
365
|
+
<xsl:with-param name="df300" select="." />
|
|
366
|
+
<xsl:with-param name="cf007" select="''" />
|
|
367
|
+
</xsl:call-template>
|
|
368
|
+
</marc:subfield>
|
|
369
|
+
</marc:datafield>
|
|
370
|
+
<xsl:copy-of select="../marc:datafield" />
|
|
371
|
+
<xsl:if test="not(../marc:datafield[@tag='337'])">
|
|
372
|
+
<xsl:apply-templates select="." mode="add337" />
|
|
373
|
+
</xsl:if>
|
|
374
|
+
<marc:datafield tag="758" ind1=" " ind2=" ">
|
|
375
|
+
<marc:subfield code="4">http://id.loc.gov/ontologies/bibframe/instanceOf</marc:subfield>
|
|
376
|
+
<marc:subfield code="1"><xsl:value-of select="concat($base_recordid, '#Work')" /></marc:subfield>
|
|
377
|
+
</marc:datafield>
|
|
378
|
+
<marc:datafield tag="958" ind1=" " ind2=" ">
|
|
379
|
+
<marc:subfield code="a">SplitMARC</marc:subfield>
|
|
380
|
+
</marc:datafield>
|
|
381
|
+
</marc:record>
|
|
382
|
+
</xsl:template>
|
|
383
|
+
|
|
384
|
+
<xsl:template match="marc:datafield[@tag = '856' or @tag = '859']" mode="split">
|
|
385
|
+
<xsl:param name="base_recordid" />
|
|
386
|
+
<xsl:param name="pos" />
|
|
387
|
+
<xsl:param name="record" />
|
|
388
|
+
<xsl:variable name="pos_offset" select="concat('85X-', $pos)"/>
|
|
389
|
+
<xsl:variable name="cf007">
|
|
390
|
+
<xsl:choose>
|
|
391
|
+
<xsl:when test="$record/marc:controlfield[@tag='007' and substring(.,1,1) = 'c']">
|
|
392
|
+
<marc:controlfield xml:space="preserve" tag="007"><xsl:value-of select="$record/marc:controlfield[@tag='007' and substring(.,1,1) = 'c'][1]" /></marc:controlfield>
|
|
393
|
+
</xsl:when>
|
|
394
|
+
<xsl:otherwise>
|
|
395
|
+
<marc:controlfield xml:space="preserve" tag="007">cr |||||||||||</marc:controlfield>
|
|
396
|
+
</xsl:otherwise>
|
|
397
|
+
</xsl:choose>
|
|
398
|
+
</xsl:variable>
|
|
399
|
+
<marc:record>
|
|
400
|
+
<marc:leader xml:space="preserve"><xsl:value-of select="$record/marc:leader" /></marc:leader>
|
|
401
|
+
<marc:controlfield xml:space="preserve" tag="001"><xsl:value-of select="concat($record/marc:controlfield[@tag = '001'], '-', $pos_offset)" /></marc:controlfield>
|
|
402
|
+
<marc:controlfield xml:space="preserve" tag="005"><xsl:value-of select="$record/marc:controlfield[@tag = '005']" /></marc:controlfield>
|
|
403
|
+
<xsl:copy-of select="$cf007" />
|
|
404
|
+
<marc:controlfield xml:space="preserve" tag="008"><xsl:value-of select="$record/marc:controlfield[@tag = '008']" /></marc:controlfield>
|
|
405
|
+
<xsl:apply-templates select="$record/marc:datafield[@tag = '040']" />
|
|
406
|
+
<marc:datafield tag="245" ind1="0" ind2="0">
|
|
407
|
+
<marc:subfield code="a">
|
|
408
|
+
<xsl:call-template name="getTitleStr">
|
|
409
|
+
<xsl:with-param name="df856sf3"><xsl:value-of select="marc:subfield[@code = '3']" /></xsl:with-param>
|
|
410
|
+
<xsl:with-param name="df300" select="$record/marc:datafield[@tag = 'ei mitään']" />
|
|
411
|
+
<xsl:with-param name="cf007" select="'c'" />
|
|
412
|
+
</xsl:call-template>
|
|
413
|
+
</marc:subfield>
|
|
414
|
+
</marc:datafield>
|
|
415
|
+
<marc:datafield tag="337" ind1=" " ind2=" ">
|
|
416
|
+
<marc:subfield code="a">computer</marc:subfield>
|
|
417
|
+
<marc:subfield code="b">c</marc:subfield>
|
|
418
|
+
<marc:subfield code="2">rdamedia</marc:subfield>
|
|
419
|
+
</marc:datafield>
|
|
420
|
+
<marc:datafield tag="338" ind1=" " ind2=" ">
|
|
421
|
+
<marc:subfield code="a">online resource</marc:subfield>
|
|
422
|
+
<marc:subfield code="b">cr</marc:subfield>
|
|
423
|
+
<marc:subfield code="2">rdacarrier</marc:subfield>
|
|
424
|
+
</marc:datafield>
|
|
425
|
+
<xsl:apply-templates select="." />
|
|
426
|
+
<marc:datafield tag="758" ind1=" " ind2=" ">
|
|
427
|
+
<marc:subfield code="4">http://id.loc.gov/ontologies/bibframe/instanceOf</marc:subfield>
|
|
428
|
+
<marc:subfield code="1"><xsl:value-of select="concat($base_recordid, '#Work')" /></marc:subfield>
|
|
429
|
+
</marc:datafield>
|
|
430
|
+
<marc:datafield tag="958" ind1=" " ind2=" ">
|
|
431
|
+
<marc:subfield code="a">SplitMARC</marc:subfield>
|
|
432
|
+
</marc:datafield>
|
|
433
|
+
</marc:record>
|
|
434
|
+
</xsl:template>
|
|
435
|
+
|
|
436
|
+
<xsl:template match="marc:datafield[@tag='300']" mode="add337">
|
|
437
|
+
<marc:datafield tag="337">
|
|
438
|
+
<xsl:choose>
|
|
439
|
+
<xsl:when test="contains(marc:subfield[@code='3'], 'audio') or
|
|
440
|
+
contains(marc:subfield[@code='3'], 'sound') or
|
|
441
|
+
(marc:subfield[@code='3']='all' and contains(marc:subfield[@code='a'], 'audio')) or
|
|
442
|
+
(marc:subfield[@code='3']='all' and contains(marc:subfield[@code='a'], 'sound'))
|
|
443
|
+
">
|
|
444
|
+
<marc:subfield code='a'>audio</marc:subfield>
|
|
445
|
+
<marc:subfield code='b'>s</marc:subfield>
|
|
446
|
+
</xsl:when>
|
|
447
|
+
<xsl:when test="contains(marc:subfield[@code='3'], 'moving') or
|
|
448
|
+
(marc:subfield[@code='3']='all' and (
|
|
449
|
+
contains(marc:subfield[@code='a'], 'moving') or
|
|
450
|
+
contains(marc:subfield[@code='a'], 'film') or
|
|
451
|
+
contains(marc:subfield[@code='a'], 'DVD') or
|
|
452
|
+
contains(marc:subfield[@code='a'], 'Blu')
|
|
453
|
+
))
|
|
454
|
+
">
|
|
455
|
+
<marc:subfield code='a'>projected</marc:subfield>
|
|
456
|
+
<marc:subfield code='b'>g</marc:subfield>
|
|
457
|
+
</xsl:when>
|
|
458
|
+
<xsl:when test="contains(marc:subfield[@code='3'], 'video') or
|
|
459
|
+
(marc:subfield[@code='3']='all' and contains(marc:subfield[@code='a'], 'video'))">
|
|
460
|
+
<marc:subfield code='a'>video</marc:subfield>
|
|
461
|
+
<marc:subfield code='b'>v</marc:subfield>
|
|
462
|
+
</xsl:when>
|
|
463
|
+
<xsl:otherwise>
|
|
464
|
+
<marc:subfield code='a'>unmediated</marc:subfield>
|
|
465
|
+
<marc:subfield code='b'>n</marc:subfield>
|
|
466
|
+
</xsl:otherwise>
|
|
467
|
+
</xsl:choose>
|
|
468
|
+
</marc:datafield>
|
|
469
|
+
</xsl:template>
|
|
470
|
+
|
|
471
|
+
<xsl:template match="marc:datafield[@tag='300']" mode="groupify">
|
|
472
|
+
<xsl:param name="pLeader06" />
|
|
473
|
+
<xsl:param name="pcountOrig300" />
|
|
474
|
+
<marc:datafield>
|
|
475
|
+
<xsl:attribute name="tag"><xsl:value-of select="@tag"/></xsl:attribute>
|
|
476
|
+
<xsl:attribute name="ind1"><xsl:value-of select="@ind1"/></xsl:attribute>
|
|
477
|
+
<xsl:attribute name="ind2"><xsl:value-of select="@ind2"/></xsl:attribute>
|
|
478
|
+
<xsl:choose>
|
|
479
|
+
<xsl:when test="marc:subfield[@code='3']">
|
|
480
|
+
<xsl:for-each select="marc:subfield[@code='3']">
|
|
481
|
+
<marc:subfield>
|
|
482
|
+
<xsl:attribute name="code">3</xsl:attribute>
|
|
483
|
+
<xsl:value-of select="."/>
|
|
484
|
+
</marc:subfield>
|
|
485
|
+
</xsl:for-each>
|
|
486
|
+
</xsl:when>
|
|
487
|
+
<xsl:otherwise>
|
|
488
|
+
<xsl:call-template name="addSF3">
|
|
489
|
+
<xsl:with-param name="pLeader06" select="$pLeader06" />
|
|
490
|
+
<xsl:with-param name="theA" select="marc:subfield[@code='a'][1]" />
|
|
491
|
+
</xsl:call-template>
|
|
492
|
+
</xsl:otherwise>
|
|
493
|
+
</xsl:choose>
|
|
494
|
+
<xsl:choose>
|
|
495
|
+
<xsl:when test="$pcountOrig300=1">
|
|
496
|
+
<xsl:apply-templates select="marc:subfield[@code != '3' and @code != 'e']" />
|
|
497
|
+
</xsl:when>
|
|
498
|
+
<xsl:otherwise>
|
|
499
|
+
<xsl:apply-templates select="marc:subfield[@code != '3']" />
|
|
500
|
+
</xsl:otherwise>
|
|
501
|
+
</xsl:choose>
|
|
502
|
+
</marc:datafield>
|
|
503
|
+
<xsl:if test="$pcountOrig300=1 and marc:subfield[@code = 'e']">
|
|
504
|
+
<xsl:call-template name="parseE">
|
|
505
|
+
<xsl:with-param name="theE" select="marc:subfield[@code ='e']" />
|
|
506
|
+
</xsl:call-template>
|
|
507
|
+
</xsl:if>
|
|
508
|
+
</xsl:template>
|
|
509
|
+
|
|
510
|
+
<xsl:template name="getTitleStr">
|
|
511
|
+
<xsl:param name="df856sf3" />
|
|
512
|
+
<xsl:param name="df300" />
|
|
513
|
+
<xsl:param name="cf007" />
|
|
514
|
+
<xsl:choose>
|
|
515
|
+
<xsl:when test="$df856sf3 != ''">
|
|
516
|
+
<xsl:value-of select="$df856sf3"/>
|
|
517
|
+
</xsl:when>
|
|
518
|
+
<xsl:when test="$df300/marc:subfield[@code='3'] = 'all'">
|
|
519
|
+
<xsl:variable name="vT">
|
|
520
|
+
<xsl:call-template name="tChopPunct">
|
|
521
|
+
<xsl:with-param name="pString" select="$df300/marc:subfield[@code='a'][1]"/>
|
|
522
|
+
</xsl:call-template>
|
|
523
|
+
</xsl:variable>
|
|
524
|
+
<xsl:value-of select="concat('[', $vT, ']')"/>
|
|
525
|
+
</xsl:when>
|
|
526
|
+
<xsl:when test="$df300/marc:subfield[@code='a'][1] != ''">
|
|
527
|
+
<xsl:variable name="vT">
|
|
528
|
+
<xsl:call-template name="tChopPunct">
|
|
529
|
+
<xsl:with-param name="pString" select="$df300/marc:subfield[@code='a'][1]"/>
|
|
530
|
+
</xsl:call-template>
|
|
531
|
+
</xsl:variable>
|
|
532
|
+
<xsl:value-of select="concat('[', $vT, ']')"/>
|
|
533
|
+
</xsl:when>
|
|
534
|
+
<!-- If there is a 300 with a dollarA, why would we ever want the '3' to appear? -->
|
|
535
|
+
<xsl:when test="$df300/marc:subfield[@code='3'] and $df300/marc:subfield[@code='3'] != 'all'">
|
|
536
|
+
<xsl:value-of select="concat('[', $df300/marc:subfield[@code='3'][1], ']')"/>
|
|
537
|
+
</xsl:when>
|
|
538
|
+
<xsl:when test="$cf007 != ''">
|
|
539
|
+
<xsl:variable name="cf007pos1" select="substring($cf007, 1, 1)"/>
|
|
540
|
+
<xsl:variable name="cf007pos1and2" select="substring($cf007, 1, 2)"/>
|
|
541
|
+
<xsl:choose>
|
|
542
|
+
<xsl:when test="$cf007pos1and2 = 'ad'">[Atlas]</xsl:when>
|
|
543
|
+
<xsl:when test="$cf007pos1and2 = 'ag'">[Graph]</xsl:when>
|
|
544
|
+
<xsl:when test="$cf007pos1and2 = 'aj'">[Map]</xsl:when>
|
|
545
|
+
<xsl:when test="$cf007pos1and2 = 'ak'">[Cartographic material]</xsl:when>
|
|
546
|
+
<xsl:when test="$cf007pos1and2 = 'aq'">[Model (Representation)]</xsl:when>
|
|
547
|
+
<xsl:when test="$cf007pos1and2 = 'ar'">[Remote-sensing image]</xsl:when>
|
|
548
|
+
<xsl:when test="$cf007pos1and2 = 'as'">[Geological cross-section]</xsl:when>
|
|
549
|
+
<xsl:when test="$cf007pos1and2 = 'ay'">[View]</xsl:when>
|
|
550
|
+
<xsl:when test="$cf007pos1and2 = 'da'">[Celestial globe]</xsl:when>
|
|
551
|
+
<xsl:when test="$cf007pos1and2 = 'kc'">[Collage]</xsl:when>
|
|
552
|
+
<xsl:when test="$cf007pos1and2 = 'kd'">[Drawing]</xsl:when>
|
|
553
|
+
<xsl:when test="$cf007pos1and2 = 'ke'">[Painting]</xsl:when>
|
|
554
|
+
<xsl:when test="$cf007pos1and2 = 'kf'">[Photomechanical print]</xsl:when>
|
|
555
|
+
<xsl:when test="$cf007pos1and2 = 'kg'">[Negative (Photograph)]</xsl:when>
|
|
556
|
+
<xsl:when test="$cf007pos1and2 = 'kh'">[Photographic print]</xsl:when>
|
|
557
|
+
<xsl:when test="$cf007pos1and2 = 'ki'">[Picture]</xsl:when>
|
|
558
|
+
<xsl:when test="$cf007pos1and2 = 'kj'">[Print]</xsl:when>
|
|
559
|
+
<xsl:when test="$cf007pos1and2 = 'kk'">[Poster]</xsl:when>
|
|
560
|
+
<xsl:when test="$cf007pos1and2 = 'kl'">[Scientific illustration]</xsl:when>
|
|
561
|
+
<xsl:when test="$cf007pos1and2 = 'kn'">[Wall chart]</xsl:when>
|
|
562
|
+
<xsl:when test="$cf007pos1and2 = 'kp'">[Postcard]</xsl:when>
|
|
563
|
+
<xsl:when test="$cf007pos1and2 = 'kv'">[Photograph]</xsl:when>
|
|
564
|
+
<xsl:when test="$cf007pos1 = 'a'">[Map]</xsl:when>
|
|
565
|
+
<xsl:when test="$cf007pos1 = 'c'">[Electronic resource]</xsl:when>
|
|
566
|
+
<xsl:when test="$cf007pos1 = 'd'">[Globe]</xsl:when>
|
|
567
|
+
<xsl:when test="$cf007pos1 = 'f'">[Tactile resource]</xsl:when>
|
|
568
|
+
<xsl:when test="$cf007pos1 = 'g'">[Project graphic]</xsl:when>
|
|
569
|
+
<xsl:when test="$cf007pos1 = 'h'">[Microform]</xsl:when>
|
|
570
|
+
<xsl:when test="$cf007pos1 = 'k'">[Non-projected graphic]</xsl:when>
|
|
571
|
+
<xsl:when test="$cf007pos1 = 'm'">[Motion picture]</xsl:when>
|
|
572
|
+
<xsl:when test="$cf007pos1 = 'o'">[Kit]</xsl:when>
|
|
573
|
+
<xsl:when test="$cf007pos1 = 'q'">[Notated music]</xsl:when>
|
|
574
|
+
<xsl:when test="$cf007pos1 = 'r'">[Remote sensing image]</xsl:when>
|
|
575
|
+
<xsl:when test="$cf007pos1 = 's'">[Sound recording]</xsl:when>
|
|
576
|
+
<xsl:when test="$cf007pos1 = 't'">[Text]</xsl:when>
|
|
577
|
+
<xsl:when test="$cf007pos1 = 'v'">[Videorecording]</xsl:when>
|
|
578
|
+
<xsl:otherwise>[Unknown]</xsl:otherwise>
|
|
579
|
+
</xsl:choose>
|
|
580
|
+
</xsl:when>
|
|
581
|
+
<xsl:otherwise>[Unknown]</xsl:otherwise>
|
|
582
|
+
</xsl:choose>
|
|
583
|
+
</xsl:template>
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
<xsl:template name="addSF3">
|
|
587
|
+
<xsl:param name="pLeader06" />
|
|
588
|
+
<xsl:param name="theA" />
|
|
589
|
+
<xsl:choose>
|
|
590
|
+
<xsl:when test="contains($theA, 'audio disc')">
|
|
591
|
+
<marc:subfield code='3'>audio disc</marc:subfield>
|
|
592
|
+
<marc:subfield code='3'>CD</marc:subfield>
|
|
593
|
+
<marc:subfield code='3'>spoken word</marc:subfield>
|
|
594
|
+
<marc:subfield code='3'>audio</marc:subfield>
|
|
595
|
+
</xsl:when>
|
|
596
|
+
<xsl:when test="contains($theA, 'sound disc')">
|
|
597
|
+
<marc:subfield code='3'>audio disc</marc:subfield>
|
|
598
|
+
<marc:subfield code='3'>CD</marc:subfield>
|
|
599
|
+
<marc:subfield code='3'>spoken word</marc:subfield>
|
|
600
|
+
<marc:subfield code='3'>audio</marc:subfield>
|
|
601
|
+
</xsl:when>
|
|
602
|
+
<xsl:when test="contains($theA, 'audiocassette')">
|
|
603
|
+
<marc:subfield code='3'>audiocassette</marc:subfield>
|
|
604
|
+
<marc:subfield code='3'>spoken word</marc:subfield>
|
|
605
|
+
<marc:subfield code='3'>audio</marc:subfield>
|
|
606
|
+
</xsl:when>
|
|
607
|
+
<xsl:when test="contains($theA, 'audio file')">
|
|
608
|
+
<marc:subfield code='3'>audio file</marc:subfield>
|
|
609
|
+
<marc:subfield code='3'>audio</marc:subfield>
|
|
610
|
+
<marc:subfield code='3'>spoken word</marc:subfield>
|
|
611
|
+
</xsl:when>
|
|
612
|
+
<xsl:when test="contains($theA, 'sound file')">
|
|
613
|
+
<marc:subfield code='3'>sound file</marc:subfield>
|
|
614
|
+
<marc:subfield code='3'>spoken word</marc:subfield>
|
|
615
|
+
<marc:subfield code='3'>audio</marc:subfield>
|
|
616
|
+
</xsl:when>
|
|
617
|
+
<xsl:when test="contains($theA, 'video file')">
|
|
618
|
+
<marc:subfield code='3'>video file</marc:subfield>
|
|
619
|
+
<marc:subfield code='3'>video</marc:subfield>
|
|
620
|
+
<marc:subfield code='3'>two-dimensional moving image</marc:subfield>
|
|
621
|
+
</xsl:when>
|
|
622
|
+
<xsl:when test="contains($theA, 'videodisc')">
|
|
623
|
+
<marc:subfield code='3'>videodisc</marc:subfield>
|
|
624
|
+
<marc:subfield code='3'>DVD</marc:subfield>
|
|
625
|
+
<marc:subfield code='3'>BluRay</marc:subfield>
|
|
626
|
+
<marc:subfield code='3'>Blu-ray disc</marc:subfield>
|
|
627
|
+
<marc:subfield code='3'>moving image</marc:subfield>
|
|
628
|
+
<marc:subfield code='3'>video</marc:subfield>
|
|
629
|
+
<marc:subfield code='3'>two-dimensional moving image</marc:subfield>
|
|
630
|
+
<marc:subfield code='3'>laser optical</marc:subfield>
|
|
631
|
+
</xsl:when>
|
|
632
|
+
<xsl:when test="contains($theA, 'DVD video')">
|
|
633
|
+
<marc:subfield code='3'>videodisc</marc:subfield>
|
|
634
|
+
<marc:subfield code='3'>DVD</marc:subfield>
|
|
635
|
+
<marc:subfield code='3'>moving image</marc:subfield>
|
|
636
|
+
<marc:subfield code='3'>two-dimensional moving image</marc:subfield>
|
|
637
|
+
<marc:subfield code='3'>video</marc:subfield>
|
|
638
|
+
<marc:subfield code='3'>laser optical</marc:subfield>
|
|
639
|
+
</xsl:when>
|
|
640
|
+
<xsl:when test="$pLeader06 = 'g' and contains($theA, 'reel')">
|
|
641
|
+
<marc:subfield code='3'>film reel</marc:subfield>
|
|
642
|
+
<marc:subfield code='3'>projected</marc:subfield>
|
|
643
|
+
<marc:subfield code='3'>two-dimensional moving image</marc:subfield>
|
|
644
|
+
</xsl:when>
|
|
645
|
+
<xsl:when test="contains($theA, 'book')">
|
|
646
|
+
<marc:subfield code='3'>book</marc:subfield>
|
|
647
|
+
</xsl:when>
|
|
648
|
+
<xsl:when test="contains($theA, 'manuscript')">
|
|
649
|
+
<marc:subfield code='3'>manuscript</marc:subfield>
|
|
650
|
+
</xsl:when>
|
|
651
|
+
<xsl:when test="contains($theA, 'score')">
|
|
652
|
+
<marc:subfield code='3'>score</marc:subfield>
|
|
653
|
+
</xsl:when>
|
|
654
|
+
<xsl:when test="contains($theA, 'folio')">
|
|
655
|
+
<marc:subfield code='3'>folio</marc:subfield>
|
|
656
|
+
</xsl:when>
|
|
657
|
+
<xsl:when test="contains($theA, 'lesson guide')">
|
|
658
|
+
<marc:subfield code='3'>lesson guide</marc:subfield>
|
|
659
|
+
</xsl:when>
|
|
660
|
+
<xsl:otherwise>
|
|
661
|
+
<marc:subfield code='3'>all</marc:subfield>
|
|
662
|
+
</xsl:otherwise>
|
|
663
|
+
</xsl:choose>
|
|
664
|
+
</xsl:template>
|
|
665
|
+
|
|
666
|
+
<xsl:template name="parseE">
|
|
667
|
+
<xsl:param name="theE"/>
|
|
668
|
+
<xsl:choose>
|
|
669
|
+
<xsl:when test="contains($theE, '+')">
|
|
670
|
+
<xsl:call-template name="create300">
|
|
671
|
+
<xsl:with-param name="theE" select="$theE" />
|
|
672
|
+
</xsl:call-template>
|
|
673
|
+
<!-- recursive call -->
|
|
674
|
+
<xsl:call-template name="parseE">
|
|
675
|
+
<xsl:with-param name="theE" select="substring-after($theE, '+')"/>
|
|
676
|
+
</xsl:call-template>
|
|
677
|
+
</xsl:when>
|
|
678
|
+
<xsl:otherwise>
|
|
679
|
+
<xsl:call-template name="create300">
|
|
680
|
+
<xsl:with-param name="theE" select="$theE" />
|
|
681
|
+
</xsl:call-template>
|
|
682
|
+
</xsl:otherwise>
|
|
683
|
+
</xsl:choose>
|
|
684
|
+
</xsl:template>
|
|
685
|
+
|
|
686
|
+
<xsl:template name="create300">
|
|
687
|
+
<xsl:param name="theE" />
|
|
688
|
+
<xsl:variable name="eSlice">
|
|
689
|
+
<xsl:choose>
|
|
690
|
+
<xsl:when test="contains($theE, '+')">
|
|
691
|
+
<xsl:value-of select="substring-before($theE, '+')"/>
|
|
692
|
+
</xsl:when>
|
|
693
|
+
<xsl:otherwise>
|
|
694
|
+
<xsl:value-of select="$theE"/>
|
|
695
|
+
</xsl:otherwise>
|
|
696
|
+
</xsl:choose>
|
|
697
|
+
</xsl:variable>
|
|
698
|
+
<xsl:variable name="aTxt">
|
|
699
|
+
<xsl:choose>
|
|
700
|
+
<xsl:when test="contains($eSlice, ':')">
|
|
701
|
+
<xsl:value-of select="concat(substring-before($eSlice, ':'), ')')"/>
|
|
702
|
+
</xsl:when>
|
|
703
|
+
<xsl:otherwise>
|
|
704
|
+
<xsl:value-of select="$eSlice"/>
|
|
705
|
+
</xsl:otherwise>
|
|
706
|
+
</xsl:choose>
|
|
707
|
+
</xsl:variable>
|
|
708
|
+
<xsl:variable name="bTxt">
|
|
709
|
+
<xsl:choose>
|
|
710
|
+
<xsl:when test="contains($eSlice, ':')">
|
|
711
|
+
<xsl:value-of select="substring-before(substring-after($eSlice, ':'), ';')"/>
|
|
712
|
+
</xsl:when>
|
|
713
|
+
<xsl:when test="contains($eSlice, '(')">
|
|
714
|
+
<xsl:value-of select="substring-before(substring-after($eSlice, '('), ';')"/>
|
|
715
|
+
</xsl:when>
|
|
716
|
+
</xsl:choose>
|
|
717
|
+
</xsl:variable>
|
|
718
|
+
<xsl:variable name="cTxt" select="substring-after($eSlice, ';')"/>
|
|
719
|
+
<xsl:variable name="sf3">
|
|
720
|
+
<xsl:call-template name="addSF3">
|
|
721
|
+
<xsl:with-param name="theA" select="$aTxt" />
|
|
722
|
+
</xsl:call-template>
|
|
723
|
+
</xsl:variable>
|
|
724
|
+
<marc:datafield tag="300" ind1=" " ind2=" ">
|
|
725
|
+
<xsl:copy-of select="$sf3" />
|
|
726
|
+
<xsl:if test="$aTxt != ''">
|
|
727
|
+
<marc:subfield code='a'><xsl:value-of select="$aTxt"/></marc:subfield>
|
|
728
|
+
</xsl:if>
|
|
729
|
+
<xsl:if test="$bTxt != ''">
|
|
730
|
+
<marc:subfield code='b'><xsl:value-of select="$bTxt"/></marc:subfield>
|
|
731
|
+
</xsl:if>
|
|
732
|
+
<xsl:if test="$cTxt != ''">
|
|
733
|
+
<marc:subfield code='c'><xsl:value-of select="$cTxt"/></marc:subfield>
|
|
734
|
+
</xsl:if>
|
|
735
|
+
</marc:datafield>
|
|
736
|
+
</xsl:template>
|
|
737
|
+
|
|
738
|
+
<xsl:template match="marc:controlfield">
|
|
739
|
+
<marc:controlfield>
|
|
740
|
+
<xsl:attribute name="tag"><xsl:value-of select="@tag"/></xsl:attribute>
|
|
741
|
+
<xsl:attribute name="xml:space">preserve</xsl:attribute>
|
|
742
|
+
<xsl:value-of select="."/>
|
|
743
|
+
</marc:controlfield>
|
|
744
|
+
</xsl:template>
|
|
745
|
+
|
|
746
|
+
<xsl:template match="marc:datafield">
|
|
747
|
+
<xsl:param name="genId">0</xsl:param>
|
|
748
|
+
<marc:datafield>
|
|
749
|
+
<xsl:attribute name="tag"><xsl:value-of select="@tag"/></xsl:attribute>
|
|
750
|
+
<xsl:attribute name="ind1"><xsl:value-of select="@ind1"/></xsl:attribute>
|
|
751
|
+
<xsl:attribute name="ind2"><xsl:value-of select="@ind2"/></xsl:attribute>
|
|
752
|
+
<xsl:if test="$genId='1'">
|
|
753
|
+
<xsl:attribute name="id"><xsl:value-of select="generate-id(.)"/></xsl:attribute>
|
|
754
|
+
</xsl:if>
|
|
755
|
+
<xsl:apply-templates select="marc:subfield" />
|
|
756
|
+
</marc:datafield>
|
|
757
|
+
</xsl:template>
|
|
758
|
+
|
|
759
|
+
<xsl:template match="marc:subfield">
|
|
760
|
+
<marc:subfield>
|
|
761
|
+
<xsl:attribute name="code"><xsl:value-of select="@code"/></xsl:attribute>
|
|
762
|
+
<xsl:value-of select="."/>
|
|
763
|
+
</marc:subfield>
|
|
764
|
+
</xsl:template>
|
|
765
|
+
</xsl:stylesheet>
|