Project

General

Profile

1
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:efg="http://www.europeanfilmgateway.eu/efg"
2
                xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dri="http://www.driver-repository.eu/namespace/dri"
3
                xmlns:dcterms="http://purl.org/dc/terms/"
4
                xmlns:exslt="http://exslt.org/common" version="1.0"
5
                exclude-result-prefixes="xsl exslt">
6

    
7
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
8
	<xsl:variable name="small" select="'abcdefghijklmnopqrstuvwxyz'"/>
9
	<xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
10
	<xsl:template match="/">
11
		<xsl:choose>
12
			<xsl:when test="count(//efg:efgEntity/efg:avcreation//efg:title) &gt; 0 and count(//efg:isShownBy) &gt; 0">
13
				<oai:record xmlns:dri="http://www.driver-repository.eu/namespace/dri"
14
				            xmlns:oai="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
15
					<oai:header>
16
						<dri:objIdentifier>
17
							<xsl:value-of select=".//dri:objIdentifier"/>
18
						</dri:objIdentifier>
19
						<dri:recordIdentifier>
20
							<xsl:value-of select=".//dri:recordIdentifier"/>
21
						</dri:recordIdentifier>
22
						<dri:repositoryId>
23
							<xsl:value-of select=".//dri:repositoryId"/>
24
						</dri:repositoryId>
25
						<dri:datasourceprefix>
26
							<xsl:value-of select=".//dri:datasourceprefix"/>
27
						</dri:datasourceprefix>
28
						<oai:identifier>
29
							<xsl:value-of select=".//oai:identifier"/>
30
						</oai:identifier>
31
					</oai:header>
32
					<oai:metadata>
33
						<xsl:apply-templates select=".//efg:efgEntity/efg:avcreation"/>
34
					</oai:metadata>
35
				</oai:record>
36
			</xsl:when>
37

    
38
			<xsl:when test="count(//efg:efgEntity/efg:nonavcreation//efg:title) &gt; 0 and count(//efg:isShownBy) &gt; 0">
39
				<oai:record xmlns:dri="http://www.driver-repository.eu/namespace/dri"
40
				            xmlns:oai="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
41
					<oai:header>
42
						<dri:objIdentifier>
43
							<xsl:value-of select=".//dri:objIdentifier"/>
44
						</dri:objIdentifier>
45
						<dri:recordIdentifier>
46
							<xsl:value-of select=".//dri:recordIdentifier"/>
47
						</dri:recordIdentifier>
48
						<dri:repositoryId>
49
							<xsl:value-of select=".//dri:repositoryId"/>
50
						</dri:repositoryId>
51
						<dri:datasourceprefix>
52
							<xsl:value-of select=".//dri:datasourceprefix"/>
53
						</dri:datasourceprefix>
54
						<oai:identifier>
55
							<xsl:value-of select=".//oai:identifier"/>
56
						</oai:identifier>
57
					</oai:header>
58
					<oai:metadata>
59
						<xsl:apply-templates select=".//efg:efgEntity/efg:nonavcreation"/>
60
					</oai:metadata>
61
				</oai:record>
62
			</xsl:when>
63
			<xsl:otherwise>
64
				<JUNK/>
65
			</xsl:otherwise>
66
		</xsl:choose>
67

    
68
	</xsl:template>
69

    
70

    
71
	<xsl:template match="identifier | dri:objIdentifier | dri:recordIdentifier" mode="header">
72
		<xsl:param name="pos"/>
73
		<xsl:copy>
74
			<xsl:value-of select="concat(text(), '-', $pos)"/>
75
		</xsl:copy>
76
	</xsl:template>
77

    
78
	<xsl:template match="*" mode="header">
79
		<xsl:param name="pos"/>
80
		<xsl:copy-of select="."/>
81
	</xsl:template>
82

    
83

    
84
	<xsl:template match="efg:avcreation | efg:nonavcreation">
85

    
86
		<xsl:variable name="creationType" select="local-name(.)"/>
87

    
88
		<record>
89
			<header>
90
				<xsl:apply-templates select="/record/header/*" mode="header">
91
					<xsl:with-param name="pos">
92
						<xsl:value-of select="position()"/>
93
					</xsl:with-param>
94
				</xsl:apply-templates>
95
			</header>
96
			<metadata>
97
				<rdf:RDF xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
98
				         xmlns:dc="http://purl.org/dc/elements/1.1/"
99
				         xmlns:edm="http://www.europeana.eu/schemas/edm/"
100
				         xmlns:ore="http://www.openarchives.org/ore/terms/"
101
				         xmlns:dcterms="http://purl.org/dc/terms/"
102
				         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
103
				         xsi:schemaLocation="http://www.w3.org/1999/02/22-rdf-syntax-ns# EDM-INTERNAL.xsd">
104

    
105
					<xsl:variable name="efg_provider" select="//efg:provider"/>
106

    
107

    
108
					<ore:Aggregation>
109
						<xsl:attribute name="rdf:about">
110
							<xsl:value-of select="//efg:sourceID"/>
111
						</xsl:attribute>
112

    
113
						<edm:aggregatedCHO>
114
							<xsl:attribute name="rdf:resource">
115
								<xsl:value-of select="//efg:sourceID"/>
116
							</xsl:attribute>
117
						</edm:aggregatedCHO>
118

    
119
						<xsl:for-each select="//efg:avManifestation">
120
							<xsl:variable name="status">
121
								<xsl:value-of
122
										select="translate(normalize-space(.//efg:digitalFormat/efg:status), $upper, $small)"
123
								/>
124
							</xsl:variable>
125

    
126
							<xsl:choose>
127
								<xsl:when test="$status != 'born digital'">
128
									<xsl:variable name="rightStatus">
129
										<xsl:value-of
130
												select="translate(normalize-space(.//efg:rightsStatus), $upper, $small)"
131
										/>
132
									</xsl:variable>
133

    
134
									<edm:aggregatedCHO>
135
										<xsl:attribute name="rdf:resource">
136
											<xsl:value-of select=".//efg:isShownBy"/>
137
										</xsl:attribute>
138
									</edm:aggregatedCHO>
139
									<xsl:variable name="rightStatus">
140
										<xsl:value-of
141
												select="translate(normalize-space(.//efg:rightsStatus), $upper, $small)"
142
										/>
143
									</xsl:variable>
144
									<xsl:choose>
145
										<xsl:when test="$rightStatus = 'copyright protected'">
146
											<edm:rights>http://www.europeana.eu/rights/rr-f/</edm:rights>
147
										</xsl:when>
148
										<xsl:when test="$rightStatus = 'not copyright protected'">
149
											<edm:rights>http://creativecommons.org/publicdomain/mark/1.0/</edm:rights>
150
										</xsl:when>
151
										<xsl:when test="$rightStatus = 'public domain'">
152
											<edm:rights>http://creativecommons.org/publicdomain/mark/1.0/</edm:rights>
153
										</xsl:when>
154
										<xsl:when test="$rightStatus = 'orphan'">
155
											<edm:rights>http://www.europeana.eu/rights/orphan-work-eu/</edm:rights>
156
										</xsl:when>
157
										<xsl:when
158
												test="$rightStatus = 'no known copyright / orphan work'">
159
											<edm:rights>http://www.europeana.eu/rights/orphan-work-eu/</edm:rights>
160
										</xsl:when>
161
										<xsl:otherwise>
162
											<edm:rights>http://www.europeana.eu/rights/rr-f/</edm:rights>
163
										</xsl:otherwise>
164
									</xsl:choose>
165

    
166
									<dc:rights>
167
										<xsl:value-of select=".//efg:rightsHolder"/>
168
									</dc:rights>
169

    
170
									<xsl:choose>
171
										<xsl:when test="string-length($rightStatus) &gt; 0">
172
											<edm:rights>
173
												<xsl:value-of select="$rightStatus"/>
174
											</edm:rights>
175
										</xsl:when>
176
									</xsl:choose>
177
									<xsl:for-each select="//efg:isShownBy">
178
										<edm:isShownBy>
179
											<xsl:value-of select="."/>
180
										</edm:isShownBy>
181
									</xsl:for-each>
182
									<xsl:for-each select="//efg:isShownAt">
183
										<edm:isShownAt>
184
											<xsl:value-of select="."/>
185
										</edm:isShownAt>
186
									</xsl:for-each>
187

    
188
									<xsl:choose>
189
										<xsl:when test="count(//efg:thumbnail) &gt; 0">
190
											<xsl:for-each select="//efg:thumbnail">
191
												<edm:object>
192
													<xsl:value-of select="."/>
193
												</edm:object>
194
											</xsl:for-each>
195
										</xsl:when>
196
										<xsl:otherwise>
197
											<xsl:for-each select="//efg:isShownBy">
198
												<edm:object>
199
													<xsl:value-of select="."/>
200
												</edm:object>
201
											</xsl:for-each>
202
										</xsl:otherwise>
203
									</xsl:choose>
204

    
205

    
206
								</xsl:when>
207
							</xsl:choose>
208

    
209
						</xsl:for-each>
210

    
211
						<xsl:for-each select="//efg:nonAVManifestation">
212
							<xsl:variable name="status">
213
								<xsl:value-of
214
										select="translate(normalize-space(.//efg:digitalFormat/efg:status), $upper, $small)"
215
								/>
216
							</xsl:variable>
217

    
218
							<xsl:choose>
219
								<xsl:when test="$status != 'born digital'">
220
									<xsl:variable name="rightStatus">
221
										<xsl:value-of
222
												select="translate(normalize-space(.//efg:rightsStatus), $upper, $small)"
223
										/>
224
									</xsl:variable>
225

    
226
									<edm:aggregatedCHO>
227
										<xsl:attribute name="rdf:resource">
228
											<xsl:value-of select=".//efg:isShownBy"/>
229
										</xsl:attribute>
230
									</edm:aggregatedCHO>
231
									<xsl:variable name="rightStatus">
232
										<xsl:value-of
233
												select="translate(normalize-space(.//efg:rightsStatus), $upper, $small)"
234
										/>
235
									</xsl:variable>
236
									<xsl:choose>
237
										<xsl:when test="$rightStatus = 'copyright protected'">
238
											<edm:rights>http://www.europeana.eu/rights/rr-f/</edm:rights>
239
										</xsl:when>
240
										<xsl:when test="$rightStatus = 'not copyright protected'">
241
											<edm:rights>http://creativecommons.org/publicdomain/mark/1.0/</edm:rights>
242
										</xsl:when>
243
										<xsl:when test="$rightStatus = 'public domain'">
244
											<edm:rights>http://creativecommons.org/publicdomain/mark/1.0/</edm:rights>
245
										</xsl:when>
246
										<xsl:when test="$rightStatus = 'orphan'">
247
											<edm:rights>http://www.europeana.eu/rights/orphan-work-eu/</edm:rights>
248
										</xsl:when>
249
										<xsl:when
250
												test="$rightStatus = 'no known copyright / orphan work'">
251
											<edm:rights>http://www.europeana.eu/rights/orphan-work-eu/</edm:rights>
252
										</xsl:when>
253
										<xsl:otherwise>
254
											<edm:rights>http://www.europeana.eu/rights/rr-f/</edm:rights>
255
										</xsl:otherwise>
256
									</xsl:choose>
257
									<xsl:for-each select="//efg:isShownBy">
258
										<edm:isShownBy>
259
											<xsl:value-of select="."/>
260
										</edm:isShownBy>
261
									</xsl:for-each>
262
									<xsl:for-each select="//efg:isShownAt">
263
										<edm:isShownAt>
264
											<xsl:value-of select="."/>
265
										</edm:isShownAt>
266
									</xsl:for-each>
267
									<dc:rights>
268
										<xsl:value-of select=".//efg:rightsHolder"/>
269
									</dc:rights>
270
									<xsl:choose>
271
										<xsl:when test="count(//efg:thumbnail) &gt; 0">
272
											<xsl:for-each select="//efg:thumbnail">
273
												<edm:object>
274
													<xsl:value-of select="."/>
275
												</edm:object>
276
											</xsl:for-each>
277
										</xsl:when>
278
										<xsl:otherwise>
279
											<xsl:for-each select="//efg:isShownBy">
280
												<edm:object>
281
													<xsl:value-of select="."/>
282
												</edm:object>
283
											</xsl:for-each>
284
										</xsl:otherwise>
285
									</xsl:choose>
286

    
287

    
288
								</xsl:when>
289
							</xsl:choose>
290

    
291
						</xsl:for-each>
292

    
293

    
294
						<edm:dataProvider>
295
							<xsl:value-of select="$efg_provider"/>
296
						</edm:dataProvider>
297
						<edm:provider>EFG - The European Film Gateway</edm:provider>
298

    
299
					</ore:Aggregation>
300

    
301

    
302
					<edm:ProvidedCHO>
303
						<xsl:attribute name="rdf:about">
304
							<xsl:value-of select="//efg:recordSource[1]/efg:sourceID"/>
305
						</xsl:attribute>
306
						<xsl:for-each select="//efg:sourceID">
307
							<dc:identifier>
308
								<xsl:value-of select="."/>
309
							</dc:identifier>
310
						</xsl:for-each>
311
						<xsl:for-each select="//efg:language">
312
							<dc:language>
313
								<xsl:value-of select="."/>
314
							</dc:language>
315
						</xsl:for-each>
316

    
317
						<xsl:for-each select="//efg:avcreation//efg:relPerson">
318
							<xsl:variable name="person_type"
319
							              select="translate(normalize-space(./efg:type), $upper, $small)"/>
320
							<xsl:choose>
321
								<xsl:when
322
										test="$person_type = 'director of photography' or $person_type = 'screenplay' or $person_type = 'editor' or $person_type = 'music composer'">
323
									<dc:contributor>
324
										<xsl:value-of select="./efg:name"/>
325
									</dc:contributor>
326
								</xsl:when>
327
								<xsl:when test="$person_type = 'director'">
328
									<dc:creator>
329
										<xsl:value-of select="./efg:name"/>
330
									</dc:creator>
331
								</xsl:when>
332
								<xsl:when
333
										test="
334
										$person_type = 'publisher' or $person_type = 'creator' or $person_type = 'designer' or $person_type = 'photographer'
335
										or $person_type = 'lithographer' or $person_type = 'book designer' or $person_type = 'author'
336
										or $person_type = 'lyrics' or $person_type = 'composer' or $person_type = 'illustrator' or $person_type = 'artist'
337
										or $person_type = 'manufacturer' or $person_type = 'attributed to' or $person_type = 'stills photographer'">
338
									<dc:creator>
339
										<xsl:value-of select="./efg:name"/>
340
									</dc:creator>
341
								</xsl:when>
342
							</xsl:choose>
343
						</xsl:for-each>
344

    
345

    
346
						<xsl:for-each select="//efg:nonavcreation//efg:relPerson">
347
							<xsl:variable name="person_type"
348
							              select="translate(normalize-space(./efg:type), $upper, $small)"/>
349
							<xsl:choose>
350
								<xsl:when
351
										test="
352
									$person_type = 'creator' or $person_type = 'designer' or $person_type = 'photographer'
353
									or $person_type = 'lithographer' or $person_type = 'book designer' or $person_type = 'author'
354
									or $person_type = 'lyrics' or $person_type = 'composer' or $person_type = 'illustrator' or $person_type = 'artist'
355
									or $person_type = 'manufacturer' or $person_type = 'attributed to' or $person_type = 'stills photographer'">
356
									<dc:creator>
357
										<xsl:value-of select="./efg:name"/>
358
									</dc:creator>
359
								</xsl:when>
360
							</xsl:choose>
361
						</xsl:for-each>
362

    
363

    
364
						<xsl:for-each select="//efg:relCorporate">
365
							<xsl:variable name="corporate_type"
366
							              select="translate(normalize-space(./efg:type), $upper, $small)"/>
367
							<xsl:choose>
368
								<xsl:when test="$corporate_type = 'production company'">
369
									<dc:contributor>
370
										<xsl:value-of select="./efg:name"/>
371
									</dc:contributor>
372
								</xsl:when>
373
								<xsl:when test="$corporate_type = 'publisher'">
374
									<dc:publisher>
375
										<xsl:value-of select="./efg:name"/>
376
									</dc:publisher>
377
								</xsl:when>
378
							</xsl:choose>
379
						</xsl:for-each>
380

    
381
						<xsl:for-each select="//efg:description">
382
							<dc:description>
383
								<xsl:attribute name="xml:lang">
384
									<xsl:value-of select="./@lang"/>
385
								</xsl:attribute>
386
								<xsl:value-of select="."/>
387
							</dc:description>
388
						</xsl:for-each>
389
						<xsl:for-each select="//efg:DigitalFormat">
390
							<xsl:choose>
391
								<xsl:when test="./Status = 'Born digital'">
392
									<dc:format>
393
										<xsl:value-of select="./efg:Container"/>
394
									</dc:format>
395
								</xsl:when>
396
							</xsl:choose>
397

    
398
						</xsl:for-each>
399

    
400

    
401
						<xsl:for-each select="//efg:avcreation//efg:keywords">
402
							<xsl:variable name="keyword_type"
403
							              select="translate(normalize-space(./@type), $upper, $small)"/>
404
							<xsl:choose>
405
								<xsl:when
406
										test="$keyword_type = 'genre' or $keyword_type = 'lcsh' or $keyword_type = 'person' or $keyword_type = 'subject' or $keyword_type = 'place' or $keyword_type = 'project' or $keyword_type = 'n/a'">
407
									<dcterms:subject>
408
										<xsl:attribute name="xml:lang">
409
											<xsl:value-of select="@lang"/>
410
										</xsl:attribute>
411
										<xsl:value-of select="./efg:term"/>
412
									</dcterms:subject>
413
								</xsl:when>
414

    
415
								<xsl:when test="$keyword_type = 'form'">
416
									<dc:type>
417
										<xsl:attribute name="xml:lang">
418
											<xsl:value-of select="@lang"/>
419
										</xsl:attribute>
420
										<xsl:value-of select="./efg:term"/>
421
									</dc:type>
422
								</xsl:when>
423
							</xsl:choose>
424
						</xsl:for-each>
425
						<xsl:for-each select="//efg:nonavcreation//efg:keywords">
426
							<dcterms:subject>
427
								<xsl:attribute name="xml:lang">
428
									<xsl:value-of select="@lang"/>
429
								</xsl:attribute>
430
								<xsl:value-of select="./efg:term"/>
431
							</dcterms:subject>
432
						</xsl:for-each>
433

    
434

    
435
						<xsl:choose>
436
							<xsl:when test="count(//efg:avManifestation//efg:title) &gt; 0">
437
								<xsl:for-each select="//efg:avManifestation//efg:title">
438
									<xsl:variable name="title_rel"
439
									              select="translate(normalize-space(./efg:relation), $upper, $small)"/>
440
									<xsl:choose>
441
										<xsl:when test="$title_rel = 'original title'">
442
											<dc:title>
443
												<xsl:attribute name="xml:lang">
444
													<xsl:value-of select="@lang"/>
445
												</xsl:attribute>
446
												<xsl:value-of select="./efg:text"/>
447
											</dc:title>
448
										</xsl:when>
449
										<xsl:when test="$title_rel = 'main title'">
450
											<dc:title>
451
												<xsl:attribute name="xml:lang">
452
													<xsl:value-of select="@lang"/>
453
												</xsl:attribute>
454
												<xsl:value-of select="./efg:text"/>
455
											</dc:title>
456
										</xsl:when>
457
										<xsl:otherwise>
458
											<dcterms:alternative>
459
												<xsl:attribute name="xml:lang">
460
													<xsl:value-of select="@lang"/>
461
												</xsl:attribute>
462
												<xsl:value-of select="./efg:text"/>
463
											</dcterms:alternative>
464
										</xsl:otherwise>
465
									</xsl:choose>
466
								</xsl:for-each>
467
							</xsl:when>
468
							<xsl:otherwise>
469
								<xsl:for-each select="//efg:avcreation//efg:title">
470
									<xsl:variable name="title_rel"
471
									              select="translate(normalize-space(./efg:relation), $upper, $small)"/>
472
									<xsl:choose>
473
										<xsl:when test="$title_rel = 'original title'">
474
											<dc:title>
475
												<xsl:attribute name="xml:lang">
476
													<xsl:value-of select="@lang"/>
477
												</xsl:attribute>
478
												<xsl:value-of select="./efg:text"/>
479
											</dc:title>
480
										</xsl:when>
481
										<xsl:when test="$title_rel = 'main title'">
482
											<dc:title>
483
												<xsl:attribute name="xml:lang">
484
													<xsl:value-of select="@lang"/>
485
												</xsl:attribute>
486
												<xsl:value-of select="./efg:text"/>
487
											</dc:title>
488
										</xsl:when>
489
										<xsl:otherwise>
490
											<dcterms:alternative>
491
												<xsl:attribute name="xml:lang">
492
													<xsl:value-of select="@lang"/>
493
												</xsl:attribute>
494
												<xsl:value-of select="./efg:text"/>
495
											</dcterms:alternative>
496
										</xsl:otherwise>
497
									</xsl:choose>
498
								</xsl:for-each>
499
							</xsl:otherwise>
500
						</xsl:choose>
501

    
502
						<xsl:choose>
503
							<xsl:when test="count(//efg:nonAVManifestation//efg:title) &gt; 0">
504

    
505
								<xsl:for-each select="//efg:nonAVManifestation//efg:title">
506
									<xsl:variable name="title_rel"
507
									              select="translate(normalize-space(./efg:relation), $upper, $small)"/>
508
									<xsl:choose>
509
										<xsl:when test="$title_rel = 'original title'">
510
											<dc:title>
511
												<xsl:attribute name="xml:lang">
512
													<xsl:value-of select="@lang"/>
513
												</xsl:attribute>
514
												<xsl:value-of select="./efg:text"/>
515
											</dc:title>
516
										</xsl:when>
517
										<xsl:when test="$title_rel = 'main title'">
518
											<dc:title>
519
												<xsl:attribute name="xml:lang">
520
													<xsl:value-of select="@lang"/>
521
												</xsl:attribute>
522
												<xsl:value-of select="./efg:text"/>
523
											</dc:title>
524
										</xsl:when>
525
										<xsl:otherwise>
526
											<dcterms:alternative>
527
												<xsl:attribute name="xml:lang">
528
													<xsl:value-of select="@lang"/>
529
												</xsl:attribute>
530
												<xsl:value-of select="./efg:text"/>
531
											</dcterms:alternative>
532
										</xsl:otherwise>
533
									</xsl:choose>
534
								</xsl:for-each>
535
							</xsl:when>
536
							<xsl:otherwise>
537

    
538
								<xsl:for-each select="//efg:nonavcreation//efg:title">
539
									<xsl:variable name="title_rel"
540
									              select="translate(normalize-space(./efg:relation), $upper, $small)"/>
541
									<xsl:choose>
542
										<xsl:when test="$title_rel = 'original title'">
543
											<dc:title>
544
												<xsl:attribute name="xml:lang">
545
													<xsl:value-of select="@lang"/>
546
												</xsl:attribute>
547
												<xsl:value-of select="./efg:text"/>
548
											</dc:title>
549
										</xsl:when>
550
										<xsl:when test="$title_rel = 'main title'">
551
											<dc:title>
552
												<xsl:attribute name="xml:lang">
553
													<xsl:value-of select="@lang"/>
554
												</xsl:attribute>
555
												<xsl:value-of select="./efg:text"/>
556
											</dc:title>
557
										</xsl:when>
558
										<xsl:otherwise>
559
											<dcterms:alternative>
560
												<xsl:attribute name="xml:lang">
561
													<xsl:value-of select="@lang"/>
562
												</xsl:attribute>
563
												<xsl:value-of select="./efg:text"/>
564
											</dcterms:alternative>
565
										</xsl:otherwise>
566
									</xsl:choose>
567
								</xsl:for-each>
568

    
569
							</xsl:otherwise>
570
						</xsl:choose>
571

    
572

    
573
						<xsl:for-each select="//efg:specificType">
574
							<xsl:choose>
575
								<xsl:when
576
										test="count(normalize-space(.)) &gt; 0 and normalize-space(.) != 'n/a'">
577
									<dc:type>
578
										<xsl:value-of select="."/>
579
									</dc:type>
580
								</xsl:when>
581
								<xsl:otherwise>
582
									<dc:type>
583
										<xsl:value-of
584
												select="//efg:avManifestation/efg:item/efg:type"/>
585
									</dc:type>
586
								</xsl:otherwise>
587
							</xsl:choose>
588
						</xsl:for-each>
589

    
590
						<xsl:for-each select="//efg:productionYear">
591
							<dcterms:created>
592
								<xsl:value-of select="."/>
593
							</dcterms:created>
594
						</xsl:for-each>
595

    
596
						<xsl:for-each select="//efg:nonAVManifestation/efg:dateCreated">
597
							<dcterms:created>
598
								<xsl:value-of select="."/>
599
							</dcterms:created>
600
						</xsl:for-each>
601
						<xsl:for-each select="//efg:physicalFormat">
602
							<dc:format>
603
								<xsl:value-of select="./@size"/>
604
							</dc:format>
605
						</xsl:for-each>
606
						<xsl:for-each
607
								select="//efg:nonAVManifestation/efg:date[./efg:type = 'issued']">
608
							<dcterms:issued>
609
								<xsl:value-of select="."/>
610
							</dcterms:issued>
611
						</xsl:for-each>
612
						<xsl:for-each select="//efg:coverage/efg:spatial">
613
							<dcterms:spatial>
614
								<xsl:value-of select="."/>
615
							</dcterms:spatial>
616
						</xsl:for-each>
617

    
618
						<xsl:for-each select="//efg:geographicScope/efg:place">
619
							<dcterms:spatial>
620
								<xsl:value-of select="."/>
621
							</dcterms:spatial>
622
						</xsl:for-each>
623
						<xsl:for-each select="//efg:countryOfReference">
624
							<dcterms:spatial>
625
								<xsl:value-of select="."/>
626
							</dcterms:spatial>
627
						</xsl:for-each>
628
						<xsl:for-each select="//efg:coverage/efg:temporal">
629
							<dcterms:temporal>
630
								<xsl:value-of select="."/>
631
							</dcterms:temporal>
632
						</xsl:for-each>
633
						<xsl:for-each select="//efg:item/efg:type">
634
							<edm:type>
635
								<xsl:value-of select="."/>
636
							</edm:type>
637
						</xsl:for-each>
638
						<xsl:for-each select="//efg:avManifestation//efg:provenance">
639
							<dcterms:provenance>
640
								<xsl:value-of select="."/>
641
							</dcterms:provenance>
642
						</xsl:for-each>
643
					</edm:ProvidedCHO>
644

    
645

    
646
					<xsl:for-each select="//efg:avManifestation">
647
						<xsl:variable name="status">
648
							<xsl:value-of
649
									select="translate(normalize-space(.//efg:digitalFormat/efg:status), $upper, $small)"
650
							/>
651
						</xsl:variable>
652

    
653
						<xsl:choose>
654
							<xsl:when test="$status != 'born digital'">
655
								<edm:WebResource>
656
									<xsl:attribute name="rdf:about">
657
										<xsl:value-of select=".//efg:isShownBy"/>
658
									</xsl:attribute>
659
									<dc:format>
660
										<xsl:value-of select="$status"/>
661
									</dc:format>
662
									<xsl:for-each select=".//efg:duration">
663
										<dcterms:extent>
664
											<xsl:value-of select="."/>
665
										</dcterms:extent>
666
									</xsl:for-each>
667
									<xsl:variable name="rightStatus">
668
										<xsl:value-of
669
												select="translate(normalize-space(.//efg:rightsStatus), $upper, $small)"
670
										/>
671
									</xsl:variable>
672
									<xsl:choose>
673
										<xsl:when test="$rightStatus = 'copyright protected'">
674
											<edm:rights>http://www.europeana.eu/rights/rr-f/</edm:rights>
675
										</xsl:when>
676
										<xsl:when test="$rightStatus = 'not copyright protected'">
677
											<edm:rights>http://creativecommons.org/publicdomain/mark/1.0/</edm:rights>
678
										</xsl:when>
679
										<xsl:when test="$rightStatus = 'public domain'">
680
											<edm:rights>http://creativecommons.org/publicdomain/mark/1.0/</edm:rights>
681
										</xsl:when>
682
										<xsl:when test="$rightStatus = 'orphan'">
683
											<edm:rights>http://www.europeana.eu/rights/orphan-work-eu/</edm:rights>
684
										</xsl:when>
685
										<xsl:when
686
												test="$rightStatus = 'no known copyright / orphan work'">
687
											<edm:rights>http://www.europeana.eu/rights/orphan-work-eu/</edm:rights>
688
										</xsl:when>
689
										<xsl:otherwise>
690
											<edm:rights>http://www.europeana.eu/rights/rr-f/</edm:rights>
691
										</xsl:otherwise>
692
									</xsl:choose>
693
								</edm:WebResource>
694
							</xsl:when>
695
						</xsl:choose>
696

    
697
					</xsl:for-each>
698

    
699

    
700
					<xsl:for-each select="//efg:nonAVManifestation">
701
						<xsl:variable name="status">
702
							<xsl:value-of
703
									select="translate(normalize-space(.//efg:digitalFormat/efg:status), $upper, $small)"
704
							/>
705
						</xsl:variable>
706

    
707
						<xsl:choose>
708
							<xsl:when test="$status != 'born digital'">
709
								<edm:WebResource>
710
									<xsl:attribute name="rdf:about">
711
										<xsl:value-of select=".//efg:isShownBy"/>
712
									</xsl:attribute>
713
									<dc:format>
714
										<xsl:value-of select="$status"/>
715
									</dc:format>
716
									<xsl:for-each select=".//efg:duration">
717
										<dcterms:extent>
718
											<xsl:value-of select="."/>
719
										</dcterms:extent>
720
									</xsl:for-each>
721
									<xsl:variable name="rightStatus">
722
										<xsl:value-of select="translate(normalize-space(.//efg:rightsStatus), $upper, $small)"
723
										/>
724
									</xsl:variable>
725
									<xsl:choose>
726
										<xsl:when test="$rightStatus = 'copyright protected'">
727
											<edm:rights>http://www.europeana.eu/rights/rr-f/</edm:rights>
728
										</xsl:when>
729
										<xsl:when test="$rightStatus = 'not copyright protected'">
730
											<edm:rights>http://creativecommons.org/publicdomain/mark/1.0/</edm:rights>
731
										</xsl:when>
732
										<xsl:when test="$rightStatus = 'public domain'">
733
											<edm:rights>http://creativecommons.org/publicdomain/mark/1.0/</edm:rights>
734
										</xsl:when>
735
										<xsl:when test="$rightStatus = 'orphan'">
736
											<edm:rights>http://www.europeana.eu/rights/orphan-work-eu/</edm:rights>
737
										</xsl:when>
738
										<xsl:when
739
												test="$rightStatus = 'no known copyright / orphan work'">
740
											<edm:rights>http://www.europeana.eu/rights/orphan-work-eu/</edm:rights>
741
										</xsl:when>
742
										<xsl:otherwise>
743
											<edm:rights>http://www.europeana.eu/rights/rr-f/</edm:rights>
744
										</xsl:otherwise>
745
									</xsl:choose>
746
								</edm:WebResource>
747
							</xsl:when>
748
						</xsl:choose>
749
					</xsl:for-each>
750
				</rdf:RDF>
751
			</metadata>
752
		</record>
753
	</xsl:template>
754

    
755

    
756
	<xsl:template name="distinct">
757
		<xsl:param name="var"/>
758

    
759
		<xsl:variable name="svar">
760
			<xsl:for-each select="exslt:node-set($var)/*">
761
				<xsl:sort select="."/>
762
				<xsl:copy-of select="."/>
763
			</xsl:for-each>
764
		</xsl:variable>
765

    
766
		<xsl:for-each select="exslt:node-set($svar)/*">
767
			<xsl:variable name="pos" select="position()"/>
768
			<xsl:if test="string(../child::*[$pos - 1]) != string(.)">
769
				<xsl:copy-of select="."/>
770
			</xsl:if>
771
		</xsl:for-each>
772
	</xsl:template>
773

    
774

    
775
</xsl:stylesheet>
    (1-1/1)