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
|
<record type="person">
|
9
|
<xsl:apply-templates select="/record/result/header"/>
|
10
|
<xsl:apply-templates select="/record/result/metadata/oaf:entity/oaf:person"/>
|
11
|
<xsl:apply-templates select="/record/result/metadata/oaf:entity/oaf:person/rels/rel"/>
|
12
|
</record>
|
13
|
</xsl:template>
|
14
|
|
15
|
<xsl:template match="header">
|
16
|
<field name="personId" multiplicity="false">
|
17
|
<xsl:attribute name="value">
|
18
|
<xsl:value-of select='./dri:objIdentifier'/>
|
19
|
</xsl:attribute>
|
20
|
<xsl:attribute name="label">
|
21
|
<xsl:text>personId</xsl:text>
|
22
|
</xsl:attribute>
|
23
|
<xsl:attribute name="indexId">
|
24
|
<xsl:text>dri:objIdentifier</xsl:text>
|
25
|
</xsl:attribute>
|
26
|
</field>
|
27
|
</xsl:template>
|
28
|
|
29
|
<xsl:template match="oaf:person">
|
30
|
<field name="fullname" multiplicity="false">
|
31
|
<xsl:attribute name="value">
|
32
|
<xsl:value-of select='./oaf:fullname'/>
|
33
|
</xsl:attribute>
|
34
|
<xsl:attribute name="label">
|
35
|
<xsl:text>Fullname</xsl:text>
|
36
|
</xsl:attribute>
|
37
|
<xsl:attribute name="indexId">
|
38
|
</xsl:attribute>
|
39
|
</field>
|
40
|
</xsl:template>
|
41
|
|
42
|
<xsl:template match="rel">
|
43
|
<field multiplicity="true">
|
44
|
<xsl:attribute name="name">
|
45
|
<xsl:value-of select='./to/@class'/>
|
46
|
</xsl:attribute>
|
47
|
<xsl:if test="./to/@type ='person'">
|
48
|
<field name="personId" multiplicity="false">
|
49
|
<xsl:attribute name="value">
|
50
|
<xsl:value-of select='./to'/>
|
51
|
</xsl:attribute>
|
52
|
<xsl:attribute name="label">
|
53
|
<xsl:text>personId</xsl:text>
|
54
|
</xsl:attribute>
|
55
|
<xsl:attribute name="indexId">
|
56
|
</xsl:attribute>
|
57
|
</field>
|
58
|
<field name="fullname" multiplicity="false">
|
59
|
<xsl:attribute name="value">
|
60
|
<xsl:value-of select='./oaf:fullname'/>
|
61
|
</xsl:attribute>
|
62
|
<xsl:attribute name="label">
|
63
|
<xsl:text>Fullname</xsl:text>
|
64
|
</xsl:attribute>
|
65
|
<xsl:attribute name="indexId">
|
66
|
</xsl:attribute>
|
67
|
</field>
|
68
|
</xsl:if>
|
69
|
|
70
|
<xsl:if test="./to/@type ='result'">
|
71
|
<field name="resultId" multiplicity="false">
|
72
|
<xsl:attribute name="value">
|
73
|
<xsl:value-of select='./to'/>
|
74
|
</xsl:attribute>
|
75
|
<xsl:attribute name="label">
|
76
|
<xsl:text>resultId</xsl:text>
|
77
|
</xsl:attribute>
|
78
|
<xsl:attribute name="indexId">
|
79
|
</xsl:attribute>
|
80
|
</field>
|
81
|
<field name="title" multiplicity="true">
|
82
|
<xsl:attribute name="value">
|
83
|
<xsl:value-of select='./dc:title'/>
|
84
|
</xsl:attribute>
|
85
|
<xsl:attribute name="label">
|
86
|
<xsl:text>Title</xsl:text>
|
87
|
</xsl:attribute>
|
88
|
<xsl:attribute name="indexId">
|
89
|
</xsl:attribute>
|
90
|
</field>
|
91
|
<field name="publicationYear" multiplicity="false">
|
92
|
<xsl:attribute name="value">
|
93
|
<xsl:value-of select='./oaf:publicationyear'/>
|
94
|
</xsl:attribute>
|
95
|
<xsl:attribute name="label">
|
96
|
<xsl:text>Publication Year</xsl:text>
|
97
|
</xsl:attribute>
|
98
|
<xsl:attribute name="indexId">
|
99
|
</xsl:attribute>
|
100
|
</field>
|
101
|
</xsl:if>
|
102
|
|
103
|
</field>
|
104
|
</xsl:template>
|
105
|
</xsl:stylesheet>
|