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
|
<xsl:template match = "/">
|
8
|
<result type ="result">
|
9
|
<xsl:apply-templates select="//header"/>
|
10
|
<xsl:apply-templates select="//oaf:result"/>
|
11
|
<xsl:apply-templates select="//rel"/>
|
12
|
<xsl:apply-templates select="//instances"/>
|
13
|
</result>
|
14
|
</xsl:template>
|
15
|
|
16
|
<xsl:template match = "header">
|
17
|
<field name="resultId" multiplicity="false" indexId="objIdentifier" label="object id">
|
18
|
<xsl:attribute name="value">
|
19
|
<xsl:value-of select='./dri:objIdentifier'/>
|
20
|
</xsl:attribute>
|
21
|
</field>
|
22
|
</xsl:template>
|
23
|
|
24
|
<xsl:template match = "oaf:result">
|
25
|
<xsl:for-each select = "./dc:title">
|
26
|
<field name="title" indexId = "title" multiplicity="true" label="Title">
|
27
|
<xsl:attribute name="value">
|
28
|
<xsl:value-of select='.'/>
|
29
|
</xsl:attribute>
|
30
|
</field>
|
31
|
</xsl:for-each>
|
32
|
<xsl:for-each select = "./dc:creator">
|
33
|
<field name="creator" indexId = "creator" multiplicity="true" label="Author(s)">
|
34
|
<xsl:attribute name="value">
|
35
|
<xsl:value-of select='.'/>
|
36
|
</xsl:attribute>
|
37
|
</field>
|
38
|
</xsl:for-each>
|
39
|
<xsl:for-each select = "./dc:description">
|
40
|
<field name="description" indexId = "description" multiplicity="true" label="Description">
|
41
|
<xsl:attribute name="value">
|
42
|
<xsl:value-of select='.'/>
|
43
|
</xsl:attribute>
|
44
|
</field>
|
45
|
</xsl:for-each>
|
46
|
<xsl:for-each select = "./dc:publisher">
|
47
|
<field name="publisher" indexId = "publisher" multiplicity="true" label="Publisher(s)">
|
48
|
<xsl:attribute name="value">
|
49
|
<xsl:value-of select='.'/>
|
50
|
</xsl:attribute>
|
51
|
</field>
|
52
|
</xsl:for-each>
|
53
|
<xsl:for-each select = "./dc:identifier">
|
54
|
<field name="identifier" indexId = "identifier" multiplicity="true" label="id">
|
55
|
<xsl:attribute name="value">
|
56
|
<xsl:value-of select='.'/>
|
57
|
</xsl:attribute>
|
58
|
</field>
|
59
|
</xsl:for-each>
|
60
|
<xsl:for-each select = "./dc:subject">
|
61
|
<field name="subject" indexId = "subject" multiplicity="true" label="Subject(s)">
|
62
|
<xsl:attribute name="value">
|
63
|
<xsl:value-of select='.'/>
|
64
|
</xsl:attribute>
|
65
|
</field>
|
66
|
</xsl:for-each>
|
67
|
<xsl:for-each select = "./dc:language">
|
68
|
<field name="language" indexId = "language" multiplicity="true" label="Language">
|
69
|
<xsl:attribute name="value">
|
70
|
<xsl:value-of select='.'/>
|
71
|
</xsl:attribute>
|
72
|
</field>
|
73
|
</xsl:for-each>
|
74
|
<xsl:for-each select = "./oaf:publicationdate">
|
75
|
<field name="publicationdate" indexId = "publicationdate" multiplicity="true" label="Publication date">
|
76
|
<xsl:attribute name="value">
|
77
|
<xsl:value-of select='.'/>
|
78
|
</xsl:attribute>
|
79
|
</field>
|
80
|
</xsl:for-each>
|
81
|
<xsl:for-each select = "./oaf:publicationyear">
|
82
|
<field name="publicationyear" indexId = "publicationyear" multiplicity="true" label="Publication year">
|
83
|
<xsl:attribute name="value">
|
84
|
<xsl:value-of select='.'/>
|
85
|
</xsl:attribute>
|
86
|
</field>
|
87
|
</xsl:for-each>
|
88
|
<xsl:for-each select = "./oaf:embargoenddate">
|
89
|
<field name="embargoenddate" indexId = "embargoenddate" multiplicity="true" label="Embargo end date">
|
90
|
<xsl:attribute name="value">
|
91
|
<xsl:value-of select='.'/>
|
92
|
</xsl:attribute>
|
93
|
</field>
|
94
|
</xsl:for-each>
|
95
|
<xsl:for-each select = "./oaf:embargoendyear">
|
96
|
<field name="embargoendyear" indexId = "embargoendyear" multiplicity="true" label="Embargo end year">
|
97
|
<xsl:attribute name="value">
|
98
|
<xsl:value-of select='.'/>
|
99
|
</xsl:attribute>
|
100
|
</field>
|
101
|
</xsl:for-each>
|
102
|
<xsl:for-each select = "./oaf:accessmode">
|
103
|
<field name="accessmode" indexId = "accessmode" multiplicity="true" label="Access mode">
|
104
|
<xsl:attribute name="value">
|
105
|
<xsl:value-of select='.'/>
|
106
|
</xsl:attribute>
|
107
|
</field>
|
108
|
</xsl:for-each>
|
109
|
<xsl:for-each select = "./oaf:haskind">
|
110
|
<field name="haskind" indexId = "haskind" multiplicity="true" label="has kind">
|
111
|
<xsl:attribute name="value">
|
112
|
<xsl:value-of select='.'/>
|
113
|
</xsl:attribute>
|
114
|
</field>
|
115
|
</xsl:for-each>
|
116
|
<xsl:for-each select = "./oaf:hastype">
|
117
|
<field name="hastype" indexId = "hastype" multiplicity="true" label="has type">
|
118
|
<xsl:attribute name="value">
|
119
|
<xsl:value-of select='.'/>
|
120
|
</xsl:attribute>
|
121
|
</field>
|
122
|
</xsl:for-each>
|
123
|
<xsl:for-each select = "./oaf:affiliationid">
|
124
|
<field name="affiliationid" indexId = "affiliationid" multiplicity="true" label="Affiliation">
|
125
|
<xsl:attribute name="value">
|
126
|
<xsl:value-of select='.'/>
|
127
|
</xsl:attribute>
|
128
|
</field>
|
129
|
</xsl:for-each>
|
130
|
<xsl:for-each select = "./oaf:countryaffiliation">
|
131
|
<field name="countryaffiliation" indexId = "countryaffiliation" multiplicity="true" label="Country">
|
132
|
<xsl:attribute name="value">
|
133
|
<xsl:value-of select='.'/>
|
134
|
</xsl:attribute>
|
135
|
</field>
|
136
|
</xsl:for-each>
|
137
|
<xsl:for-each select = "./oaf:affiliationname">
|
138
|
<field name="affiliationname" indexId = "affiliationname" multiplicity="true" label="Affiliation">
|
139
|
<xsl:attribute name="value">
|
140
|
<xsl:value-of select='.'/>
|
141
|
</xsl:attribute>
|
142
|
</field>
|
143
|
</xsl:for-each>
|
144
|
<xsl:for-each select = "./oaf:aggregatedby">
|
145
|
<field name="aggregatedby" indexId = "aggregatedby" multiplicity="true" label="Aggregated by">
|
146
|
<xsl:attribute name="value">
|
147
|
<xsl:value-of select='.'/>
|
148
|
</xsl:attribute>
|
149
|
</field>
|
150
|
</xsl:for-each>
|
151
|
<xsl:for-each select = "./oaf:aggregatorname">
|
152
|
<field name="aggregatorname" indexId = "aggregatorname" multiplicity="true" label="Aggregator(s)">
|
153
|
<xsl:attribute name="value">
|
154
|
<xsl:value-of select='.'/>
|
155
|
</xsl:attribute>
|
156
|
</field>
|
157
|
</xsl:for-each>
|
158
|
<xsl:for-each select = "./oaf:aggregatorurl">
|
159
|
<field name="aggregatorurl" indexId = "aggregatorurl" multiplicity="true" label="Aggregator url">
|
160
|
<xsl:attribute name="value">
|
161
|
<xsl:value-of select='.'/>
|
162
|
</xsl:attribute>
|
163
|
</field>
|
164
|
</xsl:for-each>
|
165
|
<xsl:for-each select="./bestlicense">
|
166
|
<field name="bestlicense" indexId="resultbestlicense" multiplicity="false" label="Best license">
|
167
|
<xsl:attribute name="value">
|
168
|
<xsl:value-of select="./@classname"/>
|
169
|
</xsl:attribute>
|
170
|
</field>
|
171
|
</xsl:for-each>
|
172
|
</xsl:template>
|
173
|
|
174
|
<xsl:template match="rel">
|
175
|
<xsl:if test="./to/@type='person'">
|
176
|
<field name="author" indexId = "" multiplicity="true">
|
177
|
<field name = "personId" indexId ="" multiplicity="false" label="person">
|
178
|
<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
|
179
|
</field>
|
180
|
<field name = "fullname" indexId ="" multiplicity="false" label="Person fullname">
|
181
|
<xsl:attribute name="value"><xsl:value-of select='./oaf:fullname'/> </xsl:attribute>
|
182
|
</field>
|
183
|
</field>
|
184
|
</xsl:if>
|
185
|
<xsl:if test="./to/@type='project'">
|
186
|
<field name="project" indexId = "" multiplicity="true">
|
187
|
<field name = "projectgrantagreementnumber" indexId ="projectgrantagreementnumber" multiplicity="false" label="Project grant agreement number">
|
188
|
<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
|
189
|
</field>
|
190
|
<field name = "projectname" indexId ="projectname" multiplicity="false" label="Project(s)">
|
191
|
<xsl:attribute name="value"><xsl:value-of select='./oaf:projectname'/> </xsl:attribute>
|
192
|
</field>
|
193
|
</field>
|
194
|
</xsl:if>
|
195
|
</xsl:template>
|
196
|
|
197
|
<xsl:template match="instances">
|
198
|
<xsl:for-each select = "./instance">
|
199
|
<field name = "repository" indexId = "" multiplicity="true">
|
200
|
<field name = "instanceId" indexId = "objIdentifier" multiplicity = "false">
|
201
|
<xsl:attribute name="value"><xsl:value-of select="./@id"/></xsl:attribute>
|
202
|
</field>
|
203
|
<field name = "repositoryname" indexId = "datasourcename" multiplicity="false">
|
204
|
<xsl:attribute name = "value"> <xsl:value-of select="./datasource/oaf:datasourcename"/> </xsl:attribute>
|
205
|
</field>
|
206
|
<field name = "repositoryid" indexId = "datasourceid" multiplicity="false">
|
207
|
<xsl:attribute name = "value"> <xsl:value-of select="./datasource/oaf:datasourceid"/> </xsl:attribute>
|
208
|
</field>
|
209
|
<xsl:for-each select="./webresource">
|
210
|
<field name = "url" indexId = "dc:identifier" multiplicity="true">
|
211
|
<xsl:attribute name = "value"> <xsl:value-of select="./dc:identifier"/> </xsl:attribute>
|
212
|
</field>
|
213
|
</xsl:for-each>
|
214
|
</field>
|
215
|
</xsl:for-each>
|
216
|
</xsl:template>
|
217
|
|
218
|
</xsl:stylesheet>
|
219
|
|