1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
3
|
xmlns:dri="http://www.driver-repository.eu/namespace/dri"
|
4
|
xmlns:oaf="http://namespace.openaire.eu/oaf"
|
5
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
6
|
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
|
7
|
|
8
|
<xsl:template match = "/">
|
9
|
<result type ="result">
|
10
|
<xsl:apply-templates select="//header"/>
|
11
|
<xsl:apply-templates select="//oaf:datasource"/>
|
12
|
<xsl:apply-templates select="//rel"/>
|
13
|
</result>
|
14
|
</xsl:template>
|
15
|
|
16
|
|
17
|
<!-- HEADER
|
18
|
fields in header:
|
19
|
1. dri:objIdentifier [objIdentifier]
|
20
|
2. dri:repositoryId X
|
21
|
3. dri:dateOfCollection X
|
22
|
-->
|
23
|
<xsl:template match = "header">
|
24
|
<field name="datasourceId" multiplicity="false" indexId="objIdentifier" label="Object id">
|
25
|
<xsl:attribute name="value">
|
26
|
<xsl:value-of select='./dri:objIdentifier'/>
|
27
|
</xsl:attribute>
|
28
|
</field>
|
29
|
<!--<field name="repositoryId" multiplicity="false" indexId="???" label="???">
|
30
|
<xsl:attribute name="value">
|
31
|
<xsl:value-of select='./dri:repositoryId'/>
|
32
|
</xsl:attribute>
|
33
|
</field>-->
|
34
|
<!--<field name="dateOfCollection" multiplicity="false" indexId="???" label="???">
|
35
|
<xsl:attribute name="value">
|
36
|
<xsl:value-of select='./dri:dateOfCollection'/>
|
37
|
</xsl:attribute>
|
38
|
</field>-->
|
39
|
</xsl:template>
|
40
|
|
41
|
|
42
|
<xsl:template match = "oaf:datasource">
|
43
|
<xsl:for-each select = "./originalId">
|
44
|
<field name="originalId" indexId = "" multiplicity="false" label="Original id">
|
45
|
<xsl:attribute name="value">
|
46
|
<xsl:value-of select='.'/>
|
47
|
</xsl:attribute>
|
48
|
</field>
|
49
|
</xsl:for-each>
|
50
|
|
51
|
<xsl:for-each select = "./officialname">
|
52
|
<field name="officialname" indexId = "datasourceofficialname" multiplicity="true" label="Official name">
|
53
|
<xsl:attribute name="value">
|
54
|
<xsl:value-of select='.'/>
|
55
|
</xsl:attribute>
|
56
|
</field>
|
57
|
</xsl:for-each>
|
58
|
|
59
|
<xsl:for-each select = "./englishname">
|
60
|
<field name="englishname" indexId = "datasourceenglishname" multiplicity="true" label="English name">
|
61
|
<xsl:attribute name="value">
|
62
|
<xsl:value-of select='.'/>
|
63
|
</xsl:attribute>
|
64
|
</field>
|
65
|
</xsl:for-each>
|
66
|
|
67
|
<xsl:for-each select = "./websiteurl">
|
68
|
<field name="websiteurl" indexId = "datasourcewebsiteurl" multiplicity="true" label="Website url">
|
69
|
<xsl:attribute name="value">
|
70
|
<xsl:value-of select='.'/>
|
71
|
</xsl:attribute>
|
72
|
</field>
|
73
|
</xsl:for-each>
|
74
|
|
75
|
<xsl:for-each select = "./logourl">
|
76
|
<field name="logourl" indexId = "datasourcelogourl" multiplicity="true" label="Logo url">
|
77
|
<xsl:attribute name="value">
|
78
|
<xsl:value-of select='.'/>
|
79
|
</xsl:attribute>
|
80
|
</field>
|
81
|
</xsl:for-each>
|
82
|
|
83
|
<xsl:for-each select = "./contactemail">
|
84
|
<field name="contactemail" indexId = "datasourcecontactemail" multiplicity="true" label="Contact e-mail">
|
85
|
<xsl:attribute name="value">
|
86
|
<xsl:value-of select='.'/>
|
87
|
</xsl:attribute>
|
88
|
</field>
|
89
|
</xsl:for-each>
|
90
|
|
91
|
<xsl:for-each select = "./oddescription">
|
92
|
<field name="oddescription" indexId = "datasourceoddescription" multiplicity="true" label="Description">
|
93
|
<xsl:attribute name="value">
|
94
|
<xsl:value-of select='.'/>
|
95
|
</xsl:attribute>
|
96
|
</field>
|
97
|
</xsl:for-each>
|
98
|
|
99
|
<xsl:for-each select = "./odnumberofitems">
|
100
|
<field name="odnumberofitems" indexId = "datasourceodnumberofitems" multiplicity="true" label="number of items">
|
101
|
<xsl:attribute name="value">
|
102
|
<xsl:value-of select='.'/>
|
103
|
</xsl:attribute>
|
104
|
</field>
|
105
|
</xsl:for-each>
|
106
|
|
107
|
<xsl:for-each select = "./odnumberofitemsdate">
|
108
|
<field name="odnumberofitemsdate" indexId = "datasourceodnumberofitemsdate" multiplicity="true" label="date">
|
109
|
<xsl:attribute name="value">
|
110
|
<xsl:value-of select='.'/>
|
111
|
</xsl:attribute>
|
112
|
</field>
|
113
|
</xsl:for-each>
|
114
|
|
115
|
<xsl:for-each select = "./odsubjects">
|
116
|
<field name="odsubjects" indexId = "datasourceodsubjects" multiplicity="true" label="Subjects">
|
117
|
<xsl:attribute name="value">
|
118
|
<xsl:value-of select='.'/>
|
119
|
</xsl:attribute>
|
120
|
</field>
|
121
|
</xsl:for-each>
|
122
|
|
123
|
<xsl:for-each select = "./odlanguages">
|
124
|
<field name="odlanguages" indexId = "datasourceodlanguages" multiplicity="true" label="Languages">
|
125
|
<xsl:attribute name="value">
|
126
|
<xsl:value-of select='.'/>
|
127
|
</xsl:attribute>
|
128
|
</field>
|
129
|
</xsl:for-each>
|
130
|
|
131
|
<xsl:for-each select = "./odcontenttypes">
|
132
|
<field name="odcontenttypes" indexId = "datasourceodcontenttypes" multiplicity="true" label="Content">
|
133
|
<xsl:attribute name="value">
|
134
|
<xsl:value-of select='.'/>
|
135
|
</xsl:attribute>
|
136
|
</field>
|
137
|
</xsl:for-each>
|
138
|
|
139
|
<xsl:for-each select = "./datasourcetype">
|
140
|
<field name="datasourcetypeid" indexId = "datasourcetypeid" multiplicity="true" label="Datasource type">
|
141
|
<xsl:attribute name="value">
|
142
|
<xsl:value-of select='./@classid'/>
|
143
|
</xsl:attribute>
|
144
|
</field>
|
145
|
|
146
|
<field name="datasourcetypename" indexId = "datasourcetypename" multiplicity="true" label="Datasource type">
|
147
|
<xsl:attribute name="value">
|
148
|
<xsl:value-of select='./@classname'/>
|
149
|
</xsl:attribute>
|
150
|
</field>
|
151
|
</xsl:for-each>
|
152
|
|
153
|
<xsl:for-each select = "./datasourcetypeui">
|
154
|
<field name="datasourcetypeuiid" indexId = "datasourcetypeui" multiplicity="true" label="Datasource type">
|
155
|
<xsl:attribute name="value">
|
156
|
<xsl:value-of select='./@classid'/>
|
157
|
</xsl:attribute>
|
158
|
</field>
|
159
|
</xsl:for-each>
|
160
|
|
161
|
<xsl:for-each select = "./openairecompatibility">
|
162
|
<field name="openairecompatibilityid" indexId = "datasourcecompatibilityid" multiplicity="true" label="openaire compatibility">
|
163
|
<xsl:attribute name="value">
|
164
|
<xsl:value-of select='./@classid'/>
|
165
|
</xsl:attribute>
|
166
|
</field>
|
167
|
|
168
|
<field name="openairecompatibilityname" indexId = "datasourcecompatibilityname" multiplicity="true" label="openaire compatibility">
|
169
|
<xsl:attribute name="value">
|
170
|
<xsl:value-of select='./@classname'/>
|
171
|
</xsl:attribute>
|
172
|
</field>
|
173
|
</xsl:for-each>
|
174
|
|
175
|
<xsl:for-each select = "./accessinfopackage">
|
176
|
<field name="accessinfopackage" indexId = "" multiplicity="true" label="OAI-PMH">
|
177
|
<xsl:attribute name="value">
|
178
|
<xsl:value-of select='.'/>
|
179
|
</xsl:attribute>
|
180
|
</field>
|
181
|
</xsl:for-each>
|
182
|
|
183
|
<xsl:for-each select = "./namespaceprefix">
|
184
|
<field name="namespaceprefix" indexId = "" multiplicity="true" label="namespace prefix">
|
185
|
<xsl:attribute name="value">
|
186
|
<xsl:value-of select='.'/>
|
187
|
</xsl:attribute>
|
188
|
</field>
|
189
|
</xsl:for-each>
|
190
|
|
191
|
<xsl:for-each select = "./odpolicies">
|
192
|
<field name="odpolicies" indexId = "" multiplicity="true" label="Policies">
|
193
|
<xsl:attribute name="value">
|
194
|
<xsl:value-of select='.'/>
|
195
|
</xsl:attribute>
|
196
|
</field>
|
197
|
</xsl:for-each>
|
198
|
|
199
|
<xsl:for-each select = "./pid">
|
200
|
<field name="pidid" indexId = "pidclassid" multiplicity="true" label="Pid">
|
201
|
<xsl:attribute name="value">
|
202
|
<xsl:value-of select='./@classid'/>
|
203
|
</xsl:attribute>
|
204
|
</field>
|
205
|
<field name="pidname" indexId = "pidclassname" multiplicity="true" label="Pid">
|
206
|
<xsl:attribute name="value">
|
207
|
<xsl:value-of select='./@classname'/>
|
208
|
</xsl:attribute>
|
209
|
</field>
|
210
|
</xsl:for-each>
|
211
|
|
212
|
<xsl:for-each select = "./aggregatortype">
|
213
|
<field name="aggregatortypeid" indexId = "" multiplicity="true" label="Pid">
|
214
|
<xsl:attribute name="value">
|
215
|
<xsl:value-of select='./@classid'/>
|
216
|
</xsl:attribute>
|
217
|
</field>
|
218
|
<field name="aggregatortypename" indexId = "" multiplicity="true" label="Pid">
|
219
|
<xsl:attribute name="value">
|
220
|
<xsl:value-of select='./@classname'/>
|
221
|
</xsl:attribute>
|
222
|
</field>
|
223
|
</xsl:for-each>
|
224
|
|
225
|
<field name="latitude" indexId="" multiplicity="false" label="latitutde">
|
226
|
<xsl:attribute name="value">
|
227
|
<xsl:value-of select='./latitude'/>
|
228
|
</xsl:attribute>
|
229
|
</field>
|
230
|
|
231
|
<field name="longitude" indexId="" multiplicity="false" label="longitude">
|
232
|
<xsl:attribute name="value">
|
233
|
<xsl:value-of select='./longitude'/>
|
234
|
</xsl:attribute>
|
235
|
</field>
|
236
|
|
237
|
<field name="dateofcollection" indexId="" multiplicity="false" label="date of collection">
|
238
|
<xsl:attribute name="value">
|
239
|
<xsl:value-of select='./dateofcollection'/>
|
240
|
</xsl:attribute>
|
241
|
</field>
|
242
|
|
243
|
</xsl:template>
|
244
|
|
245
|
<!-- RELS
|
246
|
1. person
|
247
|
2. project
|
248
|
3. organisation
|
249
|
4. result
|
250
|
5. datasource TODO
|
251
|
-->
|
252
|
<xsl:template match="rel">
|
253
|
<!--PERSON-->
|
254
|
<xsl:if test="./to/@type='person'">
|
255
|
<field name="author" indexId = "objIdentifier" multiplicity="true">
|
256
|
<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
|
257
|
<field name = "personId" indexId ="objIdentifier" multiplicity="false" label="Person id">
|
258
|
<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
|
259
|
</field>
|
260
|
<field name = "role" indexId ="" multiplicity="false" label="role">
|
261
|
<xsl:attribute name="value"><xsl:value-of select='./to/@class'/> </xsl:attribute>
|
262
|
</field>
|
263
|
<field name = "fullname" indexId ="personfullname" multiplicity="false" label="Person fullname">
|
264
|
<xsl:attribute name="value"><xsl:value-of select='./fullname'/> </xsl:attribute>
|
265
|
</field>
|
266
|
<field name = "ranking" indexId ="" multiplicity="false" label="ranking">
|
267
|
<xsl:attribute name="value"><xsl:value-of select='./ranking'/> </xsl:attribute>
|
268
|
</field>
|
269
|
</field>
|
270
|
</xsl:if>
|
271
|
<!--PROJECT-->
|
272
|
<xsl:if test="./to/@type='project'">
|
273
|
<field name="project" indexId = "objIdentifier" multiplicity="true">
|
274
|
<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
|
275
|
<field name = "projectId" indexId ="objIdentifier" multiplicity="false" label="Project id">
|
276
|
<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
|
277
|
</field>
|
278
|
<field name = "role" indexId ="" multiplicity="false" label="role">
|
279
|
<xsl:attribute name="value"><xsl:value-of select='./to/@class'/> </xsl:attribute>
|
280
|
</field>
|
281
|
<field name = "projectcode" indexId ="projectcode" multiplicity="false" label="Project(s)">
|
282
|
<xsl:attribute name="value"><xsl:value-of select='./code'/> </xsl:attribute>
|
283
|
</field>
|
284
|
<field name = "projectacronym" indexId ="projectacronym" multiplicity="false" label="Project(s)">
|
285
|
<xsl:attribute name="value"><xsl:value-of select='./acronym'/> </xsl:attribute>
|
286
|
</field>
|
287
|
<field name = "projecttitle" indexId ="projecttitle" multiplicity="false" label="Project title">
|
288
|
<xsl:attribute name="value"><xsl:value-of select='./title'/> </xsl:attribute>
|
289
|
</field>
|
290
|
<field name = "projectcontracttypeid" indexId ="projectcontracttypeid" multiplicity="false" label="Project contract type id">
|
291
|
<xsl:attribute name="value"><xsl:value-of select='./contracttype/@classid'/> </xsl:attribute>
|
292
|
</field>
|
293
|
<field name = "projectcontracttypename" indexId ="projectcontracttypename" multiplicity="false" label="Project contract type name">
|
294
|
<xsl:attribute name="value"><xsl:value-of select='./contracttype/@classname'/> </xsl:attribute>
|
295
|
</field>
|
296
|
</field>
|
297
|
</xsl:if>
|
298
|
<!--RESULT-->
|
299
|
<xsl:if test="./to/@type='result'">
|
300
|
<field name="result" indexId = "objIdentifier" multiplicity="true">
|
301
|
<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
|
302
|
<field name = "resultid" indexId ="objIdentifier" multiplicity="false" label="Result id">
|
303
|
<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
|
304
|
</field>
|
305
|
<field name = "title" indexId = "resulttitle" multiplicity = "false" label = "Title">
|
306
|
<xsl:attribute name="value">
|
307
|
<xsl:value-of select="./title"/>
|
308
|
</xsl:attribute>
|
309
|
</field>
|
310
|
<field name = "dateofacceptance" indexId = "resultdateofacceptance" multiplicity = "false" label = "Date of acceptance">
|
311
|
<xsl:attribute name="value">
|
312
|
<xsl:value-of select="./dateofacceptance"/>
|
313
|
</xsl:attribute>
|
314
|
</field>
|
315
|
<field name = "resulttypeid" indexId = "resulttypeid" multiplicity = "false" label = "type id">
|
316
|
<xsl:attribute name="value">
|
317
|
<xsl:value-of select="./resulttype/@classid"/>
|
318
|
</xsl:attribute>
|
319
|
</field>
|
320
|
<field name = "resulttypename" indexId = "resulttypename" multiplicity = "false" label = "type name">
|
321
|
<xsl:attribute name="value">
|
322
|
<xsl:value-of select="./resulttype/@classname"/>
|
323
|
</xsl:attribute>
|
324
|
</field>
|
325
|
</field>
|
326
|
</xsl:if>
|
327
|
<!--ORGANIZATION-->
|
328
|
<xsl:if test="./to/@type='organization'">
|
329
|
<field name="organization" indexId = "objIdentifier" multiplicity="true">
|
330
|
<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
|
331
|
<field name = "organizationid" indexId ="objIdentifier" multiplicity="false" label="Organization id">
|
332
|
<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
|
333
|
</field>
|
334
|
<field name = "role" indexId ="" multiplicity="false" label="role">
|
335
|
<xsl:attribute name="value"><xsl:value-of select='./to/@class'/> </xsl:attribute>
|
336
|
</field>
|
337
|
<field name = "legalshortname" indexId ="organizationlegalshortname" multiplicity="false" label="Organization short name">
|
338
|
<xsl:attribute name="value"><xsl:value-of select='./legalshortname'/> </xsl:attribute>
|
339
|
</field>
|
340
|
<field name = "legalname" indexId ="organizationlegalname" multiplicity="false" label="Organization name">
|
341
|
<xsl:attribute name="value"><xsl:value-of select='./legalname'/> </xsl:attribute>
|
342
|
</field>
|
343
|
<field name = "websiteurl" indexId ="organizationwebsiteurl" multiplicity="false" label="Website">
|
344
|
<xsl:attribute name="value"><xsl:value-of select='./websiteurl'/> </xsl:attribute>
|
345
|
</field>
|
346
|
<field name = "countryid" indexId ="organizationcountryid" multiplicity="false" label="Country code">
|
347
|
<xsl:attribute name="value"><xsl:value-of select='./country/@classid'/> </xsl:attribute>
|
348
|
</field>
|
349
|
<field name = "countryname" indexId ="organizationcountryname" multiplicity="false" label="Country">
|
350
|
<xsl:attribute name="value"><xsl:value-of select='./country/@classname'/> </xsl:attribute>
|
351
|
</field>
|
352
|
<field name = "participantnumber" indexId ="" multiplicity="false" label="Participant Number">
|
353
|
<xsl:attribute name="value"><xsl:value-of select='./participantnumber'/> </xsl:attribute>
|
354
|
</field>
|
355
|
<field name = "contactperson" indexId ="" multiplicity="false" label="Contact Person">
|
356
|
<xsl:attribute name="value"><xsl:value-of select='./contactperson'/> </xsl:attribute>
|
357
|
</field>
|
358
|
</field>
|
359
|
</xsl:if>
|
360
|
|
361
|
</xsl:template>
|
362
|
|
363
|
</xsl:stylesheet>
|
364
|
|
365
|
|