Project

General

Profile

« Previous | Next » 

Revision 45984

fit for EFG_EDM_Mapping_1.2 and DS12_adjustmentsmappingfromEFGtoEDM.docx

View differences:

efg2edm.xml
13 13
				<TITLE>Efg to EDM</TITLE>
14 14
				<CODE>
15 15
					<![CDATA[
16
					<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:efg="http://www.europeanfilmgateway.eu/efg"
17
					                xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/"
18
					                xmlns:dri="http://www.driver-repository.eu/namespace/dri"
19
					                xmlns:exslt="http://exslt.org/common" version="1.0"
20
					                exclude-result-prefixes="xsl exslt">
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">
21 22

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

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

  
27
						<xsl:template match="/">
28
							<objectRecord>
29
								<!-- NB: only records with a title are processed -->
30
								<xsl:variable name="body">
31
									<xsl:if test="count(//efg:title) &gt; 0">
32
										<xsl:apply-templates select=".//efg:efgEntity/efg:avcreation"/>
33
										<xsl:apply-templates select=".//efg:efgEntity/efg:nonavcreation"/>
34
									</xsl:if>
35
								</xsl:variable>
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>
36 69

  
37
								<xsl:choose>
38
									<xsl:when test="exslt:node-set($body)/*">
39
										<xsl:apply-templates select=".//efg:efgEntity/efg:avcreation"/>
40
										<xsl:apply-templates select=".//efg:efgEntity/efg:nonavcreation"/>
41
									</xsl:when>
42
									<xsl:otherwise>
43
										<JUNK/>
44
									</xsl:otherwise>
45
								</xsl:choose>
46
							</objectRecord>
47
						</xsl:template>
70
                    <JUNK/>
71
                </xsl:otherwise>
72
            </xsl:choose>
73
        </objectRecord>
74
    </xsl:template>
48 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>
49 82

  
50
						<xsl:template match="identifier | dri:objIdentifier | dri:recordIdentifier" mode="header">
51
							<xsl:param name="pos"/>
52
							<xsl:copy>
53
								<xsl:value-of select="concat(text(), '-', $pos)"/>
54
							</xsl:copy>
55
						</xsl:template>
83
    <xsl:template match="*" mode="header">
84
        <xsl:param name="pos"/>
85
        <xsl:copy-of select="."/>
86
    </xsl:template>
56 87

  
57
						<xsl:template match="*" mode="header">
58
							<xsl:param name="pos"/>
59
							<xsl:copy-of select="."/>
60
						</xsl:template>
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>
61 94

  
95
    </xsl:template>
62 96

  
63
						<xsl:template match="efg:avcreation | efg:nonavcreation">
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>
64 120

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

  
67
							<record>
68
								<header>
69
									<xsl:apply-templates select="/record/header/*" mode="header">
70
										<xsl:with-param name="pos">
71
											<xsl:value-of select="position()"/>
72
										</xsl:with-param>
73
									</xsl:apply-templates>
74
								</header>
75
								<metadata>
76
									<rdf:RDF xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
77
									         xmlns:dc="http://purl.org/dc/elements/1.1/"
78
									         xmlns:edm="http://www.europeana.eu/schemas/edm/"
79
									         xmlns:ore="http://www.openarchives.org/ore/terms/"
80
									         xmlns:dcterms="http://purl.org/dc/terms/"
81
									         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
82
									         xsi:schemaLocation="http://www.w3.org/1999/02/22-rdf-syntax-ns# EDM-INTERNAL.xsd"
83
									>
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']"/>
84 128

  
85
										<xsl:variable name="efg_provider" select="//efg:provider"/>
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">
86 149

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

  
88
										<ore:Aggregation>
89
											<xsl:attribute name="rdf:about">
90
												<xsl:value-of select="concat('AGGR::', $efg_provider, //efg:sourceID)"/>
91
											</xsl:attribute>
92 152

  
93
											<edm:aggregatedCHO>
94
												<xsl:attribute name="rdf:resource">
95
													<xsl:value-of select="//efg:sourceID"/>
96
												</xsl:attribute>
97
											</edm:aggregatedCHO>
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>
98 158

  
99
											<xsl:for-each select="//efg:avManifestation">
100
												<xsl:variable name="status">
101
													<xsl:value-of
102
															select="translate(normalize-space(.//efg:digitalFormat/efg:status), $upper, $small)"
103
													/>
104
												</xsl:variable>
159
                        <edm:aggregatedCHO>
160
                            <xsl:attribute name="rdf:resource">
161
                                <xsl:value-of select="efg:recordSource/efg:sourceID"/>
162
                            </xsl:attribute>
163
                        </edm:aggregatedCHO>
105 164

  
106
												<xsl:choose>
107
													<xsl:when test="$status != 'born digital'">
108
														<xsl:variable name="rightStatus">
109
															<xsl:value-of
110
																	select="translate(normalize-space(.//efg:rightsStatus), $upper, $small)"
111
															/>
112
														</xsl:variable>
113 165

  
114
														<edm:aggregatedCHO>
115
															<xsl:attribute name="rdf:resource">
116
																<xsl:value-of select=".//efg:identifier"/>
117
															</xsl:attribute>
118
														</edm:aggregatedCHO>
119
														<dc:rights>
120
															<xsl:value-of select=".//efg:rightsHolder"/>
121
														</dc:rights>
122
														<xsl:choose>
123
															<xsl:when test="string-length($rightStatus) &gt; 0">
124
																<edm:rights>
125
																	<xsl:value-of select="$rightStatus"/>
126
																</edm:rights>
127
															</xsl:when>
128
														</xsl:choose>
129
														<xsl:for-each select="//efg:isShownBy">
130
															<edm:isShownBy>
131
																<xsl:value-of select="."/>
132
															</edm:isShownBy>
133
														</xsl:for-each>
134
														<xsl:for-each select="//efg:isShownAt">
135
															<edm:isShownAt>
136
																<xsl:value-of select="."/>
137
															</edm:isShownAt>
138
														</xsl:for-each>
139
														<xsl:for-each select="//efg:thumbnail">
140
															<edm:isShownBy>
141
																<xsl:value-of select="."/>
142
															</edm:isShownBy>
143
														</xsl:for-each>
144 166

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

  
146
													</xsl:when>
147
												</xsl:choose>
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">
148 175

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

  
151
											<xsl:for-each select="//efg:nonAVManifestation">
152
												<xsl:variable name="status">
153
													<xsl:value-of
154
															select="translate(normalize-space(.//efg:digitalFormat/efg:status), $upper, $small)"
155
													/>
156
												</xsl:variable>
180
                            </xsl:if>
181
                            <xsl:for-each select="//efg:isShownBy[position() &gt; 1]">
157 182

  
158
												<xsl:choose>
159
													<xsl:when test="$status != 'born digital'">
160
														<xsl:variable name="rightStatus">
161
															<xsl:value-of
162
																	select="translate(normalize-space(.//efg:rightsStatus), $upper, $small)"
163
															/>
164
														</xsl:variable>
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>
165 192

  
166
														<edm:aggregatedCHO>
167
															<xsl:attribute name="rdf:resource">
168
																<xsl:value-of select=".//efg:identifier"/>
169
															</xsl:attribute>
170
														</edm:aggregatedCHO>
171
														<dc:rights>
172
															<xsl:value-of select=".//efg:rightsHolder"/>
173
														</dc:rights>
174
														<xsl:choose>
175
															<xsl:when test="string-length($rightStatus) &gt; 0">
176
																<edm:rights>
177
																	<xsl:value-of select="$status"/>
178
																</edm:rights>
179
															</xsl:when>
180
														</xsl:choose>
181
														<xsl:for-each select="//efg:isShownBy">
182
															<edm:isShownBy>
183
																<xsl:value-of select="."/>
184
															</edm:isShownBy>
185
														</xsl:for-each>
186
														<xsl:for-each select="//efg:isShownAt">
187
															<edm:isShownAt>
188
																<xsl:value-of select="."/>
189
															</edm:isShownAt>
190
														</xsl:for-each>
191
														<xsl:for-each select="//efg:thumbnail">
192
															<edm:isShownBy>
193
																<xsl:value-of select="."/>
194
															</edm:isShownBy>
195
														</xsl:for-each>
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>
196 202

  
197 203

  
198
													</xsl:when>
199
												</xsl:choose>
204
                        <xsl:for-each select="//efg:nonAVManifestation">
200 205

  
201
											</xsl:for-each>
206
                            <!--      <edm:aggregatedCHO>
207
                                <xsl:attribute name="rdf:resource">
208
                                    <xsl:value-of select=".//efg:identifier"/>
209
                                </xsl:attribute>
210
                            </edm:aggregatedCHO>-->
202 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]">
203 219

  
204
											<edm:dataProvider>
205
												<xsl:value-of select="$efg_provider"/>
206
											</edm:dataProvider>
207
											<edm:provider>EFG - The European Film Gateway</edm:provider>
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>
208 229

  
209
										</ore:Aggregation>
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>
210 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>
211 251

  
212
										<edm:ProvidedCHO>
213
											<xsl:attribute name="rdf:about">
214
												<xsl:value-of select="//efg:recordSource[1]/efg:sourceID"/>
215
											</xsl:attribute>
216
											<xsl:for-each select="//efg:sourceID">
217
												<dc:idenetifier>
218
													<xsl:value-of select="."/>
219
												</dc:idenetifier>
220
											</xsl:for-each>
221
											<xsl:for-each select="//efg:language">
222
												<dc:language>
223
													<xsl:value-of select="."/>
224
												</dc:language>
225
											</xsl:for-each>
252
                        <xsl:if test=".//efg:rightsHolder">
253
                            <dc:rights>
254
                                <xsl:value-of select=".//efg:rightsHolder"/>
255
                            </dc:rights>
256
                        </xsl:if>
226 257

  
227
											<xsl:for-each select="//efg:relPerson">
228
												<xsl:variable name="person_type"
229
												              select="translate(normalize-space(./efg:type), $upper, $small)"/>
230
												<xsl:choose>
231
													<xsl:when
232
															test="$person_type = 'director of photography' or $person_type = 'screenplay' or $person_type = 'editor' or $person_type = 'music composer'">
233
														<dc:contributor>
234
															<xsl:value-of select="./efg:name"/>
235
														</dc:contributor>
236
													</xsl:when>
237
													<xsl:when test="$person_type = 'director'">
238
														<dc:creator>
239
															<xsl:value-of select="./efg:name"/>
240
														</dc:creator>
241
													</xsl:when>
242
													<xsl:when
243
															test="
244
										$person_type = 'publisher' or $person_type = 'creator' or $person_type = 'designer' or $person_type = 'photographer'
245
										or $person_type = 'lithographer' or $person_type = 'book designer' or $person_type = 'author'
246
										or $person_type = 'lyrics' or $person_type = 'composer' or $person_type = 'illustrator' or $person_type = 'artist'
247
										or $person_type = 'manufacturer' or $person_type = 'attributed to' or $person_type = 'stills photographer'">
248
														<dc:creator>
249
															<xsl:value-of select="./efg:name"/>
250
														</dc:creator>
251
													</xsl:when>
252
												</xsl:choose>
253
											</xsl:for-each>
254
											<xsl:for-each select="//efg:relCorporate">
255
												<xsl:variable name="corporate_type"
256
												              select="translate(normalize-space(./efg:type), $upper, $small)"/>
257
												<xsl:choose>
258
													<xsl:when test="$corporate_type = 'production company'">
259
														<dc:contributor>
260
															<xsl:value-of select="./efg:name"/>
261
														</dc:contributor>
262
													</xsl:when>
263
													<xsl:when test="$corporate_type = 'publisher'">
264
														<dc:publisher>
265
															<xsl:value-of select="./efg:name"/>
266
														</dc:publisher>
267
													</xsl:when>
268
												</xsl:choose>
269
											</xsl:for-each>
258
                        <edm:dataProvider>
259
                            <xsl:value-of select="$efg_provider"/>
260
                        </edm:dataProvider>
261
                        <edm:provider>EFG - The European Film Gateway</edm:provider>
270 262

  
271
											<xsl:for-each select="//efg:description">
272
												<dc:description>
273
													<xsl:attribute name="xml:lang">
274
														<xsl:value-of select="./@lang"/>
275
													</xsl:attribute>
276
													<xsl:value-of select="."/>
277
												</dc:description>
278
											</xsl:for-each>
279
											<xsl:for-each select="//efg:DigitalFormat">
280
												<xsl:choose>
281
													<xsl:when test="./Status = 'Born digital'">
282
														<dc:format>
283
															<xsl:value-of select="./efg:Container"/>
284
														</dc:format>
285
													</xsl:when>
286
												</xsl:choose>
287 263

  
288
											</xsl:for-each>
289 264

  
290 265

  
291
											<xsl:for-each select="//efg:avcreation//efg:keywords">
292
												<xsl:variable name="keyword_type"
293
												              select="translate(normalize-space(./@type), $upper, $small)"/>
294
												<xsl:choose>
295
													<xsl:when
296
															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'">
297
														<dcterms:subject>
298
															<xsl:attribute name="xml:lang">
299
																<xsl:value-of select="@lang"/>
300
															</xsl:attribute>
301
															<xsl:value-of select="./efg:term"/>
302
														</dcterms:subject>
303
													</xsl:when>
304 266

  
305
													<xsl:when test="$keyword_type = 'form'">
306
														<dc:type>
307
															<xsl:attribute name="xml:lang">
308
																<xsl:value-of select="@lang"/>
309
															</xsl:attribute>
310
															<xsl:value-of select="./efg:term"/>
311
														</dc:type>
312
													</xsl:when>
313
												</xsl:choose>
314
											</xsl:for-each>
315
											<xsl:for-each select="//efg:nonavcreation//efg:keywords">
316
												<dcterms:subject>
317
													<xsl:value-of select="./efg:term"/>
318
												</dcterms:subject>
319
											</xsl:for-each>
267
                    </ore:Aggregation>
320 268

  
321
											<xsl:for-each select="//efg:avcreation//efg:title">
322
												<xsl:variable name="title_rel"
323
												              select="translate(normalize-space(./efg:relation), $upper, $small)"/>
324
												<xsl:choose>
325
													<xsl:when test="$title_rel = 'original title'">
326
														<dc:title>
327
															<xsl:attribute name="xml:lang">
328
																<xsl:value-of select="@lang"/>
329
															</xsl:attribute>
330
															<xsl:value-of select="./efg:text"/>
331
														</dc:title>
332
													</xsl:when>
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>
333 278

  
334
													<xsl:otherwise>
335
														<dcterms:alternative>
336
															<xsl:attribute name="xml:lang">
337
																<xsl:value-of select="@lang"/>
338
															</xsl:attribute>
339
															<xsl:value-of select="./efg:text"/>
340
														</dcterms:alternative>
341
													</xsl:otherwise>
342
												</xsl:choose>
343
											</xsl:for-each>
344
											<xsl:for-each select="//efg:avcreation//efg:title">
345
												<xsl:variable name="title_rel"
346
												              select="translate(normalize-space(./efg:relation), $upper, $small)"/>
347
												<xsl:choose>
348
													<xsl:when test="$title_rel = 'main title'">
349
														<dc:title>
350
															<xsl:attribute name="xml:lang">
351
																<xsl:value-of select="@lang"/>
352
															</xsl:attribute>
353
															<xsl:value-of select="./efg:text"/>
354
														</dc:title>
355
													</xsl:when>
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>
356 290

  
357
													<xsl:otherwise>
358
														<dcterms:alternative>
359
															<xsl:attribute name="xml:lang">
360
																<xsl:value-of select="@lang"/>
361
															</xsl:attribute>
362
															<xsl:value-of select="./efg:text"/>
363
														</dcterms:alternative>
364
													</xsl:otherwise>
365
												</xsl:choose>
366
											</xsl:for-each>
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>
367 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>
368 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>
369 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>
370 363

  
364
                                </xsl:when>
365
                            </xsl:choose>
366
                        </xsl:for-each>
371 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>
372 375

  
373
											<xsl:for-each select="//efg:nonavcreation//efg:title">
374
												<xsl:variable name="title_rel"
375
													select="translate(normalize-space(./efg:relation), $upper, $small)"/>
376
												<xsl:choose>
377
													<xsl:when test="$title_rel = 'original title'">
378
														<dc:title>
379
															<xsl:attribute name="xml:lang">
380
																<xsl:value-of select="@lang"/>
381
															</xsl:attribute>
382
															<xsl:value-of select="./efg:text"/>
383
														</dc:title>
384
													</xsl:when>
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>
385 389

  
386
													<xsl:otherwise>
387
														<dcterms:alternative>
388
															<xsl:attribute name="xml:lang">
389
																<xsl:value-of select="@lang"/>
390
															</xsl:attribute>
391
															<xsl:value-of select="./efg:text"/>
392
														</dcterms:alternative>
393
													</xsl:otherwise>
394
												</xsl:choose>
395
											</xsl:for-each>
396
											<xsl:for-each select="//efg:nonavcreation//efg:title">
397
												<xsl:variable name="title_rel"
398
													select="translate(normalize-space(./efg:relation), $upper, $small)"/>
399
												<xsl:choose>
400
													<xsl:when test="$title_rel = 'main title'">
401
														<dc:title>
402
															<xsl:attribute name="xml:lang">
403
																<xsl:value-of select="@lang"/>
404
															</xsl:attribute>
405
															<xsl:value-of select="./efg:text"/>
406
														</dc:title>
407
													</xsl:when>
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>
408 396

  
409
													<xsl:otherwise>
410
														<dcterms:alternative>
411
															<xsl:attribute name="xml:lang">
412
																<xsl:value-of select="@lang"/>
413
															</xsl:attribute>
414
															<xsl:value-of select="./efg:text"/>
415
														</dcterms:alternative>
416
													</xsl:otherwise>
417
												</xsl:choose>
418
											</xsl:for-each>
419 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>
420 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>
421 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"/>
422 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"/>
423 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"/>
424 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"/>
425 477

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

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

  
428
											<xsl:for-each select="//efg:specificType">
429
												<xsl:choose>
430
													<xsl:when
431
															test="count(normalize-space(.)) &gt; 0 and normalize-space(.) != 'n/a'">
432
														<dc:type>
433
															<xsl:value-of select="."/>
434
														</dc:type>
435
													</xsl:when>
436
													<xsl:otherwise>
437
														<dc:type>
438
															<xsl:value-of
439
																	select="//efg:avManifestation/efg:item/efg:type"/>
440
														</dc:type>
441
													</xsl:otherwise>
442
												</xsl:choose>
443
											</xsl:for-each>
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"/>
444 502

  
445
											<xsl:for-each select="//efg:productionYear">
446
												<dcterms:created>
447
													<xsl:value-of select="."/>
448
												</dcterms:created>
449
											</xsl:for-each>
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"/>
450 510

  
451
											<xsl:for-each select="//efg:nonAVManifestation/efg:dateCreated">
452
												<dcterms:created>
453
													<xsl:value-of select="."/>
454
												</dcterms:created>
455
											</xsl:for-each>
456
											<xsl:for-each select="//efg:physicalFormat">
457
												<dc:format>
458
													<xsl:value-of select="./@size"/>
459
												</dc:format>
460
											</xsl:for-each>
461
											<xsl:for-each
462
													select="//efg:nonAVManifestation/efg:date[./efg:type = 'issued']">
463
												<dcterms:issued>
464
													<xsl:value-of select="."/>
465
												</dcterms:issued>
466
											</xsl:for-each>
467
											<xsl:for-each select="//efg:coverage/efg:spatial">
468
												<dcterms:spatial>
469
													<xsl:value-of select="."/>
470
												</dcterms:spatial>
471
											</xsl:for-each>
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"/>
472 518

  
473
											<xsl:for-each select="//efg:geographicScope/efg:place">
474
												<dcterms:spatial>
475
													<xsl:value-of select="."/>
476
												</dcterms:spatial>
477
											</xsl:for-each>
478
											<xsl:for-each select="//efg:countryOfReference">
479
												<dcterms:spatial>
480
													<xsl:value-of select="."/>
481
												</dcterms:spatial>
482
											</xsl:for-each>
483
											<xsl:for-each select="//efg:coverage/efg:temporal">
484
												<dcterms:temporal>
485
													<xsl:value-of select="."/>
486
												</dcterms:temporal>
487
											</xsl:for-each>
488
											<xsl:for-each select="//efg:item/efg:type">
489
												<edm:type>
490
													<xsl:value-of select="."/>
491
												</edm:type>
492
											</xsl:for-each>
493
											<xsl:for-each select="//efg:avManifestation//efg:provenance">
494
												<dcterms:provenance>
495
													<xsl:value-of select="."/>
496
												</dcterms:provenance>
497
											</xsl:for-each>
498
										</edm:ProvidedCHO>
519
                                            <xsl:value-of select="./efg:text"/>
520
                                        </dcterms:alternative>
521
                                    </xsl:if>
522
                                </xsl:otherwise>
523
                            </xsl:choose>
524
                        </xsl:for-each>
499 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>
500 548

  
501
										<xsl:for-each select="//efg:avManifestation">
502
											<xsl:variable name="status">
503
												<xsl:value-of
504
														select="translate(normalize-space(.//efg:digitalFormat/efg:status), $upper, $small)"
505
												/>
506
											</xsl:variable>
549
                        <xsl:for-each select="//efg:nonAVManifestation/efg:dateCreated">
550
                            <dcterms:created>
551
                                <xsl:value-of select="."/>
552
                            </dcterms:created>
553
                        </xsl:for-each>
507 554

  
508
											<xsl:choose>
509
												<xsl:when test="$status != 'born digital'">
510
													<edm:WebResource>
511
														<xsl:attribute name="rdf:about">
512
															<xsl:value-of select=".//efg:identifier"/>
513
														</xsl:attribute>
514
														<dc:format>
515
															<xsl:value-of select="$status"/>
516
														</dc:format>
517
														<xsl:for-each select=".//efg:duration">
518
															<dcterms:extent>
519
																<xsl:value-of select="."/>
520
															</dcterms:extent>
521
														</xsl:for-each>
522
														<xsl:variable name="rightStatus">
523
															<xsl:value-of
524
																	select="translate(normalize-space(.//efg:rightsStatus), $upper, $small)"
525
															/>
526
														</xsl:variable>
527
														<xsl:choose>
528
															<xsl:when test="$rightStatus = 'copyright protected'">
529
																<edm:rights>http://www.europeana.eu/rights/rr-f/</edm:rights>
530
															</xsl:when>
531
															<xsl:when test="$rightStatus = 'not copyright protected'">
532
																<edm:rights>http://creativecommons.org/publicdomain/mark/1.0/</edm:rights>
533
															</xsl:when>
534
															<xsl:when test="$rightStatus = 'public domain'">
535
																<edm:rights>http://creativecommons.org/publicdomain/mark/1.0/</edm:rights>
536
															</xsl:when>
537
															<xsl:when test="$rightStatus = 'orphan'">
538
																<edm:rights>http://www.europeana.eu/rights/orphan-work-eu/</edm:rights>
539
															</xsl:when>
540
															<xsl:when
541
																	test="$rightStatus = 'no known copyright / orphan work'">
542
																<edm:rights>http://www.europeana.eu/rights/orphan-work-eu/</edm:rights>
543
															</xsl:when>
544
															<xsl:otherwise>
545
																<edm:rights>http://www.europeana.eu/rights/rr-f/</edm:rights>
546
															</xsl:otherwise>
547
														</xsl:choose>
548
													</edm:WebResource>
549
												</xsl:when>
550
											</xsl:choose>
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>
551 567

  
552
										</xsl:for-each>
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>
553 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>
554 595

  
555
										<xsl:for-each select="//efg:nonAVManifestation">
556
											<xsl:variable name="status">
557
												<xsl:value-of
558
														select="translate(normalize-space(.//efg:digitalFormat/efg:status), $upper, $small)"
559
												/>
560
											</xsl:variable>
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>
561 619

  
562
											<xsl:choose>
563
												<xsl:when test="$status != 'born digital'">
564
													<edm:WebResource>
565
														<xsl:attribute name="rdf:about">
566
															<xsl:value-of select=".//efg:identifier"/>
567
														</xsl:attribute>
568
														<dc:format>
569
															<xsl:value-of select="$status"/>
570
														</dc:format>
571
														<xsl:for-each select=".//efg:duration">
572
															<dcterms:extent>
573
																<xsl:value-of select="."/>
574
															</dcterms:extent>
575
														</xsl:for-each>
576
														<xsl:variable name="rightStatus">
577
															<xsl:value-of
578
																	select="translate(normalize-space(.//efg:rightsStatus), $upper, $small)"
579
															/>
580
														</xsl:variable>
581
														<xsl:choose>
582
															<xsl:when test="$rightStatus = 'copyright protected'">
583
																<edm:rights>http://www.europeana.eu/rights/rr-f/</edm:rights>
584
															</xsl:when>
585
															<xsl:when test="$rightStatus = 'not copyright protected'">
586
																<edm:rights>http://creativecommons.org/publicdomain/mark/1.0/</edm:rights>
587
															</xsl:when>
588
															<xsl:when test="$rightStatus = 'public domain'">
589
																<edm:rights>http://creativecommons.org/publicdomain/mark/1.0/</edm:rights>
590
															</xsl:when>
591
															<xsl:when test="$rightStatus = 'orphan'">
592
																<edm:rights>http://www.europeana.eu/rights/orphan-work-eu/</edm:rights>
593
															</xsl:when>
594
															<xsl:when
595
																	test="$rightStatus = 'no known copyright / orphan work'">
596
																<edm:rights>http://www.europeana.eu/rights/orphan-work-eu/</edm:rights>
597
															</xsl:when>
598
															<xsl:otherwise>
599
																<edm:rights>http://www.europeana.eu/rights/rr-f/</edm:rights>
600
															</xsl:otherwise>
601
														</xsl:choose>
602
													</edm:WebResource>
603
												</xsl:when>
604
											</xsl:choose>
620
                            </edm:WebResource>
621
                        </xsl:for-each>
605 622

  
606
										</xsl:for-each>
623
                    </xsl:for-each>
607 624

  
608 625

  
609
									</rdf:RDF>
610
								</metadata>
611
							</record>
612
						</xsl:template>
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>
613 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>
614 644

  
615
						<xsl:template name="distinct">
616
							<xsl:param name="var"/>
645
                            </edm:WebResource>
646
                        </xsl:for-each>
617 647

  
618
							<xsl:variable name="svar">
619
								<xsl:for-each select="exslt:node-set($var)/*">
620
									<xsl:sort select="."/>
621
									<xsl:copy-of select="."/>
622
								</xsl:for-each>
623
							</xsl:variable>
648
                    </xsl:for-each>
624 649

  
625
							<xsl:for-each select="exslt:node-set($svar)/*">
626
								<xsl:variable name="pos" select="position()"/>
627
								<xsl:if test="string(../child::*[$pos - 1]) != string(.)">
628
									<xsl:copy-of select="."/>
629
								</xsl:if>
630
							</xsl:for-each>
631
						</xsl:template>
632 650

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

  
634
					</xsl:stylesheet>
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

  
635 678
				]]>
636 679
				</CODE>
637 680
			</SCRIPT>

Also available in: Unified diff