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

    
10
<result type ="result">
11
	<test_the></test_the>
12
	<xsl:apply-templates select="//header"/>
13
    <xsl:apply-templates select="//children/result"/>
14
	<xsl:apply-templates select="//oaf:result"/>
15
	<xsl:apply-templates select="//rel"/>
16
	<xsl:apply-templates select="//children"/>
17
    <xsl:apply-templates select="//extraInfo"/>
18
</result>
19
</xsl:template>
20

    
21
<!-- HEADER
22
fields in header:
23
1. dri:objIdentifier 		[objIdentifier]
24
2. dri:repositoryId			X
25
3. dri:dateOfCollection		X
26
-->
27

    
28
<xsl:template match="text()">
29
	<xsl:value-of select="replace(., '[&#x007F;-&#x009F;]', ' ')"/>
30
</xsl:template>
31

    
32
<xsl:template match = "header">
33
	<field name="resultId" multiplicity="false" indexId="objIdentifier" label="Object id">
34
		<xsl:attribute name="value">
35
			<xsl:value-of select='./dri:objIdentifier'/>
36
		</xsl:attribute>
37
	</field>
38

    
39
	<field name="underCuration" multiplicity="false" indexId="" label="Under Curation">
40
		<xsl:attribute name="value">
41
			<xsl:value-of select='./dri:status'/>
42
		</xsl:attribute>
43
	</field>
44

    
45
	<!--<field name="repositoryId" multiplicity="false" indexId="???" label="???">
46
		<xsl:attribute name="value">
47
			<xsl:value-of select='./dri:repositoryId'/>
48
		</xsl:attribute>
49
	</field>-->
50
	<!--<field name="dateOfCollection" multiplicity="false" indexId="???" label="???">
51
		<xsl:attribute name="value">
52
			<xsl:value-of select='./dri:dateOfCollection'/>
53
		</xsl:attribute>
54
	</field>-->
55
</xsl:template>
56

    
57

    
58
<xsl:template match = "oaf:result">
59

    
60
	<xsl:for-each select = "./title">
61
		<field name="title" indexId = "resulttitle" multiplicity="true" label="Title">
62
			<xsl:attribute name="value">
63
				<xsl:value-of select='.'/>
64
			</xsl:attribute>
65
		</field>
66
	</xsl:for-each>
67

    
68
	<xsl:for-each select = "./dateofacceptance">
69
		<field name="dateofacceptance" indexId = "resultdateofacceptance" multiplicity="true" label="Date of acceptance">
70
			<xsl:attribute name="value">
71
				<xsl:value-of select='.'/>
72
			</xsl:attribute>
73
		</field>
74
	</xsl:for-each>
75

    
76
	<xsl:for-each select = "./storagedate">
77
		<field name="storagedate" indexId = "resultstoragedate" multiplicity="true" label="Date of storage">
78
			<xsl:attribute name="value">
79
				<xsl:value-of select='.'/>
80
			</xsl:attribute>
81
		</field>
82
	</xsl:for-each>
83

    
84
	<xsl:for-each select = "./description">
85
		<field name="description" indexId = "resultdescription" multiplicity="true" label="Description">
86
			<xsl:attribute name="value">
87
				<xsl:value-of select='.'/>
88
			</xsl:attribute>
89
		</field>
90
	</xsl:for-each>
91

    
92
	<xsl:for-each select = "./publisher">
93
		<field name="publisher" indexId = "resultpublisher" multiplicity="true" label="Publisher(s)">
94
			<xsl:attribute name="value">
95
				<xsl:value-of select='.'/>
96
			</xsl:attribute>
97
		</field>
98
	</xsl:for-each>
99

    
100
	<xsl:for-each select = "./language">
101
		<field name="languageid" indexId = "resultlanguageid" multiplicity="true" label="Language(s)">
102
			<xsl:attribute name="value">
103
				<xsl:value-of select='./@classid'/>
104
			</xsl:attribute>
105
		</field>
106
		<field name="languagename" indexId = "resultlanguagename" multiplicity="true" label="Language(s)">
107
			<xsl:attribute name="value">
108
				<xsl:value-of select='./@classname'/>
109
			</xsl:attribute>
110
		</field>
111
		<field name="language" indexId = "" multiplicity="true" label="Language(s)">
112
			<xsl:attribute name="value">
113
				<xsl:value-of select='./@classname'/>
114
			</xsl:attribute>
115
			<xsl:attribute name="value_original">
116
				<xsl:value-of select='./@classid'/>
117
			</xsl:attribute>
118
		</field>
119
	</xsl:for-each>
120

    
121
	<xsl:for-each select = "./resulttype">
122
		<field name="resulttypeid" indexId = "resulttypeid" multiplicity="true" label="Type">
123
			<xsl:attribute name="value">
124
				<xsl:value-of select='./@classid'/>
125
			</xsl:attribute>
126
		</field>
127
		<field name="resulttypename" indexId = "resulttypename" multiplicity="true" label="Type">
128
			<xsl:attribute name="value">
129
				<xsl:value-of select='./@classname'/>
130
			</xsl:attribute>
131
		</field>
132
	</xsl:for-each>
133

    
134
	<xsl:for-each select = "./resourcetype">
135
		<field name="resourcetypeid" indexId = "" multiplicity="true" label="Resource Type">
136
			<xsl:attribute name="value">
137
				<xsl:value-of select='./@classid'/>
138
			</xsl:attribute>
139
		</field>
140
		<field name="resourcetypename" indexId = "" multiplicity="true" label="Resource Type">
141
			<xsl:attribute name="value">
142
				<xsl:value-of select='./@classname'/>
143
			</xsl:attribute>
144
		</field>
145
	</xsl:for-each>
146

    
147
	<xsl:for-each select = "./subject">
148
		<field name="subject" indexId = "resultsubject" multiplicity="true" label="Subject">
149
			<xsl:attribute name="value">
150
				<xsl:value-of select='.'/>
151
			</xsl:attribute>
152
 			<field name = "inferred" indexId="" multiplicity = "false" label="inferred">
153
				<xsl:attribute name="value">
154
					<xsl:choose>
155
						<xsl:when test="@inferred !=''">
156
							<xsl:value-of select="@inferred"/>
157
						</xsl:when>
158
						<xsl:otherwise>
159
							<xsl:text>false</xsl:text>
160
						</xsl:otherwise>
161
					</xsl:choose>
162
				</xsl:attribute>
163
			</field>
164
			<field name = "trust" indexId="" multiplicity = "false" label="trust level">
165
				<xsl:attribute name="value">
166
					<xsl:choose>
167
						<xsl:when test="@trust !=''">
168
							<xsl:value-of select="@trust"/>
169
						</xsl:when>
170
						<xsl:otherwise>
171
							<xsl:text>NEUTRAL</xsl:text>
172
						</xsl:otherwise>
173
					</xsl:choose>
174
				</xsl:attribute>
175
			</field>
176
            <field name = "provenance" indexId="" multiplicity = "false" label="provenance">
177
				<xsl:attribute name="value">
178
				<xsl:choose>
179
						<xsl:when test="@provenanceaction !=''">
180
							<xsl:value-of select="@provenanceaction"/>
181
						</xsl:when>
182
						<xsl:otherwise>
183
							<xsl:text></xsl:text>
184
						</xsl:otherwise>
185
					</xsl:choose>
186
				</xsl:attribute>
187
			</field>
188
			<field name="taxonomy" indexId="" multiplicity="false">
189
				<xsl:attribute name="value">
190
					<xsl:choose>
191
						<xsl:when test="@classname !=''">
192
							<xsl:value-of select="@classname"/>
193
						</xsl:when>
194
						<xsl:otherwise>
195
							<xsl:text></xsl:text>
196
						</xsl:otherwise>
197
					</xsl:choose>
198
				</xsl:attribute>
199
			</field>
200
		</field>
201
	</xsl:for-each>
202

    
203
	<xsl:for-each select = "./relevantdate">
204
		<field name="relevantyear" indexId = "" multiplicity="true" label="Relevant year">
205
			<xsl:attribute name="value">
206
				<xsl:value-of select='substring-before(.,"-")'/>
207
			</xsl:attribute>
208
		</field>
209
		<field name="relevantdate" indexId = "resultdate" multiplicity="true" label="Relevant date">
210
			<xsl:attribute name="value">
211
				<xsl:value-of select='.'/>
212
			</xsl:attribute>
213
		</field>
214
	</xsl:for-each>
215

    
216
	<xsl:for-each select = "./pid">
217
		<field name="pid" multiplicity="true" label="Pid">
218
			<field name="value" indexId = "pid" multiplicity="false" label="Pid">
219
				<xsl:attribute name="value">
220
					<xsl:value-of select='.'/>
221
				</xsl:attribute>
222
			</field>
223
			<field name="classid" indexId = "pidclassid" multiplicity="false" label="Pid class id">
224
				<xsl:attribute name="value">
225
					<xsl:value-of select='./@classid'/>
226
				</xsl:attribute>
227
			</field>
228
			<field name="classname" indexId = "pidclassname" multiplicity="false" label="Pid class name">
229
				<xsl:attribute name="value">
230
					<xsl:value-of select='./@classname'/>
231
				</xsl:attribute>
232
			</field>
233
		</field>
234
	</xsl:for-each>
235

    
236
    <xsl:for-each select="./bestlicense">
237
        <field name="bestlicense" indexId="resultbestlicense" multiplicity="false" label="Best License">
238
            <xsl:attribute name="value">
239
                <xsl:value-of select="@classid" />
240
            </xsl:attribute>
241
        </field>
242
    </xsl:for-each>
243

    
244
	<xsl:for-each select = "./embargoenddate">
245
		<field name="embargoendyear" indexId = "" multiplicity="true" label="Embargo end year">
246
			<xsl:attribute name="value">
247
				<xsl:value-of select='substring-before(.,"-")'/>
248
			</xsl:attribute>
249
		</field>
250
		<field name="embargoenddate" indexId = "resultembargoenddate" multiplicity="true" label="Embargo end date">
251
			<xsl:attribute name="value">
252
				<xsl:value-of select='.'/>
253
			</xsl:attribute>
254
		</field>
255
	</xsl:for-each>
256

    
257
	<xsl:for-each select = "./journal">
258
		<field name="journal" indexId = "" multiplicity="true" label="Journal">
259
			<xsl:attribute name="value">
260
				<xsl:value-of select='.'/>
261
			</xsl:attribute>
262
		</field>
263
	</xsl:for-each>
264

    
265
	<xsl:for-each select = "./collectedfrom">
266
		<field name="collectedfrom">
267
		<field name="collectedfromid" indexId = "resultcollectedfromdatasourceid" multiplicity="true" label="Collected from">
268
                <xsl:attribute name="value">
269
                        <xsl:value-of select='./@id'/>
270
                </xsl:attribute>
271
        </field>
272
        <field name="collectedfromname" indexId = "" multiplicity="true" label="Collected from">
273
                <xsl:attribute name="value">
274
                        <xsl:value-of select='./@name'/>
275
                </xsl:attribute>
276
        </field>
277
		</field>
278
	</xsl:for-each>
279

    
280
	<xsl:for-each select = "./device">
281
		<field name="device" indexId = "" multiplicity="true" label="Device">
282
			<xsl:attribute name="value">
283
				<xsl:value-of select='.'/>
284
			</xsl:attribute>
285
		</field>
286
	</xsl:for-each>
287

    
288
	<xsl:for-each select = "./size">
289
		<field name="size" indexId = "" multiplicity="true" label="Size">
290
			<xsl:attribute name="value">
291
				<xsl:value-of select='.'/>
292
			</xsl:attribute>
293
		</field>
294
	</xsl:for-each>
295

    
296
	<xsl:for-each select = "./format">
297
		<field name="format" indexId = "" multiplicity="true" label="Format">
298
			<xsl:attribute name="value">
299
				<xsl:value-of select='.'/>
300
			</xsl:attribute>
301
		</field>
302
	</xsl:for-each>
303

    
304
	<xsl:for-each select = "./version">
305
		<field name="version" indexId = "" multiplicity="true" label="Version">
306
			<xsl:attribute name="value">
307
				<xsl:value-of select='.'/>
308
			</xsl:attribute>
309
		</field>
310
	</xsl:for-each>
311

    
312
	<xsl:for-each select = "./lastmetadataupdate">
313
		<field name="lastmetadataupdate" indexId = "" multiplicity="true" label="Last metadata update">
314
			<xsl:attribute name="value">
315
				<xsl:value-of select='.'/>
316
			</xsl:attribute>
317
		</field>
318
	</xsl:for-each>
319

    
320
	<xsl:for-each select = "./metadataversionnumber">
321
		<field name="metadataversionnumber" indexId = "" multiplicity="true" label="Metadata version number">
322
			<xsl:attribute name="value">
323
				<xsl:value-of select='.'/>
324
			</xsl:attribute>
325
		</field>
326
	</xsl:for-each>
327

    
328
	<xsl:for-each select = "./source">
329
		<field name="source" indexId = "" multiplicity="true" label="source">
330
			<xsl:attribute name="value">
331
				<xsl:value-of select='.'/>
332
			</xsl:attribute>
333
		</field>
334
	</xsl:for-each>
335

    
336
	<xsl:for-each select = "./context">
337
		<field indexId="context" multiplicity="true" name="context" >
338

    
339
			<xsl:attribute name="value">
340
				<xsl:value-of select='./@value'/>
341
			</xsl:attribute>
342
			<xsl:attribute name="value_original">
343
				<xsl:value-of select='./@id'/>
344
			</xsl:attribute>
345

    
346
			<field name="contexttype" indexId="contexttype" multiplicity="false" label="Context Type">
347
				<xsl:attribute name="value">
348
					<xsl:value-of select="@type"></xsl:value-of>
349
				</xsl:attribute>
350
			</field>
351

    
352
			<xsl:for-each select = "./category">
353
				<field name="category" indexId="category" multiplicity="true" label="Category" >
354
					<xsl:attribute name="value">
355
						<xsl:value-of select='./@label' />
356
					</xsl:attribute>
357
					<xsl:attribute name="value_original">
358
						<xsl:value-of select='./@id'/>
359
					</xsl:attribute>
360

    
361
					<xsl:for-each select = ".//concept">
362
						<field name="concept" indexId="concept" multiplicity="true" label="Concept" >
363
							<xsl:attribute name="value">
364
								<xsl:value-of select='./@label'/>
365
							</xsl:attribute>
366
							<xsl:attribute name="value_original">
367
								<xsl:value-of select='./@id'/>
368
							</xsl:attribute>
369
						</field>
370
					</xsl:for-each>
371
				</field>
372
			</xsl:for-each>
373
		</field>
374
	</xsl:for-each>
375
</xsl:template>
376

    
377

    
378
<xsl:template match="extraInfo">
379
    <xsl:for-each select="./citations/citation">
380
        <field name="citation" multiplicity="true" indexId="" label="Citation">
381
            <field name="rawText" multiplicity="false" indexId="" label="Citation Text">
382
                <xsl:attribute name="value">
383
                    <xsl:value-of select="rawText"/>
384
                </xsl:attribute>
385
            </field>
386
            <xsl:for-each select="id">
387
            <field name="citationId" indexId="" multiplicity="true" label="Citation id details">
388
                <field name="id" multiplicity="false" indexId="" label="Citation id">
389
                    <xsl:attribute name="value">
390
                        <xsl:value-of select="@value"/>
391
                    </xsl:attribute>
392
                </field>
393
                <field name="type" multiplicity="false" indexId="" label="Citation id type">
394
                    <xsl:attribute name="value">
395
                        <xsl:value-of select="@type"/>
396
                    </xsl:attribute>
397
                </field>
398
                <field name="confidenceLevel" multiplicity="false" indexId="" label="Citation id confidence">
399
                    <xsl:attribute name="value">
400
                        <xsl:value-of select="@confidenceLevel"/>
401
                    </xsl:attribute>
402
                </field>
403
            </field>
404
            </xsl:for-each>
405
        </field>
406
    </xsl:for-each>
407
</xsl:template>
408

    
409
<xsl:template match="rel">
410
<!--PERSON-->
411
	<xsl:if test="./to/@type='person'">
412
		<field indexId = "objIdentifier"  multiplicity="true">
413
			<xsl:attribute name="name"><xsl:value-of select='./to/@class'/></xsl:attribute>
414
			<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
415
			<field name = "inferred" indexId="" multiplicity = "false" label="inferred">		
416
				<xsl:attribute name="value">
417
					<xsl:choose>
418
						<xsl:when test="@inferred !=''">
419
							<xsl:value-of select="@inferred"/>
420
						</xsl:when>
421
						<xsl:otherwise>
422
							<xsl:text>false</xsl:text>
423
						</xsl:otherwise>
424
					</xsl:choose>
425
				</xsl:attribute>
426
			</field>
427
			<field name = "trust" indexId="" multiplicity = "false" label="trust level">
428
				<xsl:attribute name="value">
429
					<xsl:choose>
430
						<xsl:when test="@trust !=''">
431
							<xsl:value-of select="@trust"/>
432
						</xsl:when>
433
						<xsl:otherwise>
434
							<xsl:text>NEUTRAL</xsl:text>
435
						</xsl:otherwise>
436
					</xsl:choose>
437
				</xsl:attribute>
438
			</field>
439
			<field name = "provenance" indexId="" multiplicity = "false" label="provenance">
440
				<xsl:attribute name="value">
441
				<xsl:choose>
442
						<xsl:when test="@provenanceaction !=''">
443
							<xsl:value-of select="@provenanceaction"/>
444
						</xsl:when>
445
						<xsl:otherwise>
446
							<xsl:text></xsl:text>
447
						</xsl:otherwise>
448
					</xsl:choose>
449
				</xsl:attribute>
450
			</field>
451
			<field name = "personId" indexId ="objIdentifier" multiplicity="false" label="Person id">		
452
				<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
453
			</field>
454
			<field name = "role" indexId ="" multiplicity="false" label="role">		
455
				<xsl:attribute name="value"><xsl:value-of select='./to/@class'/> </xsl:attribute>
456
			</field>
457
			<field name = "fullname" indexId ="personfullname" multiplicity="false" label="Person fullname">		
458
				<xsl:attribute name="value"><xsl:value-of select='./fullname'/> </xsl:attribute>
459
			</field>
460
			<field name = "ranking" indexId ="" multiplicity="false" label="ranking">		
461
				<xsl:attribute name="value"><xsl:value-of select='./ranking'/> </xsl:attribute>
462
			</field>
463
		</field>
464
	</xsl:if>	
465
<!--PROJECT-->
466
	<xsl:if test="./to/@type='project'">
467
		<field name="project" indexId = "objIdentifier" multiplicity="true">
468
			<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
469
			<field name = "inferred" indexId="" multiplicity = "false" label="inferred">		
470
				<xsl:attribute name="value">
471
					<xsl:choose>
472
						<xsl:when test="@inferred !=''">
473
							<xsl:value-of select="@inferred"/>
474
						</xsl:when>
475
						<xsl:otherwise>
476
							<xsl:text>false</xsl:text>
477
						</xsl:otherwise>
478
					</xsl:choose>
479
				</xsl:attribute>
480
			</field>
481
			<field name = "trust" indexId="" multiplicity = "false" label="trust level">
482
				<xsl:attribute name="value">
483
					<xsl:choose>
484
						<xsl:when test="@trust !=''">
485
							<xsl:value-of select="@trust"/>
486
						</xsl:when>
487
						<xsl:otherwise>
488
							<xsl:text>NEUTRAL</xsl:text>
489
						</xsl:otherwise>
490
					</xsl:choose>
491
				</xsl:attribute>
492
			</field>
493
			<field name = "provenance" indexId="" multiplicity = "false" label="provenance">
494
				<xsl:attribute name="value">
495
				<xsl:choose>
496
						<xsl:when test="@provenanceaction !=''">
497
							<xsl:value-of select="@provenanceaction"/>
498
						</xsl:when>
499
						<xsl:otherwise>
500
							<xsl:text></xsl:text>
501
						</xsl:otherwise>
502
					</xsl:choose>
503
				</xsl:attribute>
504
			</field>
505
			<field name = "projectId" indexId ="objIdentifier" multiplicity="false" label="Project id">		
506
				<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
507
			</field>
508
			<field name = "role" indexId ="" multiplicity="false" label="role">		
509
				<xsl:attribute name="value"><xsl:value-of select='./to/@class'/> </xsl:attribute>
510
			</field>
511
			<field name = "projectcode" indexId ="projectcode" multiplicity="false" label="Project(s)">		
512
				<xsl:attribute name="value"><xsl:value-of select='./code'/> </xsl:attribute>
513
			</field>	
514
			<field name = "projectacronym" indexId ="projectacronym" multiplicity="false" label="Project(s)">		
515
				<xsl:attribute name="value"><xsl:value-of select='./acronym'/> </xsl:attribute>
516
			</field>
517
			<field name = "projecttitle" indexId ="projecttitle" multiplicity="false" label="Project title">		
518
				<xsl:attribute name="value"><xsl:value-of select='./title'/> </xsl:attribute>
519
			</field>
520
			<field name = "projectcontracttypeid" indexId ="projectcontracttypeid" multiplicity="false" label="Project contract type id">		
521
				<xsl:attribute name="value"><xsl:value-of select='./contracttype/@classid'/> </xsl:attribute>
522
			</field>
523
			<field name = "projectcontracttypename" indexId ="projectcontracttypename" multiplicity="false" label="Project contract type name">		
524
				<xsl:attribute name="value"><xsl:value-of select='./contracttype/@classname'/> </xsl:attribute>
525
			</field>
526
			<field name = "funding" indexId = "" multiplicity = "false">
527
                <field name = "funder" indexId = "relfunder" multiplicity = "true">
528
                    <xsl:attribute name="value_original">
529
                        <xsl:value-of select="./funding/funder/@id"/>
530
                    </xsl:attribute>
531
                    <xsl:attribute name = "value">
532
                        <xsl:call-template name="getExtension">
533
                            <xsl:with-param name="filename" select="./funding/funder/@id"/>
534
                        </xsl:call-template>
535
                        <!--xsl:value-of select='./funding/funding_level_0'/-->
536
                    </xsl:attribute>
537
                </field>
538
                <field name = "fundershortname" indexId = "relfundershortname" multiplicity = "true">
539
                    <xsl:attribute name = "value">
540
                        <xsl:call-template name="getExtension">
541
                            <xsl:with-param name="filename" select="./funding/funder/@shortname"/>
542
                        </xsl:call-template>
543
                    </xsl:attribute>
544
                </field>
545
                <field name = "funding_level_0" indexId = "fundinglevel0_id" multiplicity = "false">
546
					<xsl:attribute name="value_original">
547
						<xsl:value-of select="./funding/funding_level_0"/>
548
					</xsl:attribute>					
549
					<xsl:attribute name = "value">
550
						<xsl:call-template name="getExtension">
551
							<xsl:with-param name="filename" select="./funding/funding_level_0"/>
552
						</xsl:call-template>			
553
						<!--xsl:value-of select='./funding/funding_level_0'/-->
554
					</xsl:attribute>
555
				</field>
556
				<field name = "funding_level_1" indexId = "fundinglevel1_id" multiplicity = "false">
557
                    <xsl:if test="not(starts-with(./funding/funding_level_1, 'ec__________::EC::FP7::'))">
558
                        <xsl:attribute name="value_original">
559
                            <xsl:value-of select="./funding/funding_level_1"/>
560
                        </xsl:attribute>
561
                        <xsl:attribute name = "value">
562
                            <xsl:call-template name="getExtension">
563
                                <xsl:with-param name="filename" select="./funding/funding_level_1"/>
564
                            </xsl:call-template>
565
                        </xsl:attribute>
566
                    </xsl:if>
567
                    <xsl:if test="starts-with(./funding/funding_level_1, 'ec__________::EC::FP7::')">
568
                        <xsl:attribute name="value">
569
                            <xsl:value-of select="./funding/funding_level_1"/>
570
                        </xsl:attribute>
571
                    </xsl:if>
572
					<!--<xsl:attribute name = "value">
573
						<xsl:call-template name="getExtension">
574
							<xsl:with-param name="filename" select="./funding/funding_level_1"/>
575
						</xsl:call-template>	
576
						&lt;!&ndash;xsl:value-of select='./funding/funding_level_1'/&ndash;&gt;
577
					</xsl:attribute>-->
578
				</field>
579
				<field name = "funding_level_2" indexId = "fundinglevel2_id" multiplicity = "false">
580
                    <xsl:if test="not(starts-with(./funding/funding_level_2, 'ec__________::EC::FP7::'))">
581
                        <xsl:attribute name="value_original">
582
                            <xsl:value-of select="./funding/funding_level_2"/>
583
                        </xsl:attribute>
584
                        <xsl:attribute name = "value">
585
                            <xsl:call-template name="getExtension">
586
                                <xsl:with-param name="filename" select="./funding/funding_level_2"/>
587
                            </xsl:call-template>
588
                        </xsl:attribute>
589
                    </xsl:if>
590
                    <xsl:if test="starts-with(./funding/funding_level_2, 'ec__________::EC::FP7::')">
591
                        <xsl:attribute name="value">
592
                            <xsl:value-of select="./funding/funding_level_2"/>
593
                        </xsl:attribute>
594
                    </xsl:if>
595
				<!-- <xsl:attribute name = "value">
596
						<xsl:call-template name="getExtension">
597
							<xsl:with-param name="filename" select="./funding/funding_level_2"/>
598
						</xsl:call-template>
599
					</xsl:attribute>
600
				-->
601
				</field>
602
			</field>
603
		</field>
604
	</xsl:if>
605
<!--RESULT-->
606
	<xsl:if test="./to/@type='result'">
607
		<field indexId = "objIdentifier"  multiplicity="true">
608
			<xsl:attribute name="name"><xsl:value-of select='./to/@class'/></xsl:attribute>
609
			<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
610
			<field name = "resultid" indexId ="objIdentifier" multiplicity="false" label="Result id">		
611
				<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
612
			</field>
613
			<field name = "title" indexId = "resulttitle" multiplicity = "false" label = "Title">
614
				<xsl:attribute name="value">
615
					<xsl:value-of select="./title"/>
616
				</xsl:attribute>
617
			</field>
618
			<field name = "dateofacceptance" indexId = "resultdateofacceptance" multiplicity = "false" label = "Date of acceptance">
619
				<xsl:attribute name="value">
620
					<xsl:value-of select="./dateofacceptance"/>
621
				</xsl:attribute>
622
			</field>
623
			<field name = "resulttypeid" indexId = "resulttypeid" multiplicity = "false" label = "type id">
624
				<xsl:attribute name="value">
625
					<xsl:value-of select="./resulttype/@classid"/>
626
				</xsl:attribute>
627
			</field>
628
			<field name = "resulttypename" indexId = "resulttypename" multiplicity = "false" label = "type name">
629
				<xsl:attribute name="value">
630
					<xsl:value-of select="./resulttype/@classname"/>
631
				</xsl:attribute>
632
			</field>
633
			<field name = "inferred" indexId="" multiplicity = "false" label="inferred">		
634
				<xsl:attribute name="value">
635
					<xsl:choose>
636
						<xsl:when test="@inferred !=''">
637
							<xsl:value-of select="@inferred"/>
638
						</xsl:when>
639
						<xsl:otherwise>
640
							<xsl:text>false</xsl:text>
641
						</xsl:otherwise>
642
					</xsl:choose>
643
				</xsl:attribute>
644
			</field>
645
			<field name = "trust" indexId="" multiplicity = "false" label="trust level">
646
				<xsl:attribute name="value">
647
					<xsl:choose>
648
						<xsl:when test="@trust !=''">
649
							<xsl:value-of select="@trust"/>
650
						</xsl:when>
651
						<xsl:otherwise>
652
							<xsl:text>NEUTRAL</xsl:text>
653
						</xsl:otherwise>
654
					</xsl:choose>
655
				</xsl:attribute>
656
			</field>
657
			<field name = "provenance" indexId="" multiplicity = "false" label="provenance">
658
				<xsl:attribute name="value">
659
				<xsl:choose>
660
						<xsl:when test="@provenanceaction !=''">
661
							<xsl:value-of select="@provenanceaction"/>
662
						</xsl:when>
663
						<xsl:otherwise>
664
							<xsl:text></xsl:text>
665
						</xsl:otherwise>
666
					</xsl:choose>
667
				</xsl:attribute>
668
			</field>
669
            <xsl:if test="./to/@class = 'hasAmongTopNSimilarDocuments'">
670
                <field name="similarity" label="similarity" multiplicity="false" indexId="">
671
                    <xsl:attribute name="value">
672
                        <xsl:value-of select="similarity"/>
673
                    </xsl:attribute>
674
                </field>
675
            </xsl:if>
676
		</field>
677
	</xsl:if>	
678
<!--ORGANIZATION-->
679
	<xsl:if test="./to/@type='organization'">
680
		<field name="organization" indexId = "objIdentifier"  multiplicity="true">
681
			<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
682
			<field name = "organizationid" indexId ="objIdentifier" multiplicity="false" label="Organization id">		
683
				<xsl:attribute name="value"><xsl:value-of select='./to'/> </xsl:attribute>
684
			</field>
685
			<field name = "role" indexId ="" multiplicity="false" label="role">		
686
				<xsl:attribute name="value"><xsl:value-of select='./to/@class'/> </xsl:attribute>
687
			</field>
688
			<field name = "legalshortname" indexId ="organizationlegalshortname" multiplicity="false" label="Organization short name">		
689
				<xsl:attribute name="value"><xsl:value-of select='./legalshortname'/> </xsl:attribute>
690
			</field>
691
			<field name = "websiteurl" indexId ="organizationwebsiteurl" multiplicity="false" label="Website">		
692
				<xsl:attribute name="value"><xsl:value-of select='./websiteurl'/> </xsl:attribute>
693
			</field>
694
			<field name = "countryid" indexId ="organizationcountryid" multiplicity="false" label="Country code">		
695
				<xsl:attribute name="value"><xsl:value-of select='./country/@classid'/> </xsl:attribute>
696
			</field>
697
			<field name = "countryname" indexId ="organizationcountryname" multiplicity="false" label="Country">		
698
				<xsl:attribute name="value"><xsl:value-of select='./country/@classname'/> </xsl:attribute>
699
			</field>
700
			<field name = "participantnumber" indexId ="" multiplicity="false" label="Participant Number">		
701
				<xsl:attribute name="value"><xsl:value-of select='./participantnumber'/> </xsl:attribute>
702
			</field>
703
			<field name = "contactperson" indexId ="" multiplicity="false" label="Contact Person">		
704
				<xsl:attribute name="value"><xsl:value-of select='./contactperson'/> </xsl:attribute>
705
			</field>
706
		</field>
707
	</xsl:if>
708

    
709
</xsl:template>
710
<!-- CHILDREN -->
711

    
712
    <xsl:template match="children/result">
713
        <field name="resultId" multiplicity="true" indexId="resultid" label="Result id">
714
            <xsl:attribute name="value">
715
                <xsl:value-of select='./@objidentifier'/>
716
            </xsl:attribute>
717
        </field>
718
    </xsl:template>
719

    
720
    <xsl:template match="children">
721

    
722
	<xsl:for-each select = "./instance">
723
		<field name = "datasource"  indexId = "resultcollectedfromdatasourceid" multiplicity="true">
724
			<xsl:attribute name = "value"> <xsl:value-of select="./@id"/> </xsl:attribute><!--??-->
725
			<field name = "instanceId" indexId = "objIdentifier" multiplicity = "false">
726
				<xsl:attribute name="value"><xsl:value-of select="./@id"/></xsl:attribute>
727
			</field>
728
			<field name = "hostedby" indexId = "resulthostingdatasourceid" multiplicity="false">
729
				<xsl:attribute name = "value"> <xsl:value-of select="./hostedby/@id"/> </xsl:attribute>
730
			</field> 
731
			<field name = "hostedbyname" indexId = "resulthostingdatasourcename" multiplicity="false">
732
				<xsl:attribute name = "value"> <xsl:value-of select="./hostedby/@name"/> </xsl:attribute>
733
			</field>
734
			<xsl:for-each select="./licence">
735
				<field name = "licenceid" indexId = "" multiplicity = "true">
736
					<xsl:attribute name = "value"> <xsl:value-of select="./@classid"/> </xsl:attribute>
737
				</field>
738
				<field name = "licencename" indexId = "resultrights" multiplicity = "true">
739
					<xsl:attribute name = "value"> <xsl:value-of select="./@classname"/> </xsl:attribute>
740
				</field>
741
			</xsl:for-each>
742
			<xsl:for-each select="./instancetype">			
743
				<field name = "typeid" indexId = "instancetypeid" multiplicity = "true">
744
					<xsl:attribute name = "value"> <xsl:value-of select="./@classid"/> </xsl:attribute>
745
				</field>
746
				<field name = "typename" indexId = "instancetypename" multiplicity = "true">
747
					<xsl:attribute name = "value"> <xsl:value-of select="./@classname"/> </xsl:attribute>
748
				</field>
749
			</xsl:for-each>
750

    
751
			<xsl:for-each select="./webresource">	
752
				<field name = "webresource" indexId = "" multiplicity="true">
753
					<xsl:attribute name = "value"> <xsl:value-of select="."/> </xsl:attribute>
754
				</field>
755
				<xsl:for-each select="./url">	
756
					<field name = "url" indexId = "" multiplicity="true">
757
						<xsl:attribute name = "value"> <xsl:value-of select="."/> </xsl:attribute>
758
					</field>
759
				</xsl:for-each>
760
			</xsl:for-each>
761
			<!--field name = "officialname" indexId = "" multiplicity="false">
762
				<xsl:attribute name = "value"> <xsl:value-of select="./datasource/officialname"/> </xsl:attribute>
763
			</field>
764
			<field name = "datasourcetypeid" indexId = "" multiplicity = "true">
765
				<xsl:attribute name = "value"> <xsl:value-of select="./datasource/datasourcetype/@classid"/> </xsl:attribute>
766
			</field>
767
			<field name = "datasourcetypename" indexId = "" multiplicity = "true">
768
				<xsl:attribute name = "value"> <xsl:value-of select="./datasource/datasourcetype/@classname"/> </xsl:attribute>
769
			</field-->
770
			
771
		</field>
772
	</xsl:for-each>
773

    
774
	<xsl:for-each select = "./externalreference">
775
		<field name="externalreference" multiplicity="true" indexId="">
776
			<field name="sitename" multiplicity="false" indexId="">
777
				<xsl:attribute name="value">
778
					<xsl:value-of select="./sitename"/>
779
				</xsl:attribute>
780
			</field>
781
			<field name="label" multiplicity="false" indexId="">
782
				<xsl:attribute name="value">
783
					<xsl:value-of select="./label"/>
784
				</xsl:attribute>
785
			</field>
786
			
787
			<field name="url" multiplicity="false" indexId="">
788
				<xsl:attribute name="value">
789
					<xsl:value-of select="./url"/>
790
				</xsl:attribute>
791
			</field>
792

    
793
			<field name="typeid" multiplicity="false" indexId="">
794
				<xsl:attribute name="value">
795
					<xsl:value-of select="./qualifier/@classid"/>
796
				</xsl:attribute>
797
			</field>
798
			<field name="refidentifier" multiplicity="false" indexId="">
799
				<xsl:attribute name="value">
800
					<xsl:value-of select="./refidentifier"/>
801
				</xsl:attribute>
802
			</field>
803
		</field>
804
	</xsl:for-each>
805
</xsl:template>
806

    
807
<xsl:template name="getExtension">
808
	<xsl:param name="filename"/>
809
	<xsl:choose>
810
		<xsl:when test="contains($filename, '::')">
811
			<xsl:call-template name="getExtension">
812
				<xsl:with-param name="filename" select="substring-after($filename, '::')"/>
813
			</xsl:call-template>
814
		</xsl:when>
815
		<xsl:otherwise>
816
			<xsl:value-of select="$filename"/>
817
		</xsl:otherwise>
818
	</xsl:choose>
819
</xsl:template>
820

    
821
</xsl:stylesheet>
822

    
823

    
(31-31/40)