Project

General

Profile

1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="efg2edm_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
		<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
		<RESOURCE_KIND value="TransformationRuleDSResources"/>
6
		<RESOURCE_URI value=""/>
7
		<DATE_OF_CREATION value="2015-09-22T13:13:03+02:00"/>
8
	</HEADER>
9
	<BODY>
10
		<CONFIGURATION>
11
			<IMPORTED/>
12
			<SCRIPT>
13
				<TITLE>Efg to EDM</TITLE>
14
				<CODE>
15
					<![CDATA[
16
					<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
17
    xmlns:efg="http://www.europeanfilmgateway.eu/efg" xmlns:dc="http://purl.org/dc/elements/1.1/"
18
    xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xs="http://www.w3.org/2001/XMLSchema"
19
    xmlns:dri="http://www.driver-repository.eu/namespace/dri"
20
    xmlns:edm="http://www.europeana.eu/schemas/edm/" xmlns:exslt="http://exslt.org/common"
21
    version="1.0" exclude-result-prefixes="xsl exslt">
22

    
23
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
24

    
25
    <xsl:variable name="small" select="'abcdefghijklmnopqrstuvwxyz'"/>
26
    <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
27

    
28
    <xsl:template match="/">
29
        <objectRecord>
30
            <xsl:variable name="body">
31
                <xsl:if
32
                    test="
33
                        (count(//efg:title) &gt; 0 or count(//efg:description) &gt; 0) and
34
                        (count(//efg:item/efg:isShownBy) &gt; 0 or count(//efg:item/efg:isShownAt) &gt; 0)">
35
                    <xsl:value-of select="'true'"/>
36
                </xsl:if>
37
            </xsl:variable>
38
            <xsl:variable name="keywords">
39
                <xsl:if
40
                    test="
41
                        (count(//efg:avcreation//efg:keywords[
42
                        translate(normalize-space(@type), $upper, $small) = 'genre' or
43
                        translate(normalize-space(@type), $upper, $small) = 'lcsh' or
44
                        translate(normalize-space(@type), $upper, $small) = 'person' or
45
                        translate(normalize-space(@type), $upper, $small) = 'subject' or
46
                        translate(normalize-space(@type), $upper, $small) = 'place' or
47
                        translate(normalize-space(@type), $upper, $small) = 'project' or
48
                        translate(normalize-space(@type), $upper, $small) = 'n/a' or
49
                        translate(normalize-space(@type), $upper, $small) = 'form']) &gt; 0 or
50
                        count(//efg:nonavcreation//efg:keywords) &gt; 0)
51
                        or
52
                        (count(//efg:avManifestation/efg:coverage/efg:spatial) &gt; 0 or
53
                        count(//efg:avcreation/efg:countryOfReference) &gt; 0 or
54
                        count(//efg:nonAVManifestation/efg:coverage/efg:spatial) &gt; 0 or
55
                        count(//efg:nonAVManifestation/efg:geographicScope) &gt; 0)
56
                        or
57
                        (count(//efg:avManifestation/efg:coverage/efg:temporal) &gt; 0 or
58
                        count(//efg:nonAVManifestation/efg:coverage/efg:temporal) &gt; 0)">
59
                    <xsl:value-of select="'true'"/>
60
                </xsl:if>
61
            </xsl:variable>
62
            <xsl:choose>
63
                <xsl:when test="$body = 'true' and $keywords = 'true'">
64
                    <!--exslt:node-set($body)/*">-->
65
                    <xsl:apply-templates select=".//efg:efgEntity/efg:avcreation"/>
66
                    <xsl:apply-templates select=".//efg:efgEntity/efg:nonavcreation"/>
67
                </xsl:when>
68
                <xsl:otherwise>
69

    
70
                    <JUNK/>
71
                </xsl:otherwise>
72
            </xsl:choose>
73
        </objectRecord>
74
    </xsl:template>
75

    
76
    <xsl:template match="identifier | dri:objIdentifier | dri:recordIdentifier" mode="header">
77
        <xsl:param name="pos"/>
78
        <xsl:copy>
79
            <xsl:value-of select="concat(text(), '-', $pos)"/>
80
        </xsl:copy>
81
    </xsl:template>
82

    
83
    <xsl:template match="*" mode="header">
84
        <xsl:param name="pos"/>
85
        <xsl:copy-of select="."/>
86
    </xsl:template>
87

    
88
    <xsl:template name="lang">
89
        <xsl:if test="string-length(@lang) = 2">
90
            <xsl:attribute name="xml:lang">
91
                <xsl:value-of select="translate(@lang, $upper, $small)"/>
92
            </xsl:attribute>
93
        </xsl:if>
94

    
95
    </xsl:template>
96

    
97
    <xsl:template name="rigths">
98
        <xsl:param name="rightStatus"/>
99
        <xsl:choose>
100
            <xsl:when test="$rightStatus = 'copyright protected'">
101
                <edm:rights>http://www.europeana.eu/rights/rr-f/</edm:rights>
102
            </xsl:when>
103
            <xsl:when test="$rightStatus = 'not copyright protected'">
104
                <edm:rights>http://creativecommons.org/publicdomain/mark/1.0/</edm:rights>
105
            </xsl:when>
106
            <xsl:when test="$rightStatus = 'public domain'">
107
                <edm:rights>http://creativecommons.org/publicdomain/mark/1.0/</edm:rights>
108
            </xsl:when>
109
            <xsl:when test="$rightStatus = 'orphan'">
110
                <edm:rights>http://www.europeana.eu/rights/orphan-work-eu/</edm:rights>
111
            </xsl:when>
112
            <xsl:when test="$rightStatus = 'no known copyright / orphan work'">
113
                <edm:rights>http://www.europeana.eu/rights/orphan-work-eu/</edm:rights>
114
            </xsl:when>
115
            <xsl:otherwise>
116
                <edm:rights>http://www.europeana.eu/rights/rr-f/</edm:rights>
117
            </xsl:otherwise>
118
        </xsl:choose>
119
    </xsl:template>
120

    
121
    <xsl:template match="efg:avcreation | efg:nonavcreation">
122
        <xsl:variable name="creationType" select="local-name(.)"/>
123

    
124
        <xsl:variable name="navct"
125
            select="efg:title/efg:relation[translate(normalize-space(.), $upper, $small) = 'main title']"/>
126
        <xsl:variable name="avct"
127
            select="efg:title/efg:relation[translate(normalize-space(.), $upper, $small) = 'original title']"/>
128

    
129
        <xsl:variable name="existnavct" select="count(//efg:nonavcreation/efg:title)"/>
130
        <xsl:variable name="existavct" select="count(//efg:avcreation/efg:title)"/>
131
        <xsl:variable name="lang"
132
            select="count(//efg:nonavcreation//efg:language) = 0 and efg:nonAVManifestation"/>
133
        <record>
134
            <header>
135
                <xsl:apply-templates select="/record/header/*" mode="header">
136
                    <xsl:with-param name="pos">
137
                        <xsl:value-of select="position()"/>
138
                    </xsl:with-param>
139
                </xsl:apply-templates>
140
            </header>
141
            <metadata>
142
                <rdf:RDF xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
143
                    xmlns:dc="http://purl.org/dc/elements/1.1/"
144
                    xmlns:edm="http://www.europeana.eu/schemas/edm/"
145
                    xmlns:ore="http://www.openarchives.org/ore/terms/"
146
                    xmlns:dcterms="http://purl.org/dc/terms/"
147
                    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
148
                    xsi:schemaLocation="http://www.w3.org/1999/02/22-rdf-syntax-ns# EDM-INTERNAL.xsd">
149

    
150
                    <xsl:variable name="efg_provider" select="//efg:provider"/>
151

    
152

    
153
                    <ore:Aggregation>
154
                        <xsl:attribute name="rdf:about">
155
                            <!-- <xsl:value-of select="concat('AGGR::', $efg_provider, //efg:sourceID)"/>-->
156
                            <xsl:value-of select="efg:recordSource/efg:sourceID"/>
157
                        </xsl:attribute>
158

    
159
                        <edm:aggregatedCHO>
160
                            <xsl:attribute name="rdf:resource">
161
                                <xsl:value-of select="efg:recordSource/efg:sourceID"/>
162
                            </xsl:attribute>
163
                        </edm:aggregatedCHO>
164

    
165

    
166

    
167
                        <xsl:for-each select="//efg:avManifestation">
168

    
169
                            <!--       <edm:aggregatedCHO>
170
                                <xsl:attribute name="rdf:resource">
171
                                    <xsl:value-of select=".//efg:identifier"/>
172
                                </xsl:attribute>
173
                            </edm:aggregatedCHO> -->
174
                            <xsl:if test="string-length(//efg:isShownBy[1]) &gt; 0">
175

    
176
                                <edm:isShownBy>
177
                                    <xsl:value-of select="."/>
178
                                </edm:isShownBy>
179

    
180
                            </xsl:if>
181
                            <xsl:for-each select="//efg:isShownBy[position() &gt; 1]">
182

    
183
                                <edm:hasView>
184
                                    <xsl:value-of select="."/>
185
                                </edm:hasView>
186
                            </xsl:for-each>
187
                            <xsl:if test="string-length(//efg:isShownAt[1]) &gt; 0">
188
                                <edm:isShownAt>
189
                                    <xsl:value-of select="."/>
190
                                </edm:isShownAt>
191
                            </xsl:if>
192

    
193
                            <xsl:for-each select="//efg:thumbnail">
194
                                <edm:object>
195
                                    <xsl:value-of select="."/>
196
                                </edm:object>
197
                            </xsl:for-each>
198
                            <xsl:call-template name="rigths">
199
                                <xsl:with-param name="rightStatus" select="efg:rightsStatus"/>
200
                            </xsl:call-template>
201
                        </xsl:for-each>
202

    
203

    
204
                        <xsl:for-each select="//efg:nonAVManifestation">
205

    
206
                            <!--      <edm:aggregatedCHO>
207
                                <xsl:attribute name="rdf:resource">
208
                                    <xsl:value-of select=".//efg:identifier"/>
209
                                </xsl:attribute>
210
                            </edm:aggregatedCHO>-->
211

    
212
                            <xsl:if test="string-length(//efg:isShownBy[1]) &gt; 0">
213
                                <edm:isShownBy>
214
                                    <xsl:value-of select="//efg:isShownBy[1]"/>
215
                                </edm:isShownBy>
216
                                <!-- </xsl:for-each> -->
217
                            </xsl:if>
218
                            <xsl:for-each select="//efg:isShownBy[position() &gt; 1]">
219

    
220
                                <edm:hasView>
221
                                    <xsl:value-of select="."/>
222
                                </edm:hasView>
223
                            </xsl:for-each>
224
                            <xsl:if test="string-length(//efg:isShownAt[1]) &gt; 0">
225
                                <edm:isShownAt>
226
                                    <xsl:value-of select="//efg:isShownAt[1]"/>
227
                                </edm:isShownAt>
228
                            </xsl:if>
229

    
230
                            <xsl:choose>
231
                                <xsl:when test="//efg:thumbnail">
232
                                    <xsl:for-each select="//efg:thumbnail">
233
                                        <edm:object>
234
                                            <xsl:value-of select="."/>
235
                                        </edm:object>
236
                                    </xsl:for-each>
237
                                </xsl:when>
238
                                <xsl:otherwise>
239
                                    <xsl:if test="//efg:isShownBy">
240
                                        <edm:object>
241
                                            <xsl:value-of select="//efg:isShownBy[1]"/>
242
                                        </edm:object>
243
                                    </xsl:if>
244

    
245
                                </xsl:otherwise>
246
                            </xsl:choose>
247
                            <xsl:call-template name="rigths">
248
                                <xsl:with-param name="rightStatus" select="efg:rightsStatus"/>
249
                            </xsl:call-template>
250
                        </xsl:for-each>
251

    
252
                        <xsl:if test=".//efg:rightsHolder">
253
                            <dc:rights>
254
                                <xsl:value-of select=".//efg:rightsHolder"/>
255
                            </dc:rights>
256
                        </xsl:if>
257

    
258
                        <edm:dataProvider>
259
                            <xsl:value-of select="$efg_provider"/>
260
                        </edm:dataProvider>
261
                        <edm:provider>EFG - The European Film Gateway</edm:provider>
262

    
263

    
264

    
265

    
266

    
267
                    </ore:Aggregation>
268

    
269
                    <edm:ProvidedCHO>
270
                        <xsl:attribute name="rdf:about">
271
                            <xsl:value-of select="//efg:recordSource[1]/efg:sourceID"/>
272
                        </xsl:attribute>
273
                        <xsl:for-each select="efg:recordSource/efg:sourceID">
274
                            <dc:identifier>
275
                                <xsl:value-of select="."/>
276
                            </dc:identifier>
277
                        </xsl:for-each>
278

    
279
                        <!-- dc:language -->
280
                        <xsl:for-each select="//efg:language">
281
                            <dc:language>
282
                                <xsl:value-of select="."/>
283
                            </dc:language>
284
                        </xsl:for-each>
285
                        <xsl:if test="$lang">
286
                            <dc:language>
287
                                <xsl:value-of select="'unknown'"/>
288
                            </dc:language>
289
                        </xsl:if>
290

    
291
                        <!-- dc:contributor dc:creator dc:publisher -->
292
                        <xsl:for-each select="//efg:relPerson">
293
                            <xsl:variable name="person_type"
294
                                select="translate(normalize-space(./efg:type), $upper, $small)"/>
295
                            <xsl:choose>
296
                                <xsl:when
297
                                    test="
298
                                        $person_type = 'director of photography' or
299
                                        $person_type = 'screenplay' or
300
                                        $person_type = 'editor' or
301
                                        $person_type = 'music composer'">
302
                                    <dc:contributor>
303
                                        <xsl:value-of select="./efg:name"/>
304
                                    </dc:contributor>
305
                                </xsl:when>
306
                                <xsl:when test="$person_type = 'director'">
307
                                    <xsl:if test="$creationType = 'avcreation'">
308
                                        <dc:creator>
309
                                            <xsl:value-of select="./efg:name"/>
310
                                        </dc:creator>
311
                                    </xsl:if>
312

    
313
                                </xsl:when>
314
                                <xsl:when test="$person_type = 'publisher'">
315
                                    <xsl:if test="$creationType = 'nonavcreation'">
316
                                        <dc:publisher>
317
                                            <xsl:value-of select="./efg:name"/>
318
                                        </dc:publisher>
319
                                    </xsl:if>
320
                                </xsl:when>
321
                                <xsl:when
322
                                    test="
323
                                        $person_type = 'creator' or
324
                                        $person_type = 'designer' or
325
                                        $person_type = 'photographer' or
326
                                        $person_type = 'lithographer' or
327
                                        $person_type = 'book designer' or
328
                                        $person_type = 'author' or
329
                                        $person_type = 'lyrics' or
330
                                        $person_type = 'composer' or
331
                                        $person_type = 'illustrator' or
332
                                        $person_type = 'artist' or
333
                                        $person_type = 'manufacturer' or
334
                                        $person_type = 'attributed to' or
335
                                        $person_type = 'stills photographer'">
336
                                    <xsl:if test="$creationType = 'nonavcreation'">
337
                                        <dc:creator>
338
                                            <xsl:value-of select="./efg:name"/>
339
                                        </dc:creator>
340
                                    </xsl:if>
341

    
342
                                </xsl:when>
343
                            </xsl:choose>
344
                        </xsl:for-each>
345
                        <xsl:for-each select="//efg:relCorporate">
346
                            <xsl:variable name="corporate_type"
347
                                select="translate(normalize-space(./efg:type), $upper, $small)"/>
348
                            <xsl:choose>
349
                                <xsl:when test="$corporate_type = 'production company'">
350
                                    <xsl:if test="$creationType = 'avcreation'">
351
                                        <dc:contributor>
352
                                            <xsl:value-of select="./efg:name"/>
353
                                        </dc:contributor>
354
                                    </xsl:if>
355

    
356
                                </xsl:when>
357
                                <xsl:when test="$corporate_type = 'publisher'">
358
                                    <xsl:if test="$creationType = 'nonavcreation'">
359
                                        <dc:publisher>
360
                                            <xsl:value-of select="./efg:name"/>
361
                                        </dc:publisher>
362
                                    </xsl:if>
363

    
364
                                </xsl:when>
365
                            </xsl:choose>
366
                        </xsl:for-each>
367

    
368
                        <!-- dc:description -->
369
                        <xsl:for-each select="//efg:description">
370
                            <dc:description>
371
                                <xsl:call-template name="lang"/>
372
                                <xsl:value-of select="."/>
373
                            </dc:description>
374
                        </xsl:for-each>
375

    
376
                        <!-- dc:format -->
377
                        <xsl:for-each
378
                            select="efg:nonAVManifestation/efg:digitalFormat[translate(normalize-space(@status), $upper, $small) = 'born digital']">
379
                            <dc:format>
380
                                <xsl:value-of select="."/>
381
                            </dc:format>
382
                        </xsl:for-each>
383
                        <xsl:for-each
384
                            select="efg:avManifestation/efg:format/efg:digital/efg:originalStatus[translate(normalize-space(.), $upper, $small) = 'born digital']">
385
                            <dc:format>
386
                                <xsl:value-of select="efg:container"/>
387
                            </dc:format>
388
                        </xsl:for-each>
389

    
390
                        <!-- dcterms:extent -->
391
                        <xsl:for-each select="//efg:physicalFormat">
392
                            <dcterms:extent>
393
                                <xsl:value-of select="@size"/>
394
                            </dcterms:extent>
395
                        </xsl:for-each>
396

    
397

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

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

    
435
                        <!-- dc:title dcterms:alternative -->
436
                        <xsl:for-each select="efg:title">
437
                            <xsl:variable name="title_rel"
438
                                select="translate(normalize-space(./efg:relation), $upper, $small)"/>
439
                            <xsl:choose>
440
                                <xsl:when test="$title_rel = 'original title' and $creationType='avcreation'">
441
                                    <dc:title>
442
                                        <xsl:call-template name="lang"/>
443

    
444
                                        <xsl:value-of select="./efg:text"/>
445
                                    </dc:title>
446
                                </xsl:when>
447
                                <xsl:when test="$title_rel = 'main title' and $creationType='nonavcreation'">
448
                                    <dc:title>
449
                                        <xsl:call-template name="lang"/>
450

    
451
                                        <xsl:value-of select="./efg:text"/>
452
                                    </dc:title>
453
                                </xsl:when>
454
                                <xsl:otherwise>
455
                                    <dcterms:alternative>
456
                                        <xsl:call-template name="lang"/>
457

    
458
                                        <xsl:value-of select="./efg:text"/>
459
                                    </dcterms:alternative>
460
                                </xsl:otherwise>
461
                            </xsl:choose>
462
                        </xsl:for-each>
463
                        <xsl:for-each select="efg:nonAVManifestation/efg:title">
464
                            <xsl:variable name="title_rel"
465
                                select="translate(normalize-space(./efg:relation), $upper, $small)"/>
466
                            <xsl:choose>
467
                               <!-- <xsl:when test="$title_rel = 'original title'">
468
                                    <dc:title>
469
                                        <xsl:call-template name="lang"/>
470
                                        <xsl:value-of select="./efg:text"/>
471
                                    </dc:title>
472
                                </xsl:when>-->
473
                                <xsl:when test="$title_rel = 'main title'">
474
                                    <xsl:if test="string-length($navct) = 0">
475
                                        <dc:title>
476
                                            <xsl:call-template name="lang"/>
477

    
478
                                            <xsl:value-of select="./efg:text"/>
479
                                        </dc:title>
480
                                    </xsl:if>
481
                                </xsl:when>
482

    
483
                                <xsl:otherwise>
484
                                    <xsl:if test="$existnavct = 0">
485
                                        <dcterms:alternative>
486
                                            <xsl:call-template name="lang"/>
487

    
488
                                            <xsl:value-of select="./efg:text"/>
489
                                        </dcterms:alternative>
490
                                    </xsl:if>
491
                                </xsl:otherwise>
492
                            </xsl:choose>
493
                        </xsl:for-each>
494
                        <xsl:for-each select="efg:avManifestation/efg:title">
495
                            <xsl:variable name="title_rel"
496
                                select="translate(normalize-space(./efg:relation), $upper, $small)"/>
497
                            <xsl:choose>
498
                                <xsl:when test="$title_rel = 'original title'">
499
                                    <xsl:if test="string-length($avct) = 0">
500
                                        <dc:title>
501
                                            <xsl:call-template name="lang"/>
502

    
503
                                            <xsl:value-of select="./efg:text"/>
504
                                        </dc:title>
505
                                    </xsl:if>
506
                                </xsl:when>
507
                     <!--           <xsl:when test="$title_rel = 'main title'">
508
                                    <dc:title>
509
                                        <xsl:call-template name="lang"/>
510

    
511
                                        <xsl:value-of select="./efg:text"/>
512
                                    </dc:title>
513
                                </xsl:when>-->
514
                                <xsl:otherwise>
515
                                    <xsl:if test="$existavct = 0">
516
                                        <dcterms:alternative>
517
                                            <xsl:call-template name="lang"/>
518

    
519
                                            <xsl:value-of select="./efg:text"/>
520
                                        </dcterms:alternative>
521
                                    </xsl:if>
522
                                </xsl:otherwise>
523
                            </xsl:choose>
524
                        </xsl:for-each>
525

    
526
                        <!-- dc:type -->
527
                        <xsl:for-each select="//efg:specificType">
528
                            <xsl:choose>
529
                                <xsl:when
530
                                    test="count(normalize-space(.)) &gt; 0 and normalize-space(.) != 'n/a'">
531
                                    <dc:type>
532
                                        <xsl:value-of select="."/>
533
                                    </dc:type>
534
                                </xsl:when>
535
                                <xsl:otherwise>
536
                                    <dc:type>
537
                                        <xsl:value-of
538
                                            select="//efg:avManifestation/efg:item/efg:type"/>
539
                                    </dc:type>
540
                                </xsl:otherwise>
541
                            </xsl:choose>
542
                        </xsl:for-each>
543
                        <xsl:for-each select="//efg:productionYear">
544
                            <dcterms:created>
545
                                <xsl:value-of select="."/>
546
                            </dcterms:created>
547
                        </xsl:for-each>
548

    
549
                        <xsl:for-each select="//efg:nonAVManifestation/efg:dateCreated">
550
                            <dcterms:created>
551
                                <xsl:value-of select="."/>
552
                            </dcterms:created>
553
                        </xsl:for-each>
554

    
555
                        <xsl:for-each
556
                            select="//efg:nonAVManifestation/efg:date[./efg:type = 'issued']">
557
                            <dcterms:issued>
558
                                <xsl:value-of select="."/>
559
                            </dcterms:issued>
560
                        </xsl:for-each>
561
      
562
                        <xsl:for-each select="//efg:coverage/efg:spatial">
563
                            <dcterms:spatial>
564
                                <xsl:value-of select="."/>
565
                            </dcterms:spatial>
566
                        </xsl:for-each>
567

    
568
                        <xsl:for-each select="//efg:geographicScope/efg:place">
569
                            <dcterms:spatial>
570
                                <xsl:value-of select="."/>
571
                            </dcterms:spatial>
572
                        </xsl:for-each>
573
                        <xsl:for-each select="//efg:countryOfReference">
574
                            <dcterms:spatial>
575
                                <xsl:value-of select="."/>
576
                            </dcterms:spatial>
577
                        </xsl:for-each>
578
                        <xsl:for-each select="//efg:coverage/efg:temporal">
579
                            <dcterms:temporal>
580
                                <xsl:value-of select="."/>
581
                            </dcterms:temporal>
582
                        </xsl:for-each>
583
                        <xsl:for-each select="//efg:item/efg:type">
584
                            <edm:type>
585
                                <xsl:value-of select="."/>
586
                            </edm:type>
587
                        </xsl:for-each>
588

    
589
                        <xsl:for-each select="//efg:avManifestation//efg:provenance">
590
                            <dcterms:provenance>
591
                                <xsl:value-of select="."/>
592
                            </dcterms:provenance>
593
                        </xsl:for-each>
594
                    </edm:ProvidedCHO>
595

    
596
                    <xsl:for-each select="//efg:avManifestation">
597
                        <xsl:for-each select="//efg:isShownBy">
598
                            <edm:WebResource>
599
                                <xsl:attribute name="rdf:about">
600
                                    <xsl:value-of select="."/>
601
                                </xsl:attribute>
602
                                <xsl:if
603
                                    test="../../efg:format/efg:digital/efg:originalStatus[translate(normalize-space(.), $upper, $small)]">
604
                                    <dc:format>
605
                                        <xsl:value-of
606
                                            select="../../efg:format/efg:digital/efg:container"/>
607
                                    </dc:format>
608
                                </xsl:if>
609
                                <xsl:for-each select="../../efg:duration">
610
                                    <dcterms:extent>
611
                                        <xsl:value-of select="."/>
612
                                    </dcterms:extent>
613
                                </xsl:for-each>
614
                                <xsl:call-template name="rigths">
615
                                    <xsl:with-param name="rightStatus"
616
                                        select="translate(normalize-space(../../efg:rightsStatus), $upper, $small)"
617
                                    />
618
                                </xsl:call-template>
619

    
620
                            </edm:WebResource>
621
                        </xsl:for-each>
622

    
623
                    </xsl:for-each>
624

    
625

    
626
                    <xsl:for-each select="//efg:nonAVManifestation">
627
                        <xsl:for-each select="//efg:isShownBy">
628
                            <edm:WebResource>
629
                                <xsl:attribute name="rdf:about">
630
                                    <xsl:value-of select="."/>
631
                                </xsl:attribute>
632
                                <xsl:if
633
                                    test="../../efg:digitalFormat[translate(normalize-space(@status), $upper, $small)]">
634
                                    <dc:format>
635
                                        <xsl:value-of select="../../efg:digitalFormat"/>
636
                                    </dc:format>
637
                               </xsl:if>
638

    
639
                                <xsl:call-template name="rigths">
640
                                    <xsl:with-param name="rightStatus"
641
                                        select="translate(normalize-space(../../efg:rightsStatus), $upper, $small)"
642
                                    />
643
                                </xsl:call-template>
644

    
645
                            </edm:WebResource>
646
                        </xsl:for-each>
647

    
648
                    </xsl:for-each>
649

    
650

    
651
                </rdf:RDF>
652
            </metadata>
653
        </record>
654
    </xsl:template>
655

    
656

    
657
    <xsl:template name="distinct">
658
        <xsl:param name="var"/>
659

    
660
        <xsl:variable name="svar">
661
            <xsl:for-each select="exslt:node-set($var)/*">
662
                <xsl:sort select="."/>
663
                <xsl:copy-of select="."/>
664
            </xsl:for-each>
665
        </xsl:variable>
666

    
667
        <xsl:for-each select="exslt:node-set($svar)/*">
668
            <xsl:variable name="pos" select="position()"/>
669
            <xsl:if test="string(../child::*[$pos - 1]) != string(.)">
670
                <xsl:copy-of select="."/>
671
            </xsl:if>
672
        </xsl:for-each>
673
    </xsl:template>
674

    
675

    
676
</xsl:stylesheet>
677

    
678
				]]>
679
				</CODE>
680
			</SCRIPT>
681
		</CONFIGURATION>
682
		<STATUS/>
683
		<SECURITY_PARAMETERS/>
684
	</BODY>
685
</RESOURCE_PROFILE>
    (1-1/1)