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,1141 @@
|
|
|
1
|
+
<?xml version='1.0'?>
|
|
2
|
+
<xsl:stylesheet version="1.0"
|
|
3
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
4
|
+
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
|
|
5
|
+
xmlns:marc="http://www.loc.gov/MARC21/slim"
|
|
6
|
+
xmlns:bf="http://id.loc.gov/ontologies/bibframe/"
|
|
7
|
+
xmlns:bflc="http://id.loc.gov/ontologies/bflc/"
|
|
8
|
+
xmlns:madsrdf="http://www.loc.gov/mads/rdf/v1#"
|
|
9
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
10
|
+
exclude-result-prefixes="xsl marc">
|
|
11
|
+
|
|
12
|
+
<!--
|
|
13
|
+
Conversion specs for names from 1XX, 7XX, and 8XX fields
|
|
14
|
+
-->
|
|
15
|
+
|
|
16
|
+
<!-- bf:Work properties from name fields -->
|
|
17
|
+
<xsl:template match="marc:datafield[@tag='100' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='100')] |
|
|
18
|
+
marc:datafield[@tag='110' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='110')] |
|
|
19
|
+
marc:datafield[@tag='111' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='100')]"
|
|
20
|
+
mode="work">
|
|
21
|
+
<xsl:param name="recordid"/>
|
|
22
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
23
|
+
<xsl:param name="pPosition" select="position()"/>
|
|
24
|
+
<xsl:param name="pAgentIri"/>
|
|
25
|
+
<xsl:variable name="agentiri">
|
|
26
|
+
<xsl:choose>
|
|
27
|
+
<xsl:when test="$pAgentIri != ''"><xsl:value-of select="$pAgentIri"/></xsl:when>
|
|
28
|
+
<xsl:when test="marc:subfield[@code='1']">
|
|
29
|
+
<xsl:apply-templates mode="generateUriFrom1" select=".">
|
|
30
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Agent<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
31
|
+
<xsl:with-param name="pEntity">bf:Agent</xsl:with-param>
|
|
32
|
+
</xsl:apply-templates>
|
|
33
|
+
</xsl:when>
|
|
34
|
+
<xsl:when test="marc:subfield[@code='0'][contains(text(),'id.loc.gov/authorities/names/')]">
|
|
35
|
+
<xsl:apply-templates mode="generateUriFrom1" select=".">
|
|
36
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Agent<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
37
|
+
<xsl:with-param name="pEntity">bf:Agent</xsl:with-param>
|
|
38
|
+
</xsl:apply-templates>
|
|
39
|
+
</xsl:when>
|
|
40
|
+
<xsl:otherwise>
|
|
41
|
+
<xsl:apply-templates mode="generateUriFrom0" select=".">
|
|
42
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Agent<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
43
|
+
<xsl:with-param name="pEntity">bf:Agent</xsl:with-param>
|
|
44
|
+
</xsl:apply-templates>
|
|
45
|
+
</xsl:otherwise>
|
|
46
|
+
</xsl:choose>
|
|
47
|
+
</xsl:variable>
|
|
48
|
+
<xsl:apply-templates mode="workName" select=".">
|
|
49
|
+
<xsl:with-param name="agentiri" select="$agentiri"/>
|
|
50
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
51
|
+
</xsl:apply-templates>
|
|
52
|
+
<xsl:if test="marc:subfield[@code='k'] and not(../marc:datafield[@tag='240'])">
|
|
53
|
+
<xsl:variable name="vHubIri">
|
|
54
|
+
<xsl:apply-templates mode="generateUri" select=".">
|
|
55
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Hub<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
56
|
+
<xsl:with-param name="pEntity">bf:Hub</xsl:with-param>
|
|
57
|
+
</xsl:apply-templates>
|
|
58
|
+
</xsl:variable>
|
|
59
|
+
<bf:expressionOf>
|
|
60
|
+
<bf:Hub>
|
|
61
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="$vHubIri"/></xsl:attribute>
|
|
62
|
+
<xsl:apply-templates mode="workName" select=".">
|
|
63
|
+
<xsl:with-param name="agentiri" select="$agentiri"/>
|
|
64
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
65
|
+
</xsl:apply-templates>
|
|
66
|
+
<xsl:apply-templates mode="hubUnifTitle" select=".">
|
|
67
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
68
|
+
<xsl:with-param name="pHubIri" select="$vHubIri"/>
|
|
69
|
+
</xsl:apply-templates>
|
|
70
|
+
</bf:Hub>
|
|
71
|
+
</bf:expressionOf>
|
|
72
|
+
</xsl:if>
|
|
73
|
+
</xsl:template>
|
|
74
|
+
|
|
75
|
+
<xsl:template match="marc:datafield[@tag='700' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='700')] |
|
|
76
|
+
marc:datafield[@tag='710' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='710')] |
|
|
77
|
+
marc:datafield[@tag='711' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='711')] |
|
|
78
|
+
marc:datafield[@tag='720' or (@tag='880' and substring(marc:subfield[@code='6'],1,3)='720')]"
|
|
79
|
+
mode="work">
|
|
80
|
+
<xsl:param name="recordid"/>
|
|
81
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
82
|
+
<xsl:param name="pPosition" select="position()"/>
|
|
83
|
+
<xsl:param name="pHasItem" select="false()"/>
|
|
84
|
+
<!-- note special $5 processing for LoC below -->
|
|
85
|
+
<xsl:if test="$pHasItem or not($localfields and marc:subfield[@code='5'])">
|
|
86
|
+
<xsl:variable name="agentiri">
|
|
87
|
+
<xsl:choose>
|
|
88
|
+
<xsl:when test="not(marc:subfield[@code='t']) and marc:subfield[@code='1']">
|
|
89
|
+
<xsl:apply-templates mode="generateUriFrom1" select=".">
|
|
90
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Agent<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
91
|
+
<xsl:with-param name="pEntity">bf:Agent</xsl:with-param>
|
|
92
|
+
</xsl:apply-templates>
|
|
93
|
+
</xsl:when>
|
|
94
|
+
<xsl:when test="not(marc:subfield[@code='t']) and marc:subfield[@code='0'][contains(text(),'id.loc.gov/authorities/names/')]">
|
|
95
|
+
<xsl:apply-templates mode="generateUriFrom1" select=".">
|
|
96
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Agent<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
97
|
+
<xsl:with-param name="pEntity">bf:Agent</xsl:with-param>
|
|
98
|
+
</xsl:apply-templates>
|
|
99
|
+
</xsl:when>
|
|
100
|
+
<xsl:otherwise>
|
|
101
|
+
<xsl:apply-templates mode="generateUriFrom0" select=".">
|
|
102
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Agent<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
103
|
+
<xsl:with-param name="pEntity">bf:Agent</xsl:with-param>
|
|
104
|
+
</xsl:apply-templates>
|
|
105
|
+
</xsl:otherwise>
|
|
106
|
+
</xsl:choose>
|
|
107
|
+
</xsl:variable>
|
|
108
|
+
<xsl:variable name="vHubIri">
|
|
109
|
+
<xsl:choose>
|
|
110
|
+
<xsl:when test="marc:subfield[@code='1']">
|
|
111
|
+
<xsl:apply-templates mode="generateUriFrom1" select=".">
|
|
112
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Hub<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
113
|
+
<xsl:with-param name="pEntity">bf:Hub</xsl:with-param>
|
|
114
|
+
</xsl:apply-templates>
|
|
115
|
+
</xsl:when>
|
|
116
|
+
<xsl:otherwise>
|
|
117
|
+
<xsl:apply-templates mode="generateUri" select=".">
|
|
118
|
+
<xsl:with-param name="pDefaultUri"><xsl:value-of select="$recordid"/>#Hub<xsl:value-of select="@tag"/>-<xsl:value-of select="$pPosition"/></xsl:with-param>
|
|
119
|
+
<xsl:with-param name="pEntity">bf:Hub</xsl:with-param>
|
|
120
|
+
</xsl:apply-templates>
|
|
121
|
+
</xsl:otherwise>
|
|
122
|
+
</xsl:choose>
|
|
123
|
+
</xsl:variable>
|
|
124
|
+
<xsl:apply-templates mode="work7XX" select=".">
|
|
125
|
+
<xsl:with-param name="agentiri" select="$agentiri"/>
|
|
126
|
+
<xsl:with-param name="pHubIri" select="$vHubIri"/>
|
|
127
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
128
|
+
</xsl:apply-templates>
|
|
129
|
+
</xsl:if>
|
|
130
|
+
</xsl:template>
|
|
131
|
+
|
|
132
|
+
<xsl:template match="marc:datafield" mode="work7XX">
|
|
133
|
+
<xsl:param name="agentiri"/>
|
|
134
|
+
<xsl:param name="pHubIri"/>
|
|
135
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
136
|
+
<xsl:variable name="vXmlLang"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
137
|
+
<xsl:choose>
|
|
138
|
+
<xsl:when test="marc:subfield[@code='t']">
|
|
139
|
+
<xsl:variable name="vProp">
|
|
140
|
+
<xsl:choose>
|
|
141
|
+
<xsl:when test="@ind2='2'">http://id.loc.gov/vocabulary/relationship/part</xsl:when>
|
|
142
|
+
<xsl:when test="@ind2='4' and count(marc:subfield[@code='i'])=0">http://id.loc.gov/ontologies/bflc/hasVariantEntry</xsl:when>
|
|
143
|
+
<xsl:when test="@ind2=' ' and marc:subfield[@code='i']='is arrangement of'">http://id.loc.gov/vocabulary/relationship/arrangementof</xsl:when>
|
|
144
|
+
<xsl:when test="@ind2=' ' and marc:subfield[@code='i']='is translation of'">http://id.loc.gov/vocabulary/relationship/translationof</xsl:when>
|
|
145
|
+
<xsl:otherwise>http://id.loc.gov/vocabulary/relationship/relatedwork</xsl:otherwise>
|
|
146
|
+
</xsl:choose>
|
|
147
|
+
</xsl:variable>
|
|
148
|
+
<xsl:choose>
|
|
149
|
+
<xsl:when test="$serialization = 'rdfxml'">
|
|
150
|
+
<bf:relation>
|
|
151
|
+
<bf:Relation>
|
|
152
|
+
<bf:relationship>
|
|
153
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="$vProp"/></xsl:attribute>
|
|
154
|
+
</bf:relationship>
|
|
155
|
+
<xsl:for-each select="marc:subfield[@code='i' and .!='is arrangement of' and .!='is translation of']">
|
|
156
|
+
<xsl:if test="
|
|
157
|
+
( $vProp='http://id.loc.gov/vocabulary/relationship/part' and not(contains(., 'ontain')) )
|
|
158
|
+
or
|
|
159
|
+
( $vProp='http://id.loc.gov/vocabulary/relationship/relatedwork' )
|
|
160
|
+
">
|
|
161
|
+
<bf:relationship>
|
|
162
|
+
<bf:Relationship>
|
|
163
|
+
<rdfs:label>
|
|
164
|
+
<xsl:if test="$vXmlLang != ''">
|
|
165
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
166
|
+
</xsl:if>
|
|
167
|
+
<xsl:call-template name="tChopPunct">
|
|
168
|
+
<xsl:with-param name="pString" select="."/>
|
|
169
|
+
</xsl:call-template>
|
|
170
|
+
</rdfs:label>
|
|
171
|
+
</bf:Relationship>
|
|
172
|
+
</bf:relationship>
|
|
173
|
+
</xsl:if>
|
|
174
|
+
</xsl:for-each>
|
|
175
|
+
<bf:associatedResource>
|
|
176
|
+
<bf:Hub>
|
|
177
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="$pHubIri"/></xsl:attribute>
|
|
178
|
+
<xsl:apply-templates mode="workName" select=".">
|
|
179
|
+
<xsl:with-param name="agentiri" select="$agentiri"/>
|
|
180
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
181
|
+
</xsl:apply-templates>
|
|
182
|
+
</bf:Hub>
|
|
183
|
+
</bf:associatedResource>
|
|
184
|
+
</bf:Relation>
|
|
185
|
+
</bf:relation>
|
|
186
|
+
</xsl:when>
|
|
187
|
+
</xsl:choose>
|
|
188
|
+
</xsl:when>
|
|
189
|
+
<xsl:otherwise>
|
|
190
|
+
<xsl:apply-templates mode="workName" select=".">
|
|
191
|
+
<xsl:with-param name="agentiri" select="$agentiri"/>
|
|
192
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
193
|
+
</xsl:apply-templates>
|
|
194
|
+
<!--
|
|
195
|
+
<xsl:for-each select="marc:subfield[@code='i']">
|
|
196
|
+
<bf:relation>
|
|
197
|
+
<bf:Relation>
|
|
198
|
+
<bf:relationship>
|
|
199
|
+
<bf:Relationship>
|
|
200
|
+
<rdfs:label>
|
|
201
|
+
<xsl:if test="$vXmlLang != ''">
|
|
202
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
203
|
+
</xsl:if>
|
|
204
|
+
<xsl:call-template name="tChopPunct">
|
|
205
|
+
<xsl:with-param name="pString" select="."/>
|
|
206
|
+
</xsl:call-template>
|
|
207
|
+
</rdfs:label>
|
|
208
|
+
</bf:Relationship>
|
|
209
|
+
</bf:relationship>
|
|
210
|
+
<bf:relatedTo><xsl:value-of select="$agentiri"/></bf:relatedTo>
|
|
211
|
+
</bf:Relation>
|
|
212
|
+
</bf:relation>
|
|
213
|
+
</xsl:for-each>
|
|
214
|
+
-->
|
|
215
|
+
</xsl:otherwise>
|
|
216
|
+
</xsl:choose>
|
|
217
|
+
</xsl:template>
|
|
218
|
+
|
|
219
|
+
<!-- Processing for 8XX tags in ConvSpec-Process6-Series.xsl -->
|
|
220
|
+
|
|
221
|
+
<xsl:template match="marc:datafield" mode="workName">
|
|
222
|
+
<xsl:param name="agentiri"/>
|
|
223
|
+
<xsl:param name="recordid"/>
|
|
224
|
+
<xsl:param name="serialization"/>
|
|
225
|
+
<xsl:param name="pSource"/>
|
|
226
|
+
<xsl:variable name="tag">
|
|
227
|
+
<xsl:choose>
|
|
228
|
+
<xsl:when test="@tag=880">
|
|
229
|
+
<xsl:value-of select="substring(marc:subfield[@code='6'],1,3)"/>
|
|
230
|
+
</xsl:when>
|
|
231
|
+
<xsl:otherwise>
|
|
232
|
+
<xsl:value-of select="@tag"/>
|
|
233
|
+
</xsl:otherwise>
|
|
234
|
+
</xsl:choose>
|
|
235
|
+
</xsl:variable>
|
|
236
|
+
<xsl:variable name="rolesFromSubfields">
|
|
237
|
+
<xsl:choose>
|
|
238
|
+
<!-- Look for a $4. If found, this is the one we prefer. These are codes or URIs. -->
|
|
239
|
+
<xsl:when test="marc:subfield[@code='4'] and not(contains(marc:subfield[@code='4'], 'rdaregistry.info'))">
|
|
240
|
+
<xsl:apply-templates select="." mode="contributionRoleCode">
|
|
241
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
242
|
+
</xsl:apply-templates>
|
|
243
|
+
</xsl:when>
|
|
244
|
+
<!--
|
|
245
|
+
Otherwise, if it is a Meeting or Conference name, look for a $j.
|
|
246
|
+
But if not a Meeting or Conference name, assume $e.
|
|
247
|
+
These are labels.
|
|
248
|
+
-->
|
|
249
|
+
<xsl:otherwise>
|
|
250
|
+
<xsl:choose>
|
|
251
|
+
<xsl:when test="substring($tag,2,2)='11'">
|
|
252
|
+
<xsl:apply-templates select="marc:subfield[@code='j']" mode="contributionRole">
|
|
253
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
254
|
+
</xsl:apply-templates>
|
|
255
|
+
</xsl:when>
|
|
256
|
+
<xsl:otherwise>
|
|
257
|
+
<xsl:apply-templates select="marc:subfield[@code='e']" mode="contributionRole">
|
|
258
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
259
|
+
</xsl:apply-templates>
|
|
260
|
+
</xsl:otherwise>
|
|
261
|
+
</xsl:choose>
|
|
262
|
+
</xsl:otherwise>
|
|
263
|
+
</xsl:choose>
|
|
264
|
+
</xsl:variable>
|
|
265
|
+
<xsl:choose>
|
|
266
|
+
<xsl:when test="$serialization='rdfxml'">
|
|
267
|
+
<bf:contribution>
|
|
268
|
+
<bf:Contribution>
|
|
269
|
+
<xsl:if test="substring($tag,1,1) = '1'">
|
|
270
|
+
<rdf:type>
|
|
271
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="concat($bf,'PrimaryContribution')"/></xsl:attribute>
|
|
272
|
+
</rdf:type>
|
|
273
|
+
</xsl:if>
|
|
274
|
+
<bf:agent>
|
|
275
|
+
<xsl:apply-templates mode="agent" select=".">
|
|
276
|
+
<xsl:with-param name="agentiri" select="$agentiri"/>
|
|
277
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
278
|
+
<xsl:with-param name="pSource" select="$pSource"/>
|
|
279
|
+
</xsl:apply-templates>
|
|
280
|
+
</bf:agent>
|
|
281
|
+
<xsl:choose>
|
|
282
|
+
<xsl:when test="substring($tag,1,1)='6'">
|
|
283
|
+
<bf:role>
|
|
284
|
+
<bf:Role>
|
|
285
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="concat($relators,'ctb')"/></xsl:attribute>
|
|
286
|
+
</bf:Role>
|
|
287
|
+
</bf:role>
|
|
288
|
+
</xsl:when>
|
|
289
|
+
<xsl:otherwise>
|
|
290
|
+
<xsl:choose>
|
|
291
|
+
<xsl:when test="(substring($tag,3,1) = '0' and marc:subfield[@code='e']) or
|
|
292
|
+
(substring($tag,3,1) = '1' and marc:subfield[@code='j']) or
|
|
293
|
+
marc:subfield[@code='4']">
|
|
294
|
+
<xsl:copy-of select="$rolesFromSubfields"/>
|
|
295
|
+
</xsl:when>
|
|
296
|
+
<xsl:when test="substring($tag,1,1) = '1' and
|
|
297
|
+
(
|
|
298
|
+
substring(ancestor::marc:record/marc:leader, 7 ,2) = 'am' or
|
|
299
|
+
substring(ancestor::marc:record/marc:leader, 7 ,2) = 'aa'
|
|
300
|
+
)">
|
|
301
|
+
<bf:role>
|
|
302
|
+
<bf:Role>
|
|
303
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="concat($relators,'aut')"/></xsl:attribute>
|
|
304
|
+
</bf:Role>
|
|
305
|
+
</bf:role>
|
|
306
|
+
</xsl:when>
|
|
307
|
+
<xsl:otherwise>
|
|
308
|
+
<bf:role>
|
|
309
|
+
<bf:Role>
|
|
310
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="concat($relators,'ctb')"/></xsl:attribute>
|
|
311
|
+
</bf:Role>
|
|
312
|
+
</bf:role>
|
|
313
|
+
</xsl:otherwise>
|
|
314
|
+
</xsl:choose>
|
|
315
|
+
</xsl:otherwise>
|
|
316
|
+
</xsl:choose>
|
|
317
|
+
<xsl:apply-templates mode="subfield5" select="marc:subfield[@code='5']">
|
|
318
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
319
|
+
</xsl:apply-templates>
|
|
320
|
+
</bf:Contribution>
|
|
321
|
+
</bf:contribution>
|
|
322
|
+
</xsl:when>
|
|
323
|
+
</xsl:choose>
|
|
324
|
+
<xsl:if test="marc:subfield[@code='t']">
|
|
325
|
+
<xsl:choose>
|
|
326
|
+
<xsl:when test="substring($tag,1,1) = '1'">
|
|
327
|
+
<bf:expressionOf>
|
|
328
|
+
<bf:Hub>
|
|
329
|
+
<xsl:attribute name="rdf:about">
|
|
330
|
+
<xsl:value-of select="concat(substring-before($agentiri,'#Agent'),'#Hub',substring-after($agentiri,'#Agent'))"/>
|
|
331
|
+
</xsl:attribute>
|
|
332
|
+
<xsl:apply-templates mode="hubUnifTitle" select=".">
|
|
333
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
334
|
+
<xsl:with-param name="pSource" select="$pSource"/>
|
|
335
|
+
<!-- <xsl:with-param name="pLabel" select="marc:subfield[@code='t']"/> -->
|
|
336
|
+
</xsl:apply-templates>
|
|
337
|
+
</bf:Hub>
|
|
338
|
+
</bf:expressionOf>
|
|
339
|
+
</xsl:when>
|
|
340
|
+
<xsl:otherwise>
|
|
341
|
+
<xsl:apply-templates mode="hubUnifTitle" select=".">
|
|
342
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
343
|
+
<xsl:with-param name="pSource" select="$pSource"/>
|
|
344
|
+
<!--<xsl:with-param name="pLabel" select="marc:subfield[@code='t']"/>-->
|
|
345
|
+
</xsl:apply-templates>
|
|
346
|
+
</xsl:otherwise>
|
|
347
|
+
</xsl:choose>
|
|
348
|
+
</xsl:if>
|
|
349
|
+
</xsl:template>
|
|
350
|
+
|
|
351
|
+
<!-- build bf:role properties from $4 -->
|
|
352
|
+
<xsl:template match="marc:datafield" mode="contributionRoleCode">
|
|
353
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
354
|
+
<xsl:for-each select="marc:subfield[@code='4']">
|
|
355
|
+
<xsl:variable name="vThis4" select="." />
|
|
356
|
+
<xsl:variable name="vRoleUri">
|
|
357
|
+
<xsl:choose>
|
|
358
|
+
<xsl:when test="string-length(.) = 3">
|
|
359
|
+
<xsl:variable name="encoded">
|
|
360
|
+
<xsl:call-template name="url-encode">
|
|
361
|
+
<xsl:with-param name="str" select="."/>
|
|
362
|
+
</xsl:call-template>
|
|
363
|
+
</xsl:variable>
|
|
364
|
+
<xsl:value-of select="concat($relators,$encoded)"/>
|
|
365
|
+
</xsl:when>
|
|
366
|
+
<xsl:when test="contains(.,'://')">
|
|
367
|
+
<xsl:value-of select="."/>
|
|
368
|
+
</xsl:when>
|
|
369
|
+
</xsl:choose>
|
|
370
|
+
</xsl:variable>
|
|
371
|
+
<xsl:choose>
|
|
372
|
+
<xsl:when test="
|
|
373
|
+
$serialization = 'rdfxml' and
|
|
374
|
+
not(following-sibling::marc:subfield[. = $vRoleUri]) and
|
|
375
|
+
not(following-sibling::marc:subfield[. = $vThis4])
|
|
376
|
+
">
|
|
377
|
+
<bf:role>
|
|
378
|
+
<bf:Role>
|
|
379
|
+
<xsl:choose>
|
|
380
|
+
<xsl:when test="$vRoleUri != ''">
|
|
381
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="$vRoleUri"/></xsl:attribute>
|
|
382
|
+
</xsl:when>
|
|
383
|
+
<xsl:otherwise>
|
|
384
|
+
<bf:code><xsl:value-of select="."/></bf:code>
|
|
385
|
+
</xsl:otherwise>
|
|
386
|
+
</xsl:choose>
|
|
387
|
+
</bf:Role>
|
|
388
|
+
</bf:role>
|
|
389
|
+
</xsl:when>
|
|
390
|
+
</xsl:choose>
|
|
391
|
+
</xsl:for-each>
|
|
392
|
+
</xsl:template>
|
|
393
|
+
|
|
394
|
+
<!-- build bf:role properties from $e or $j -->
|
|
395
|
+
<xsl:template match="marc:subfield" mode="contributionRole">
|
|
396
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
397
|
+
<xsl:param name="pMode" select="'role'"/>
|
|
398
|
+
<xsl:param name="pRelatedTo"/>
|
|
399
|
+
<xsl:variable name="vXmlLang"><xsl:apply-templates select="parent::*" mode="xmllang"/></xsl:variable>
|
|
400
|
+
<xsl:call-template name="splitRole">
|
|
401
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
402
|
+
<xsl:with-param name="roleString" select="."/>
|
|
403
|
+
<xsl:with-param name="pMode" select="$pMode"/>
|
|
404
|
+
<xsl:with-param name="pRelatedTo" select="$pRelatedTo"/>
|
|
405
|
+
<xsl:with-param name="pXmlLang" select="$vXmlLang"/>
|
|
406
|
+
</xsl:call-template>
|
|
407
|
+
</xsl:template>
|
|
408
|
+
|
|
409
|
+
<!-- recursive template to split bf:role properties out of a $e or $j -->
|
|
410
|
+
<xsl:template name="splitRole">
|
|
411
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
412
|
+
<xsl:param name="roleString"/>
|
|
413
|
+
<xsl:param name="pMode" select="'role'"/>
|
|
414
|
+
<xsl:param name="pRelatedTo"/>
|
|
415
|
+
<xsl:param name="pXmlLang"/>
|
|
416
|
+
<xsl:choose>
|
|
417
|
+
<xsl:when test="contains($roleString,',')">
|
|
418
|
+
<xsl:if test="string-length(normalize-space(substring-before($roleString,','))) > 0">
|
|
419
|
+
<xsl:variable name="vRole"><xsl:value-of select="normalize-space(substring-before($roleString,','))"/></xsl:variable>
|
|
420
|
+
<xsl:choose>
|
|
421
|
+
<xsl:when test="$serialization='rdfxml'">
|
|
422
|
+
<xsl:choose>
|
|
423
|
+
<xsl:when test="$pMode='role'">
|
|
424
|
+
<bf:role>
|
|
425
|
+
<bf:Role>
|
|
426
|
+
<rdfs:label>
|
|
427
|
+
<xsl:if test="$pXmlLang != ''">
|
|
428
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$pXmlLang"/></xsl:attribute>
|
|
429
|
+
</xsl:if>
|
|
430
|
+
<xsl:call-template name="tChopPunct">
|
|
431
|
+
<xsl:with-param name="pString" select="$vRole"/>
|
|
432
|
+
</xsl:call-template>
|
|
433
|
+
</rdfs:label>
|
|
434
|
+
</bf:Role>
|
|
435
|
+
</bf:role>
|
|
436
|
+
</xsl:when>
|
|
437
|
+
<xsl:when test="$pMode='relationship'">
|
|
438
|
+
<bf:relation>
|
|
439
|
+
<bf:Relation>
|
|
440
|
+
<bf:relationship>
|
|
441
|
+
<bf:Relationship>
|
|
442
|
+
<rdfs:label>
|
|
443
|
+
<xsl:if test="$pXmlLang != ''">
|
|
444
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$pXmlLang"/></xsl:attribute>
|
|
445
|
+
</xsl:if>
|
|
446
|
+
<xsl:call-template name="tChopPunct">
|
|
447
|
+
<xsl:with-param name="pString" select="$vRole"/>
|
|
448
|
+
</xsl:call-template>
|
|
449
|
+
</rdfs:label>
|
|
450
|
+
</bf:Relationship>
|
|
451
|
+
</bf:relationship>
|
|
452
|
+
<xsl:if test="$pRelatedTo != ''">
|
|
453
|
+
<bf:relatedTo>
|
|
454
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="$pRelatedTo"/></xsl:attribute>
|
|
455
|
+
</bf:relatedTo>
|
|
456
|
+
</xsl:if>
|
|
457
|
+
</bf:Relation>
|
|
458
|
+
</bf:relation>
|
|
459
|
+
</xsl:when>
|
|
460
|
+
</xsl:choose>
|
|
461
|
+
</xsl:when>
|
|
462
|
+
</xsl:choose>
|
|
463
|
+
</xsl:if>
|
|
464
|
+
<xsl:if test="string-length(normalize-space(substring-after($roleString,','))) > 0">
|
|
465
|
+
<xsl:call-template name="splitRole">
|
|
466
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
467
|
+
<xsl:with-param name="roleString" select="substring-after($roleString,',')"/>
|
|
468
|
+
</xsl:call-template>
|
|
469
|
+
</xsl:if>
|
|
470
|
+
</xsl:when>
|
|
471
|
+
<xsl:when test="contains($roleString,' and')">
|
|
472
|
+
<xsl:if test="string-length(normalize-space(substring-before($roleString,' and'))) > 0">
|
|
473
|
+
<xsl:variable name="vRole"><xsl:value-of select="normalize-space(substring-before($roleString,' and'))"/></xsl:variable>
|
|
474
|
+
<xsl:choose>
|
|
475
|
+
<xsl:when test="$serialization='rdfxml'">
|
|
476
|
+
<xsl:choose>
|
|
477
|
+
<xsl:when test="$pMode='role'">
|
|
478
|
+
<bf:role>
|
|
479
|
+
<bf:Role>
|
|
480
|
+
<rdfs:label>
|
|
481
|
+
<xsl:if test="$pXmlLang != ''">
|
|
482
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$pXmlLang"/></xsl:attribute>
|
|
483
|
+
</xsl:if>
|
|
484
|
+
<xsl:call-template name="tChopPunct">
|
|
485
|
+
<xsl:with-param name="pString" select="normalize-space(substring-before($roleString,' and'))"/>
|
|
486
|
+
</xsl:call-template>
|
|
487
|
+
</rdfs:label>
|
|
488
|
+
</bf:Role>
|
|
489
|
+
</bf:role>
|
|
490
|
+
</xsl:when>
|
|
491
|
+
<xsl:when test="$pMode='relationship'">
|
|
492
|
+
<bf:relation>
|
|
493
|
+
<bf:Relation>
|
|
494
|
+
<bf:relationship>
|
|
495
|
+
<bf:Relationship>
|
|
496
|
+
<rdfs:label>
|
|
497
|
+
<xsl:if test="$pXmlLang != ''">
|
|
498
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$pXmlLang"/></xsl:attribute>
|
|
499
|
+
</xsl:if>
|
|
500
|
+
<xsl:call-template name="tChopPunct">
|
|
501
|
+
<xsl:with-param name="pString" select="$vRole"/>
|
|
502
|
+
</xsl:call-template>
|
|
503
|
+
</rdfs:label>
|
|
504
|
+
</bf:Relationship>
|
|
505
|
+
</bf:relationship>
|
|
506
|
+
<xsl:if test="$pRelatedTo != ''">
|
|
507
|
+
<bf:relatedTo>
|
|
508
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="$pRelatedTo"/></xsl:attribute>
|
|
509
|
+
</bf:relatedTo>
|
|
510
|
+
</xsl:if>
|
|
511
|
+
</bf:Relation>
|
|
512
|
+
</bf:relation>
|
|
513
|
+
</xsl:when>
|
|
514
|
+
</xsl:choose>
|
|
515
|
+
</xsl:when>
|
|
516
|
+
</xsl:choose>
|
|
517
|
+
</xsl:if>
|
|
518
|
+
<xsl:call-template name="splitRole">
|
|
519
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
520
|
+
<xsl:with-param name="roleString" select="substring-after($roleString,' and')"/>
|
|
521
|
+
</xsl:call-template>
|
|
522
|
+
</xsl:when>
|
|
523
|
+
<xsl:when test="contains($roleString,'&')">
|
|
524
|
+
<xsl:if test="string-length(normalize-space(substring-before($roleString,'&'))) > 0">
|
|
525
|
+
<xsl:variable name="vRole"><xsl:value-of select="normalize-space(substring-before($roleString,'&'))"/></xsl:variable>
|
|
526
|
+
<xsl:choose>
|
|
527
|
+
<xsl:when test="$serialization='rdfxml'">
|
|
528
|
+
<xsl:choose>
|
|
529
|
+
<xsl:when test="$pMode='role'">
|
|
530
|
+
<bf:role>
|
|
531
|
+
<bf:Role>
|
|
532
|
+
<rdfs:label>
|
|
533
|
+
<xsl:if test="$pXmlLang != ''">
|
|
534
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$pXmlLang"/></xsl:attribute>
|
|
535
|
+
</xsl:if>
|
|
536
|
+
<xsl:call-template name="tChopPunct">
|
|
537
|
+
<xsl:with-param name="pString" select="normalize-space(substring-before($roleString,'&'))"/>
|
|
538
|
+
</xsl:call-template>
|
|
539
|
+
</rdfs:label>
|
|
540
|
+
</bf:Role>
|
|
541
|
+
</bf:role>
|
|
542
|
+
</xsl:when>
|
|
543
|
+
<xsl:when test="$pMode='relationship'">
|
|
544
|
+
<bf:relation>
|
|
545
|
+
<bf:Relation>
|
|
546
|
+
<bf:relationship>
|
|
547
|
+
<bf:Relationship>
|
|
548
|
+
<rdfs:label>
|
|
549
|
+
<xsl:if test="$pXmlLang != ''">
|
|
550
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$pXmlLang"/></xsl:attribute>
|
|
551
|
+
</xsl:if>
|
|
552
|
+
<xsl:call-template name="tChopPunct">
|
|
553
|
+
<xsl:with-param name="pString" select="$vRole"/>
|
|
554
|
+
</xsl:call-template>
|
|
555
|
+
</rdfs:label>
|
|
556
|
+
</bf:Relationship>
|
|
557
|
+
</bf:relationship>
|
|
558
|
+
<xsl:if test="$pRelatedTo != ''">
|
|
559
|
+
<bf:relatedTo>
|
|
560
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="$pRelatedTo"/></xsl:attribute>
|
|
561
|
+
</bf:relatedTo>
|
|
562
|
+
</xsl:if>
|
|
563
|
+
</bf:Relation>
|
|
564
|
+
</bf:relation>
|
|
565
|
+
</xsl:when>
|
|
566
|
+
</xsl:choose>
|
|
567
|
+
</xsl:when>
|
|
568
|
+
</xsl:choose>
|
|
569
|
+
</xsl:if>
|
|
570
|
+
<xsl:call-template name="splitRole">
|
|
571
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
572
|
+
<xsl:with-param name="roleString" select="substring-after($roleString,'&')"/>
|
|
573
|
+
</xsl:call-template>
|
|
574
|
+
</xsl:when>
|
|
575
|
+
<xsl:otherwise>
|
|
576
|
+
<xsl:choose>
|
|
577
|
+
<xsl:when test="$serialization='rdfxml'">
|
|
578
|
+
<xsl:choose>
|
|
579
|
+
<xsl:when test="$pMode='role'">
|
|
580
|
+
<bf:role>
|
|
581
|
+
<bf:Role>
|
|
582
|
+
<rdfs:label>
|
|
583
|
+
<xsl:if test="$pXmlLang != ''">
|
|
584
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$pXmlLang"/></xsl:attribute>
|
|
585
|
+
</xsl:if>
|
|
586
|
+
<xsl:call-template name="tChopPunct">
|
|
587
|
+
<xsl:with-param name="pString" select="$roleString"/>
|
|
588
|
+
</xsl:call-template>
|
|
589
|
+
</rdfs:label>
|
|
590
|
+
</bf:Role>
|
|
591
|
+
</bf:role>
|
|
592
|
+
</xsl:when>
|
|
593
|
+
<xsl:when test="$pMode='relationship'">
|
|
594
|
+
<bf:relation>
|
|
595
|
+
<bf:Relation>
|
|
596
|
+
<bf:relationship>
|
|
597
|
+
<bf:Relationship>
|
|
598
|
+
<rdfs:label>
|
|
599
|
+
<xsl:if test="$pXmlLang != ''">
|
|
600
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$pXmlLang"/></xsl:attribute>
|
|
601
|
+
</xsl:if>
|
|
602
|
+
<xsl:call-template name="tChopPunct">
|
|
603
|
+
<xsl:with-param name="pString" select="$roleString"/>
|
|
604
|
+
</xsl:call-template>
|
|
605
|
+
</rdfs:label>
|
|
606
|
+
</bf:Relationship>
|
|
607
|
+
</bf:relationship>
|
|
608
|
+
<xsl:if test="$pRelatedTo != ''">
|
|
609
|
+
<bf:relatedTo>
|
|
610
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="$pRelatedTo"/></xsl:attribute>
|
|
611
|
+
</bf:relatedTo>
|
|
612
|
+
</xsl:if>
|
|
613
|
+
</bf:Relation>
|
|
614
|
+
</bf:relation>
|
|
615
|
+
</xsl:when>
|
|
616
|
+
</xsl:choose>
|
|
617
|
+
</xsl:when>
|
|
618
|
+
</xsl:choose>
|
|
619
|
+
</xsl:otherwise>
|
|
620
|
+
</xsl:choose>
|
|
621
|
+
</xsl:template>
|
|
622
|
+
|
|
623
|
+
<!-- build a bf:Agent entity -->
|
|
624
|
+
<xsl:template match="marc:datafield" mode="agent">
|
|
625
|
+
<xsl:param name="agentiri"/>
|
|
626
|
+
<xsl:param name="pMADSClass"/>
|
|
627
|
+
<xsl:param name="pMADSLabel"/>
|
|
628
|
+
<xsl:param name="pSource"/>
|
|
629
|
+
<xsl:param name="serialization" select="'rdfxml'"/>
|
|
630
|
+
<xsl:param name="recordid"/>
|
|
631
|
+
<xsl:variable name="tag">
|
|
632
|
+
<xsl:choose>
|
|
633
|
+
<xsl:when test="@tag=880">
|
|
634
|
+
<xsl:value-of select="substring(marc:subfield[@code='6'],1,3)"/>
|
|
635
|
+
</xsl:when>
|
|
636
|
+
<xsl:otherwise>
|
|
637
|
+
<xsl:value-of select="@tag"/>
|
|
638
|
+
</xsl:otherwise>
|
|
639
|
+
</xsl:choose>
|
|
640
|
+
</xsl:variable>
|
|
641
|
+
<xsl:variable name="vXmlLang"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
642
|
+
<xsl:variable name="label">
|
|
643
|
+
<xsl:variable name="vUnchopped">
|
|
644
|
+
<xsl:apply-templates select="." mode="tNameLabel"/>
|
|
645
|
+
</xsl:variable>
|
|
646
|
+
<xsl:call-template name="tChopPunct">
|
|
647
|
+
<xsl:with-param name="pString" select="$vUnchopped"/>
|
|
648
|
+
</xsl:call-template>
|
|
649
|
+
</xsl:variable>
|
|
650
|
+
<xsl:choose>
|
|
651
|
+
<xsl:when test="$serialization='rdfxml'">
|
|
652
|
+
<bf:Agent>
|
|
653
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="$agentiri"/></xsl:attribute>
|
|
654
|
+
<rdf:type>
|
|
655
|
+
<xsl:choose>
|
|
656
|
+
<xsl:when test="$tag='720' and @ind1='1'">
|
|
657
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="$bf"/>Person</xsl:attribute>
|
|
658
|
+
</xsl:when>
|
|
659
|
+
<xsl:when test="substring($tag,2,2)='00'">
|
|
660
|
+
<xsl:choose>
|
|
661
|
+
<xsl:when test="@ind1='3'">
|
|
662
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="$bf"/>Family</xsl:attribute>
|
|
663
|
+
</xsl:when>
|
|
664
|
+
<xsl:otherwise>
|
|
665
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="$bf"/>Person</xsl:attribute>
|
|
666
|
+
</xsl:otherwise>
|
|
667
|
+
</xsl:choose>
|
|
668
|
+
</xsl:when>
|
|
669
|
+
<xsl:when test="substring($tag,2,2)='10'">
|
|
670
|
+
<xsl:choose>
|
|
671
|
+
<xsl:when test="@ind1='1'">
|
|
672
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="concat($bf,'Jurisdiction')"/></xsl:attribute>
|
|
673
|
+
</xsl:when>
|
|
674
|
+
<xsl:otherwise>
|
|
675
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="concat($bf,'Organization')"/></xsl:attribute>
|
|
676
|
+
</xsl:otherwise>
|
|
677
|
+
</xsl:choose>
|
|
678
|
+
</xsl:when>
|
|
679
|
+
<xsl:when test="substring($tag,2,2)='11'">
|
|
680
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="concat($bf,'Meeting')"/></xsl:attribute>
|
|
681
|
+
</xsl:when>
|
|
682
|
+
</xsl:choose>
|
|
683
|
+
</rdf:type>
|
|
684
|
+
<xsl:if test="$tag='720'">
|
|
685
|
+
<rdf:type><xsl:attribute name="rdf:resource"><xsl:value-of select="$bflc"/>Uncontrolled</xsl:attribute></rdf:type>
|
|
686
|
+
</xsl:if>
|
|
687
|
+
<xsl:if test="substring($tag,1,1)='6'">
|
|
688
|
+
<!--
|
|
689
|
+
<xsl:if test="$pMADSClass != ''">
|
|
690
|
+
<rdf:type>
|
|
691
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="concat($madsrdf,$pMADSClass)"/></xsl:attribute>
|
|
692
|
+
</rdf:type>
|
|
693
|
+
<xsl:if test="$pMADSLabel != ''">
|
|
694
|
+
<madsrdf:authoritativeLabel>
|
|
695
|
+
<xsl:if test="$vXmlLang != ''">
|
|
696
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
697
|
+
</xsl:if>
|
|
698
|
+
<xsl:call-template name="tChopPunct">
|
|
699
|
+
<xsl:with-param name="pString" select="$pMADSLabel"/>
|
|
700
|
+
</xsl:call-template>
|
|
701
|
+
</madsrdf:authoritativeLabel>
|
|
702
|
+
</xsl:if>
|
|
703
|
+
<xsl:for-each select="$subjectThesaurus/subjectThesaurus/subject[@ind2=current()/@ind2]/madsscheme">
|
|
704
|
+
<madsrdf:isMemberOfMADSScheme>
|
|
705
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="."/></xsl:attribute>
|
|
706
|
+
</madsrdf:isMemberOfMADSScheme>
|
|
707
|
+
</xsl:for-each>
|
|
708
|
+
</xsl:if>
|
|
709
|
+
-->
|
|
710
|
+
<xsl:if test="not(marc:subfield[@code='t'])">
|
|
711
|
+
<xsl:choose>
|
|
712
|
+
<xsl:when test="substring($tag,2,2)='11'">
|
|
713
|
+
<xsl:apply-templates select="marc:subfield[@code='j']" mode="contributionRole">
|
|
714
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
715
|
+
<xsl:with-param name="pMode">relationship</xsl:with-param>
|
|
716
|
+
<xsl:with-param name="pRelatedTo"><xsl:value-of select="$recordid"/>#Work</xsl:with-param>
|
|
717
|
+
</xsl:apply-templates>
|
|
718
|
+
</xsl:when>
|
|
719
|
+
<xsl:otherwise>
|
|
720
|
+
<xsl:apply-templates select="marc:subfield[@code='e']" mode="contributionRole">
|
|
721
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
722
|
+
<xsl:with-param name="pMode">relationship</xsl:with-param>
|
|
723
|
+
<xsl:with-param name="pRelatedTo"><xsl:value-of select="$recordid"/>#Work</xsl:with-param>
|
|
724
|
+
</xsl:apply-templates>
|
|
725
|
+
</xsl:otherwise>
|
|
726
|
+
</xsl:choose>
|
|
727
|
+
<xsl:for-each select="marc:subfield[@code='4']">
|
|
728
|
+
<xsl:variable name="vRelationUri">
|
|
729
|
+
<xsl:choose>
|
|
730
|
+
<xsl:when test="string-length(.) = 3">
|
|
731
|
+
<xsl:variable name="encoded">
|
|
732
|
+
<xsl:call-template name="url-encode">
|
|
733
|
+
<xsl:with-param name="str" select="."/>
|
|
734
|
+
</xsl:call-template>
|
|
735
|
+
</xsl:variable>
|
|
736
|
+
<xsl:value-of select="concat($relators,$encoded)"/>
|
|
737
|
+
</xsl:when>
|
|
738
|
+
<xsl:when test="contains(.,'://')">
|
|
739
|
+
<xsl:value-of select="."/>
|
|
740
|
+
</xsl:when>
|
|
741
|
+
</xsl:choose>
|
|
742
|
+
</xsl:variable>
|
|
743
|
+
<bf:relation>
|
|
744
|
+
<bf:Relation>
|
|
745
|
+
<bf:relationship>
|
|
746
|
+
<bf:Relationship>
|
|
747
|
+
<xsl:choose>
|
|
748
|
+
<xsl:when test="$vRelationUri != ''">
|
|
749
|
+
<xsl:attribute name="rdf:about"><xsl:value-of select="$vRelationUri"/></xsl:attribute>
|
|
750
|
+
</xsl:when>
|
|
751
|
+
<xsl:otherwise>
|
|
752
|
+
<bf:code><xsl:value-of select="."/></bf:code>
|
|
753
|
+
</xsl:otherwise>
|
|
754
|
+
</xsl:choose>
|
|
755
|
+
</bf:Relationship>
|
|
756
|
+
</bf:relationship>
|
|
757
|
+
<bf:relatedTo>
|
|
758
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="$recordid"/>#Work</xsl:attribute>
|
|
759
|
+
</bf:relatedTo>
|
|
760
|
+
</bf:Relation>
|
|
761
|
+
</bf:relation>
|
|
762
|
+
</xsl:for-each>
|
|
763
|
+
</xsl:if>
|
|
764
|
+
</xsl:if>
|
|
765
|
+
<xsl:if test="$label != ''">
|
|
766
|
+
<rdfs:label>
|
|
767
|
+
<xsl:if test="$vXmlLang != ''">
|
|
768
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
769
|
+
</xsl:if>
|
|
770
|
+
<xsl:value-of select="$label"/>
|
|
771
|
+
</rdfs:label>
|
|
772
|
+
|
|
773
|
+
<xsl:if test="marc:subfield[@code='6']">
|
|
774
|
+
<xsl:variable name="v880Occurrence">
|
|
775
|
+
<xsl:value-of select="substring(substring-after(marc:subfield[@code = '6'], '-'), 1, 2)"/>
|
|
776
|
+
</xsl:variable>
|
|
777
|
+
<xsl:variable name="v880Ref">
|
|
778
|
+
<xsl:value-of select="concat($tag, '-', $v880Occurrence)"/>
|
|
779
|
+
</xsl:variable>
|
|
780
|
+
<xsl:for-each select="ancestor::marc:record/marc:datafield[@tag='880' and marc:subfield[@code='6' and substring(., 1, 6)=$v880Ref]]">
|
|
781
|
+
<xsl:variable name="vXmlLang880"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
782
|
+
<xsl:variable name="label880">
|
|
783
|
+
<xsl:variable name="vUnchopped880">
|
|
784
|
+
<xsl:apply-templates select="." mode="tNameLabel"/>
|
|
785
|
+
</xsl:variable>
|
|
786
|
+
<xsl:call-template name="tChopPunct">
|
|
787
|
+
<xsl:with-param name="pString" select="$vUnchopped880"/>
|
|
788
|
+
</xsl:call-template>
|
|
789
|
+
</xsl:variable>
|
|
790
|
+
<rdfs:label>
|
|
791
|
+
<xsl:if test="$vXmlLang880 != ''">
|
|
792
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang880"/></xsl:attribute>
|
|
793
|
+
</xsl:if>
|
|
794
|
+
<xsl:value-of select="$label880"/>
|
|
795
|
+
</rdfs:label>
|
|
796
|
+
</xsl:for-each>
|
|
797
|
+
</xsl:if>
|
|
798
|
+
</xsl:if>
|
|
799
|
+
<!-- marcKey -->
|
|
800
|
+
<xsl:if test="substring($tag,2,2)='00' or substring($tag,2,2)='10' or substring($tag,2,2)='11'">
|
|
801
|
+
<xsl:choose>
|
|
802
|
+
<xsl:when test="substring($tag,1,1)='1' and marc:subfield[@code='k'] and not(../marc:datafield[@tag='240'])">
|
|
803
|
+
<xsl:variable name="vDF1xx"><xsl:apply-templates select="." mode="marcKey"/></xsl:variable>
|
|
804
|
+
<bflc:marcKey>
|
|
805
|
+
<xsl:call-template name="tChopPunct">
|
|
806
|
+
<xsl:with-param name="pString" select="substring-before($vDF1xx, '$k')"/>
|
|
807
|
+
</xsl:call-template>
|
|
808
|
+
</bflc:marcKey>
|
|
809
|
+
</xsl:when>
|
|
810
|
+
<xsl:when test="substring($tag,1,1)='6' and (
|
|
811
|
+
marc:subfield[@code='v'] or
|
|
812
|
+
marc:subfield[@code='x'] or
|
|
813
|
+
marc:subfield[@code='y'] or
|
|
814
|
+
marc:subfield[@code='z']
|
|
815
|
+
)">
|
|
816
|
+
<xsl:variable name="vFirstSubdiv" select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z'][1]/@code" />
|
|
817
|
+
<xsl:variable name="vDF1xx"><xsl:apply-templates select="." mode="marcKey"/></xsl:variable>
|
|
818
|
+
<bflc:marcKey>
|
|
819
|
+
<xsl:call-template name="tChopPunct">
|
|
820
|
+
<xsl:with-param name="pString" select="substring-before($vDF1xx, concat('$', $vFirstSubdiv))"/>
|
|
821
|
+
</xsl:call-template>
|
|
822
|
+
</bflc:marcKey>
|
|
823
|
+
</xsl:when>
|
|
824
|
+
<xsl:otherwise>
|
|
825
|
+
<bflc:marcKey><xsl:apply-templates select="." mode="marcKey"/></bflc:marcKey>
|
|
826
|
+
</xsl:otherwise>
|
|
827
|
+
</xsl:choose>
|
|
828
|
+
|
|
829
|
+
<xsl:if test="marc:subfield[@code='6']">
|
|
830
|
+
<xsl:variable name="v880Occurrence">
|
|
831
|
+
<xsl:value-of select="substring(substring-after(marc:subfield[@code = '6'], '-'), 1, 2)"/>
|
|
832
|
+
</xsl:variable>
|
|
833
|
+
<xsl:variable name="v880Ref">
|
|
834
|
+
<xsl:value-of select="concat($tag, '-', $v880Occurrence)"/>
|
|
835
|
+
</xsl:variable>
|
|
836
|
+
<xsl:for-each select="ancestor::marc:record/marc:datafield[@tag='880' and marc:subfield[@code='6' and substring(., 1, 6)=$v880Ref]]">
|
|
837
|
+
<xsl:variable name="vXmlLang880"><xsl:apply-templates select="." mode="xmllang"/></xsl:variable>
|
|
838
|
+
<xsl:choose>
|
|
839
|
+
<xsl:when test="substring($tag,1,1)='1' and marc:subfield[@code='k'] and not(../marc:datafield[@tag='240'])">
|
|
840
|
+
<xsl:variable name="vDF1xx"><xsl:apply-templates select="." mode="marcKey"/></xsl:variable>
|
|
841
|
+
<bflc:marcKey>
|
|
842
|
+
<xsl:if test="$vXmlLang880 != ''">
|
|
843
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang880"/></xsl:attribute>
|
|
844
|
+
</xsl:if>
|
|
845
|
+
<xsl:call-template name="tChopPunct">
|
|
846
|
+
<xsl:with-param name="pString" select="substring-before($vDF1xx, '$k')"/>
|
|
847
|
+
</xsl:call-template>
|
|
848
|
+
</bflc:marcKey>
|
|
849
|
+
</xsl:when>
|
|
850
|
+
<xsl:when test="substring($tag,1,1)='6' and (
|
|
851
|
+
marc:subfield[@code='v'] or
|
|
852
|
+
marc:subfield[@code='x'] or
|
|
853
|
+
marc:subfield[@code='y'] or
|
|
854
|
+
marc:subfield[@code='z']
|
|
855
|
+
)">
|
|
856
|
+
<xsl:variable name="vFirstSubdiv" select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z'][1]/@code" />
|
|
857
|
+
<xsl:variable name="vDF1xx"><xsl:apply-templates select="." mode="marcKey"/></xsl:variable>
|
|
858
|
+
<bflc:marcKey>
|
|
859
|
+
<xsl:if test="$vXmlLang880 != ''">
|
|
860
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang880"/></xsl:attribute>
|
|
861
|
+
</xsl:if>
|
|
862
|
+
<xsl:call-template name="tChopPunct">
|
|
863
|
+
<xsl:with-param name="pString" select="substring-before($vDF1xx, concat('$', $vFirstSubdiv))"/>
|
|
864
|
+
</xsl:call-template>
|
|
865
|
+
</bflc:marcKey>
|
|
866
|
+
</xsl:when>
|
|
867
|
+
<xsl:otherwise>
|
|
868
|
+
<bflc:marcKey>
|
|
869
|
+
<xsl:if test="$vXmlLang880 != ''">
|
|
870
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang880"/></xsl:attribute>
|
|
871
|
+
</xsl:if>
|
|
872
|
+
<xsl:apply-templates select="." mode="marcKey"/>
|
|
873
|
+
</bflc:marcKey>
|
|
874
|
+
</xsl:otherwise>
|
|
875
|
+
</xsl:choose>
|
|
876
|
+
</xsl:for-each>
|
|
877
|
+
</xsl:if>
|
|
878
|
+
</xsl:if>
|
|
879
|
+
<xsl:choose>
|
|
880
|
+
<xsl:when test="marc:subfield[@code='t']">
|
|
881
|
+
<xsl:for-each select="marc:subfield[@code='t']/preceding-sibling::marc:subfield[@code='0' or @code='w'][starts-with(text(),'(uri)') or starts-with(text(),'http')]">
|
|
882
|
+
<xsl:if test="position() != 1">
|
|
883
|
+
<xsl:apply-templates mode="subfield0orw" select=".">
|
|
884
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
885
|
+
</xsl:apply-templates>
|
|
886
|
+
</xsl:if>
|
|
887
|
+
</xsl:for-each>
|
|
888
|
+
<xsl:for-each select="marc:subfield[@code='t']/preceding-sibling::marc:subfield[@code='0' or @code='w']">
|
|
889
|
+
<xsl:if test="substring(text(),1,5) != '(uri)' and substring(text(),1,4) != 'http'">
|
|
890
|
+
<xsl:apply-templates mode="subfield0orw" select=".">
|
|
891
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
892
|
+
</xsl:apply-templates>
|
|
893
|
+
</xsl:if>
|
|
894
|
+
</xsl:for-each>
|
|
895
|
+
</xsl:when>
|
|
896
|
+
<xsl:otherwise>
|
|
897
|
+
<xsl:if test="marc:subfield[@code='1'] and
|
|
898
|
+
contains(marc:subfield[@code='1'], 'id.loc.gov/rwo/') and
|
|
899
|
+
not(marc:subfield[@code='0' or @code='w'][starts-with(text(),'(uri)') or starts-with(text(),'http')])">
|
|
900
|
+
<madsrdf:isIdentifiedByAuthority>
|
|
901
|
+
<xsl:choose>
|
|
902
|
+
<xsl:when test="substring($tag,1,1)='6' and $pMADSClass != ''">
|
|
903
|
+
<xsl:element name="{concat('madsrdf:', $pMADSClass)}">
|
|
904
|
+
<xsl:attribute name="rdf:about">
|
|
905
|
+
<xsl:apply-templates mode="generateUriFrom0" select=".">
|
|
906
|
+
<xsl:with-param name="pEntity">bf:Agent</xsl:with-param>
|
|
907
|
+
</xsl:apply-templates>
|
|
908
|
+
</xsl:attribute>
|
|
909
|
+
<xsl:if test="$pMADSLabel != ''">
|
|
910
|
+
<madsrdf:authoritativeLabel>
|
|
911
|
+
<xsl:if test="$vXmlLang != ''">
|
|
912
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
913
|
+
</xsl:if>
|
|
914
|
+
<xsl:call-template name="tChopPunct">
|
|
915
|
+
<xsl:with-param name="pString" select="$pMADSLabel"/>
|
|
916
|
+
</xsl:call-template>
|
|
917
|
+
</madsrdf:authoritativeLabel>
|
|
918
|
+
</xsl:if>
|
|
919
|
+
<!--
|
|
920
|
+
<xsl:for-each select="$subjectThesaurus/subjectThesaurus/subject[@ind2=current()/@ind2]/madsscheme">
|
|
921
|
+
<madsrdf:isMemberOfMADSScheme>
|
|
922
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="."/></xsl:attribute>
|
|
923
|
+
</madsrdf:isMemberOfMADSScheme>
|
|
924
|
+
</xsl:for-each>
|
|
925
|
+
-->
|
|
926
|
+
<madsrdf:isMemberOfMADSScheme rdf:resource="http://id.loc.gov/authorities/names" />
|
|
927
|
+
</xsl:element>
|
|
928
|
+
</xsl:when>
|
|
929
|
+
<xsl:otherwise>
|
|
930
|
+
<madsrdf:isIdentifiedByAuthority>
|
|
931
|
+
<xsl:attribute name="rdf:resource">
|
|
932
|
+
<xsl:apply-templates mode="generateUriFrom0" select=".">
|
|
933
|
+
<xsl:with-param name="pEntity">bf:Agent</xsl:with-param>
|
|
934
|
+
</xsl:apply-templates>
|
|
935
|
+
</xsl:attribute>
|
|
936
|
+
</madsrdf:isIdentifiedByAuthority>
|
|
937
|
+
</xsl:otherwise>
|
|
938
|
+
</xsl:choose>
|
|
939
|
+
</madsrdf:isIdentifiedByAuthority>
|
|
940
|
+
</xsl:if>
|
|
941
|
+
<xsl:for-each select="marc:subfield[@code='0' or @code='w'][starts-with(text(),'(uri)') or starts-with(text(),'http')]">
|
|
942
|
+
<xsl:if test="position() = 1">
|
|
943
|
+
<xsl:choose>
|
|
944
|
+
<xsl:when test="substring($tag,1,1)='6' and $pMADSClass != ''">
|
|
945
|
+
<madsrdf:isIdentifiedByAuthority>
|
|
946
|
+
<xsl:element name="{concat('madsrdf:', $pMADSClass)}">
|
|
947
|
+
<xsl:choose>
|
|
948
|
+
<xsl:when test="starts-with(text(),'http')">
|
|
949
|
+
<xsl:attribute name="rdf:about">
|
|
950
|
+
<xsl:value-of select="text()" />
|
|
951
|
+
</xsl:attribute>
|
|
952
|
+
</xsl:when>
|
|
953
|
+
<xsl:when test="starts-with(text(),'(uri) ')">
|
|
954
|
+
<xsl:attribute name="rdf:about">
|
|
955
|
+
<xsl:value-of select="substring-after(text(),'(uri) ')" />
|
|
956
|
+
</xsl:attribute>
|
|
957
|
+
</xsl:when>
|
|
958
|
+
<xsl:when test="starts-with(text(),'(uri)')">
|
|
959
|
+
<xsl:attribute name="rdf:about">
|
|
960
|
+
<xsl:value-of select="substring-after(text(),'(uri)')" />
|
|
961
|
+
</xsl:attribute>
|
|
962
|
+
</xsl:when>
|
|
963
|
+
</xsl:choose>
|
|
964
|
+
<xsl:if test="$pMADSLabel != ''">
|
|
965
|
+
<madsrdf:authoritativeLabel>
|
|
966
|
+
<xsl:if test="$vXmlLang != ''">
|
|
967
|
+
<xsl:attribute name="xml:lang"><xsl:value-of select="$vXmlLang"/></xsl:attribute>
|
|
968
|
+
</xsl:if>
|
|
969
|
+
<xsl:call-template name="tChopPunct">
|
|
970
|
+
<xsl:with-param name="pString" select="$pMADSLabel"/>
|
|
971
|
+
</xsl:call-template>
|
|
972
|
+
</madsrdf:authoritativeLabel>
|
|
973
|
+
</xsl:if>
|
|
974
|
+
<!--
|
|
975
|
+
<xsl:for-each select="$subjectThesaurus/subjectThesaurus/subject[@ind2=current()/@ind2]/madsscheme">
|
|
976
|
+
<madsrdf:isMemberOfMADSScheme>
|
|
977
|
+
<xsl:attribute name="rdf:resource"><xsl:value-of select="."/></xsl:attribute>
|
|
978
|
+
</madsrdf:isMemberOfMADSScheme>
|
|
979
|
+
</xsl:for-each>
|
|
980
|
+
-->
|
|
981
|
+
<madsrdf:isMemberOfMADSScheme rdf:resource="http://id.loc.gov/authorities/names" />
|
|
982
|
+
</xsl:element>
|
|
983
|
+
</madsrdf:isIdentifiedByAuthority>
|
|
984
|
+
</xsl:when>
|
|
985
|
+
<xsl:otherwise>
|
|
986
|
+
<xsl:apply-templates mode="subfield0orw" select=".">
|
|
987
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
988
|
+
</xsl:apply-templates>
|
|
989
|
+
</xsl:otherwise>
|
|
990
|
+
</xsl:choose>
|
|
991
|
+
</xsl:if>
|
|
992
|
+
</xsl:for-each>
|
|
993
|
+
<xsl:for-each select="marc:subfield[@code='0' or @code='w']">
|
|
994
|
+
<xsl:if test="substring(text(),1,5) != '(uri)' and substring(text(),1,4) != 'http'">
|
|
995
|
+
<xsl:apply-templates mode="subfield0orw" select=".">
|
|
996
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
997
|
+
</xsl:apply-templates>
|
|
998
|
+
</xsl:if>
|
|
999
|
+
</xsl:for-each>
|
|
1000
|
+
<xsl:choose>
|
|
1001
|
+
<xsl:when test="$pSource">
|
|
1002
|
+
<xsl:copy-of select="$pSource"/>
|
|
1003
|
+
</xsl:when>
|
|
1004
|
+
<xsl:otherwise>
|
|
1005
|
+
<xsl:apply-templates mode="subfield2" select="marc:subfield[@code='2']">
|
|
1006
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1007
|
+
<xsl:with-param name="pVocabStem" select="$nametitleschemes"/>
|
|
1008
|
+
</xsl:apply-templates>
|
|
1009
|
+
</xsl:otherwise>
|
|
1010
|
+
</xsl:choose>
|
|
1011
|
+
<xsl:apply-templates mode="subfield3" select="marc:subfield[@code='3']">
|
|
1012
|
+
<xsl:with-param name="serialization" select="$serialization"/>
|
|
1013
|
+
</xsl:apply-templates>
|
|
1014
|
+
</xsl:otherwise>
|
|
1015
|
+
</xsl:choose>
|
|
1016
|
+
</bf:Agent>
|
|
1017
|
+
</xsl:when>
|
|
1018
|
+
</xsl:choose>
|
|
1019
|
+
</xsl:template>
|
|
1020
|
+
|
|
1021
|
+
<xsl:template match="marc:datafield" mode="tNameLabel">
|
|
1022
|
+
<xsl:variable name="tag">
|
|
1023
|
+
<xsl:choose>
|
|
1024
|
+
<xsl:when test="@tag=880">
|
|
1025
|
+
<xsl:value-of select="substring(marc:subfield[@code='6'],1,3)"/>
|
|
1026
|
+
</xsl:when>
|
|
1027
|
+
<xsl:otherwise>
|
|
1028
|
+
<xsl:value-of select="@tag"/>
|
|
1029
|
+
</xsl:otherwise>
|
|
1030
|
+
</xsl:choose>
|
|
1031
|
+
</xsl:variable>
|
|
1032
|
+
<xsl:choose>
|
|
1033
|
+
<xsl:when test="$tag='720'"><xsl:value-of select="marc:subfield[@code='a']"/></xsl:when>
|
|
1034
|
+
<xsl:when test="substring($tag,2,2)='00'">
|
|
1035
|
+
<xsl:choose>
|
|
1036
|
+
<xsl:when test="marc:subfield[@code='t']">
|
|
1037
|
+
<!-- This will occur in 7XX fields, e.g. -->
|
|
1038
|
+
<xsl:apply-templates mode="concat-nodes-space"
|
|
1039
|
+
select="marc:subfield[@code='t']/preceding-sibling::marc:subfield[@code='a' or
|
|
1040
|
+
@code='b' or
|
|
1041
|
+
@code='c' or
|
|
1042
|
+
@code='d' or
|
|
1043
|
+
@code='j' or
|
|
1044
|
+
@code='q' or
|
|
1045
|
+
@code='k']"/>
|
|
1046
|
+
</xsl:when>
|
|
1047
|
+
<xsl:when test="@tag='100' and marc:subfield[@code='k'] and not(../marc:datafield[@tag = '240'])">
|
|
1048
|
+
<!-- $k is title-like. Process name as name, but will process $k later as a title. -->
|
|
1049
|
+
<xsl:apply-templates mode="concat-nodes-space"
|
|
1050
|
+
select="marc:subfield[@code='k']/preceding-sibling::marc:subfield[@code='a' or
|
|
1051
|
+
@code='b' or
|
|
1052
|
+
@code='c' or
|
|
1053
|
+
@code='d' or
|
|
1054
|
+
@code='j' or
|
|
1055
|
+
@code='q']"/>
|
|
1056
|
+
</xsl:when>
|
|
1057
|
+
<xsl:otherwise>
|
|
1058
|
+
<xsl:apply-templates mode="concat-nodes-space"
|
|
1059
|
+
select="marc:subfield[@code='a' or
|
|
1060
|
+
@code='b' or
|
|
1061
|
+
@code='c' or
|
|
1062
|
+
@code='d' or
|
|
1063
|
+
@code='j' or
|
|
1064
|
+
@code='q' or
|
|
1065
|
+
@code='k']"/>
|
|
1066
|
+
</xsl:otherwise>
|
|
1067
|
+
</xsl:choose>
|
|
1068
|
+
</xsl:when>
|
|
1069
|
+
<xsl:when test="substring($tag,2,2)='10'">
|
|
1070
|
+
<xsl:choose>
|
|
1071
|
+
<xsl:when test="marc:subfield[@code='t']">
|
|
1072
|
+
<!-- This will occur in 7XX fields, e.g. -->
|
|
1073
|
+
<xsl:apply-templates mode="concat-nodes-space"
|
|
1074
|
+
select="marc:subfield[@code='t']/preceding-sibling::marc:subfield[@code='a' or
|
|
1075
|
+
@code='b' or
|
|
1076
|
+
@code='c' or
|
|
1077
|
+
@code='d' or
|
|
1078
|
+
@code='n' or
|
|
1079
|
+
@code='g' or
|
|
1080
|
+
@code='k']"/>
|
|
1081
|
+
</xsl:when>
|
|
1082
|
+
<xsl:when test="@tag='110' and marc:subfield[@code='k'] and not(../marc:datafield[@tag = '240'])">
|
|
1083
|
+
<!-- $k is title-like. Process name as name, but will process $k later as a title. -->
|
|
1084
|
+
<xsl:apply-templates mode="concat-nodes-space"
|
|
1085
|
+
select="marc:subfield[@code='k']/preceding-sibling::marc:subfield[@code='a' or
|
|
1086
|
+
@code='b' or
|
|
1087
|
+
@code='c' or
|
|
1088
|
+
@code='d' or
|
|
1089
|
+
@code='n' or
|
|
1090
|
+
@code='g']"/>
|
|
1091
|
+
</xsl:when>
|
|
1092
|
+
<xsl:otherwise>
|
|
1093
|
+
<xsl:apply-templates mode="concat-nodes-space"
|
|
1094
|
+
select="marc:subfield[@code='a' or
|
|
1095
|
+
@code='b' or
|
|
1096
|
+
@code='c' or
|
|
1097
|
+
@code='d' or
|
|
1098
|
+
@code='n' or
|
|
1099
|
+
@code='g' or
|
|
1100
|
+
@code='k']"/>
|
|
1101
|
+
</xsl:otherwise>
|
|
1102
|
+
</xsl:choose>
|
|
1103
|
+
</xsl:when>
|
|
1104
|
+
<xsl:when test="substring($tag,2,2)='11'">
|
|
1105
|
+
<xsl:choose>
|
|
1106
|
+
<xsl:when test="marc:subfield[@code='t']">
|
|
1107
|
+
<xsl:apply-templates mode="concat-nodes-space"
|
|
1108
|
+
select="marc:subfield[@code='t']/preceding-sibling::marc:subfield[@code='a' or
|
|
1109
|
+
@code='c' or
|
|
1110
|
+
@code='d' or
|
|
1111
|
+
@code='e' or
|
|
1112
|
+
@code='n' or
|
|
1113
|
+
@code='g' or
|
|
1114
|
+
@code='q']"/>
|
|
1115
|
+
</xsl:when>
|
|
1116
|
+
<xsl:when test="@tag='111' and marc:subfield[@code='k'] and not(../marc:datafield[@tag = '240'])">
|
|
1117
|
+
<!-- $k is title-like. Process name as name, but will process $k later as a title. -->
|
|
1118
|
+
<xsl:apply-templates mode="concat-nodes-space"
|
|
1119
|
+
select="marc:subfield[@code='k']/preceding-sibling::marc:subfield[@code='a' or
|
|
1120
|
+
@code='b' or
|
|
1121
|
+
@code='c' or
|
|
1122
|
+
@code='d' or
|
|
1123
|
+
@code='n' or
|
|
1124
|
+
@code='g']"/>
|
|
1125
|
+
</xsl:when>
|
|
1126
|
+
<xsl:otherwise>
|
|
1127
|
+
<xsl:apply-templates mode="concat-nodes-space"
|
|
1128
|
+
select="marc:subfield[@code='a' or
|
|
1129
|
+
@code='c' or
|
|
1130
|
+
@code='d' or
|
|
1131
|
+
@code='e' or
|
|
1132
|
+
@code='n' or
|
|
1133
|
+
@code='g' or
|
|
1134
|
+
@code='q']"/>
|
|
1135
|
+
</xsl:otherwise>
|
|
1136
|
+
</xsl:choose>
|
|
1137
|
+
</xsl:when>
|
|
1138
|
+
</xsl:choose>
|
|
1139
|
+
</xsl:template>
|
|
1140
|
+
|
|
1141
|
+
</xsl:stylesheet>
|