Project

General

Profile

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:organization"/>
12
            <xsl:apply-templates select="//rel"/>
13
        </result>
14
    </xsl:template>
15

    
16
    <!-- HEADER
17
    fields in header:
18
    1. dri:objIdentifier 		[objIdentifier]
19
    2. dri:repositoryId			X
20
    3. dri:dateOfCollection		X
21
    -->
22
    <xsl:template match = "header">
23
        <field name="organizationId" multiplicity="false" indexId="objIdentifier" label="Object id">
24
            <xsl:attribute name="value">
25
                <xsl:value-of select='./dri:objIdentifier'/>
26
            </xsl:attribute>
27
        </field>
28
        <!--<field name="repositoryId" multiplicity="false" indexId="???" label="???">
29
            <xsl:attribute name="value">
30
                <xsl:value-of select='./dri:repositoryId'/>
31
            </xsl:attribute>
32
        </field>-->
33
        <!--<field name="dateOfCollection" multiplicity="false" indexId="???" label="???">
34
            <xsl:attribute name="value">
35
                <xsl:value-of select='./dri:dateOfCollection'/>
36
            </xsl:attribute>
37
        </field>-->
38
    </xsl:template>
39

    
40
    <xsl:template match = "oaf:organization">
41

    
42
        <xsl:for-each select = "./legalshortname">
43
            <field name="legalshortname" indexId = "organizationlegalshortname" multiplicity="true" label="Legal short name">
44
                <xsl:attribute name="value">
45
                    <xsl:value-of select='.'/>
46
                </xsl:attribute>
47
            </field>
48
        </xsl:for-each>
49

    
50
        <xsl:for-each select = "./legalname">
51
            <field name="legalname" indexId = "organizationlegalname" multiplicity="true" label="Legal name">
52
                <xsl:attribute name="value">
53
                    <xsl:value-of select='.'/>
54
                </xsl:attribute>
55
            </field>
56
        </xsl:for-each>
57

    
58
        <xsl:for-each select = "./websiteurl">
59
            <field name="websiteurl" indexId = "organizationwebsiteurl" multiplicity="true" label="Website url">
60
                <xsl:attribute name="value">
61
                    <xsl:value-of select='.'/>
62
                </xsl:attribute>
63
            </field>
64
        </xsl:for-each>
65

    
66
        <xsl:for-each select = "./country">
67
            <field name="countryid" indexId = "organizationcountryid" multiplicity="true" label="Country">
68
                <xsl:attribute name="value">
69
                    <xsl:value-of select='./@classid'/>
70
                </xsl:attribute>
71
            </field>
72
            <field name="countryname" indexId = "organizationcountryname" multiplicity="true" label="Country">
73
                <xsl:attribute name="value">
74
                    <xsl:value-of select='./@classname'/>
75
                </xsl:attribute>
76
            </field>
77
        </xsl:for-each>
78

    
79

    
80
        <!--
81

    
82
            <xsl:for-each select = "./logourl">
83
                <field name="logourl" indexId = "organizationlogourl" multiplicity="true" label="Logo url">
84
                    <xsl:attribute name="value">
85
                        <xsl:value-of select='.'/>
86
                    </xsl:attribute>
87
                </field>
88
            </xsl:for-each>
89

    
90
            <xsl:for-each select = "./eclegalbody">
91
                <field name="eclegalbody" indexId = "organizationeclegalbody" multiplicity="true" label="Eclegal body">
92
                    <xsl:attribute name="value">
93
                        <xsl:value-of select='.'/>
94
                    </xsl:attribute>
95
                </field>
96
            </xsl:for-each>
97

    
98
            <xsl:for-each select = "./eclegalperson">
99
                <field name="eclegalperson" indexId = "organizationeclegalperson" multiplicity="true" label="Eclegal person">
100
                    <xsl:attribute name="value">
101
                        <xsl:value-of select='.'/>
102
                    </xsl:attribute>
103
                </field>
104
            </xsl:for-each>
105

    
106
            <xsl:for-each select = "./ecnonprofit">
107
                <field name="ecnonprofit" indexId = "organizationecnonprofit" multiplicity="true" label="EC non profit">
108
                    <xsl:attribute name="value">
109
                        <xsl:value-of select='.'/>
110
                    </xsl:attribute>
111
                </field>
112
            </xsl:for-each>
113

    
114
            <xsl:for-each select = "./ecresearchorganization">
115
                <field name="ecresearchorganization" indexId = "organizationecresearchorganization" multiplicity="true" label="EC research organization">
116
                    <xsl:attribute name="value">
117
                        <xsl:value-of select='.'/>
118
                    </xsl:attribute>
119
                </field>
120
            </xsl:for-each>
121

    
122
            <xsl:for-each select = "./echighereducation">
123
                <field name="echighereducation" indexId = "" multiplicity="true" label="EC higher education">
124
                    <xsl:attribute name="value">
125
                        <xsl:value-of select='.'/>
126
                    </xsl:attribute>
127
                </field>
128
            </xsl:for-each>
129

    
130
            <xsl:for-each select = "./ecinternationalorganizationeurinterests">
131
                <field name="ecinternationalorganizationeurinterests" indexId = "organizationecinternationalorganizationeurinterests" multiplicity="true" label="EC international organization eur interests">
132
                    <xsl:attribute name="value">
133
                        <xsl:value-of select='.'/>
134
                    </xsl:attribute>
135
                </field>
136
            </xsl:for-each>
137

    
138
            <xsl:for-each select = "./ecinternationalorganization">
139
                <field name="ecinternationalorganization" indexId = "organizationecinternationalorganization" multiplicity="true" label="EC international organization">
140
                    <xsl:attribute name="value">
141
                        <xsl:value-of select='.'/>
142
                    </xsl:attribute>
143
                </field>
144
            </xsl:for-each>
145

    
146
            <xsl:for-each select = "./ecenterprise">
147
                <field name="ecenterprise" indexId = "organizationecenterprise" multiplicity="true" label="EC enterprice">
148
                    <xsl:attribute name="value">
149
                        <xsl:value-of select='.'/>
150
                    </xsl:attribute>
151
                </field>
152
            </xsl:for-each>
153

    
154
            <xsl:for-each select = "./ecsmevalidated">
155
                <field name="ecsmevalidated" indexId = "organizationecsmevalidated" multiplicity="true" label="EC sme validated">
156
                    <xsl:attribute name="value">
157
                        <xsl:value-of select='.'/>
158
                    </xsl:attribute>
159
                </field>
160
            </xsl:for-each>
161

    
162
            <xsl:for-each select = "./ecnutscode">
163
                <field name="ecnutscode" indexId = "organizationecnutscode" multiplicity="true" label="EC nuts code">
164
                    <xsl:attribute name="value">
165
                        <xsl:value-of select='.'/>
166
                    </xsl:attribute>
167
                </field>
168
            </xsl:for-each>
169

    
170
            <xsl:for-each select = "./collectedfrom">
171
                <field name="collectedfrom" indexId = "organizationcollectedfrom" multiplicity="true" label="Collected from">
172
                    <xsl:attribute name="value">
173
                        <xsl:value-of select='.'/>
174
                    </xsl:attribute>
175
                </field>
176
            </xsl:for-each>
177

    
178

    
179
            <xsl:for-each select = "./pid">
180
                <field name="pidid" indexId = "pidclassid" multiplicity="true" label="Pid">
181
                    <xsl:attribute name="value">
182
                        <xsl:value-of select='./@classid'/>
183
                    </xsl:attribute>
184
                </field>
185
                <field name="pidname" indexId = "pidclassname" multiplicity="true" label="Pid">
186
                    <xsl:attribute name="value">
187
                        <xsl:value-of select='./@classname'/>
188
                    </xsl:attribute>
189
                </field>
190
            </xsl:for-each>
191

    
192
        -->
193
    </xsl:template>
194

    
195
    <xsl:template match="rel">
196
        <!--PERSON-->
197
        <xsl:if test="./to/@type='person'">
198
            <field name="author" indexId = "objIdentifier"  multiplicity="true">
199
                <xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
200
                <field name = "personId" indexId ="objIdentifier" multiplicity="false" label="Person id">
201
                    <xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
202
                </field>
203
                <field name = "role" indexId ="" multiplicity="false" label="role">
204
                    <xsl:attribute name="value"><xsl:value-of select='./to/@class'/> </xsl:attribute>
205
                </field>
206
                <field name = "fullname" indexId ="personfullname" multiplicity="false" label="Person fullname">
207
                    <xsl:attribute name="value"><xsl:value-of select='./fullname'/> </xsl:attribute>
208
                </field>
209
                <field name = "ranking" indexId ="" multiplicity="false" label="ranking">
210
                    <xsl:attribute name="value"><xsl:value-of select='./ranking'/> </xsl:attribute>
211
                </field>
212
            </field>
213
        </xsl:if>
214
        <!--PROJECT-->
215
        <xsl:if test="./to/@type='project'">
216
            <field name="project" indexId = "objIdentifier" multiplicity="true">
217
                <xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
218
                <field name = "projectId" indexId ="objIdentifier" multiplicity="false" label="Project id">
219
                    <xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
220
                </field>
221
                <field name = "role" indexId ="" multiplicity="false" label="role">
222
                    <xsl:attribute name="value"><xsl:value-of select='./to/@class'/> </xsl:attribute>
223
                </field>
224
                <field name = "projectcode" indexId ="projectcode" multiplicity="false" label="Project(s)">
225
                    <xsl:attribute name="value"><xsl:value-of select='./code'/> </xsl:attribute>
226
                </field>
227
                <field name = "projectacronym" indexId ="projectacronym" multiplicity="false" label="Project(s)">
228
                    <xsl:attribute name="value"><xsl:value-of select='./acronym'/> </xsl:attribute>
229
                </field>
230
                <field name = "projecttitle" indexId ="projecttitle" multiplicity="false" label="Project title">
231
                    <xsl:attribute name="value"><xsl:value-of select='./title'/> </xsl:attribute>
232
                </field>
233
                <field name = "projectcontracttypeid" indexId ="projectcontracttypeid" multiplicity="false" label="Project contract type id">
234
                    <xsl:attribute name="value"><xsl:value-of select='./contracttype/@classid'/> </xsl:attribute>
235
                </field>
236
                <field name = "projectcontracttypename" indexId ="projectcontracttypename" multiplicity="false" label="Project contract type name">
237
                    <xsl:attribute name="value"><xsl:value-of select='./contracttype/@classname'/> </xsl:attribute>
238
                </field>
239
                <xsl:for-each select = "./funding">
240
                    <field name = "funding" indexId = "" multiplicity = "true">
241
                        <field name ="funder" indexId ="relfunder" multiplicity ="false">
242
                            <xsl:attribute name="value"><xsl:value-of select='./funder/@name'/></xsl:attribute>
243
                        </field>
244
                        <field name ="funderid" indexId ="relfunderid" multiplicity ="false">
245
                            <xsl:attribute name="value"><xsl:value-of select='./funder/@id'/></xsl:attribute>
246
                        </field>
247
                        <field name ="fundershortname" indexId ="" multiplicity ="false">
248
                            <xsl:attribute name="value"><xsl:value-of select='./funder/@shortname'/></xsl:attribute>
249
                        </field>
250
                    </field>
251
                </xsl:for-each>
252
            </field>
253
        </xsl:if>
254
        <!--RESULT-->
255
        <xsl:if test="./to/@type='result'">
256
            <field name="result" indexId = "objIdentifier"  multiplicity="true">
257
                <xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
258
                <field name = "resultid" indexId ="objIdentifier" multiplicity="false" label="Result id">
259
                    <xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
260
                </field>
261
                <field name = "title" indexId = "resulttitle" multiplicity = "false" label = "Title">
262
                    <xsl:attribute name="value">
263
                        <xsl:value-of select="./title"/>
264
                    </xsl:attribute>
265
                </field>
266
                <field name = "dateofacceptance" indexId = "resultdateofacceptance" multiplicity = "false" label = "Date of acceptance">
267
                    <xsl:attribute name="value">
268
                        <xsl:value-of select="./dateofacceptance"/>
269
                    </xsl:attribute>
270
                </field>
271
                <field name = "resulttypeid" indexId = "resulttypeid" multiplicity = "false" label = "type id">
272
                    <xsl:attribute name="value">
273
                        <xsl:value-of select="./resulttype/@classid"/>
274
                    </xsl:attribute>
275
                </field>
276
                <field name = "resulttypename" indexId = "resulttypename" multiplicity = "false" label = "type name">
277
                    <xsl:attribute name="value">
278
                        <xsl:value-of select="./resulttype/@classname"/>
279
                    </xsl:attribute>
280
                </field>
281
            </field>
282
        </xsl:if>
283
        <!--ORGANIZATION-->
284
        <xsl:if test="./to/@type='organization'">
285
            <field name="organization" indexId = "objIdentifier"  multiplicity="true">
286
                <xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
287
                <field name = "organizationid" indexId ="objIdentifier" multiplicity="false" label="Organization id">
288
                    <xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
289
                </field>
290
                <field name = "role" indexId ="" multiplicity="false" label="role">
291
                    <xsl:attribute name="value"><xsl:value-of select='./to/@class'/> </xsl:attribute>
292
                </field>
293
                <field name = "legalshortname" indexId ="organizationlegalshortname" multiplicity="false" label="Organization short name">
294
                    <xsl:attribute name="value"><xsl:value-of select='./legalshortname'/> </xsl:attribute>
295
                </field>
296
                <field name = "websiteurl" indexId ="organizationwebsiteurl" multiplicity="false" label="Website">
297
                    <xsl:attribute name="value"><xsl:value-of select='./websiteurl'/> </xsl:attribute>
298
                </field>
299
                <field name = "countryid" indexId ="organizationcountryid" multiplicity="false" label="Country code">
300
                    <xsl:attribute name="value"><xsl:value-of select='./country/@classid'/> </xsl:attribute>
301
                </field>
302
                <field name = "countryname" indexId ="organizationcountryname" multiplicity="false" label="Country">
303
                    <xsl:attribute name="value"><xsl:value-of select='./country/@classname'/> </xsl:attribute>
304
                </field>
305
                <field name = "participantnumber" indexId ="" multiplicity="false" label="Participant Number">
306
                    <xsl:attribute name="value"><xsl:value-of select='./participantnumber'/> </xsl:attribute>
307
                </field>
308
                <field name = "contactperson" indexId ="" multiplicity="false" label="Contact Person">
309
                    <xsl:attribute name="value"><xsl:value-of select='./contactperson'/> </xsl:attribute>
310
                </field>
311
            </field>
312
        </xsl:if>
313

    
314
    </xsl:template>
315

    
316
</xsl:stylesheet>
(18-18/40)