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
		<response>
10
			<xsl:apply-templates select="response/header"/>
11
			<publications>
12
				<xsl:apply-templates select="/result"/>
13
			</publications>
14
		</response>
15
	</xsl:template>
16

    
17
	<xsl:template match="response/header">
18
		<header>
19
			<size><xsl:value-of select="size"/></size>
20
			<page><xsl:value-of select="page"/></page>
21
			<total><xsl:value-of select="total"/></total>
22
		</header>
23
	</xsl:template>
24

    
25
	<xsl:template match="result">
26
		<publication>
27
			<xsl:apply-templates select="//header"/>
28
			<xsl:apply-templates select="//oaf:result"/>
29
		</publication>
30
	</xsl:template>
31

    
32
	<!-- HEADER
33
    fields in header:
34
    1. dri:objIdentifier 		[objIdentifier]
35
    2. dri:repositoryId			X
36
    3. dri:dateOfCollection		X
37
    -->
38

    
39
	<xsl:template match="text()">
40
		<xsl:value-of select="replace(., '[&#x007F;-&#x009F;]', ' ')"/>
41
	</xsl:template>
42

    
43
	<xsl:template match = "header">
44
		<openaireid>
45
			<xsl:value-of select='./dri:objIdentifier'/>
46
		</openaireid>
47
	</xsl:template>
48

    
49
	<xsl:template name="refereed" match="//instance/refereed[@classid='0001'][1]">
50
		<peerReviewed>true</peerReviewed>
51
		<publicationtype><xsl:value-of select="../instancetype/@classname"/></publicationtype>
52
		<pid_published>
53
			<xsl:attribute name="type">
54
				<xsl:value-of select="../pid/@classid"/>
55
			</xsl:attribute>
56
			<xsl:value-of select="../pid"/>
57
		</pid_published>
58
		<license><xsl:value-of select="../license"/></license>
59
	</xsl:template>
60

    
61
	<xsl:template name="instance" match="//instance[1]">
62
		<xsl:if test="./refereed[@classid='0000']">
63
			<peerReviewed/>
64
		</xsl:if>
65
		<xsl:if test="./refereed[@classid='0002']">
66
			<peerReviewed>false</peerReviewed>
67
		</xsl:if>
68
		<xsl:if test="not(./refereed)">
69
			<peerReviewed/>
70
		</xsl:if>
71
		<publicationtype><xsl:value-of select="./instancetype/@classname"/></publicationtype>
72
		<license><xsl:value-of select="./license"/></license>
73
	</xsl:template>
74

    
75

    
76
	<xsl:template match = "oaf:result">
77

    
78
		<pids>
79
			<xsl:for-each select = "./pid">
80
				<xsl:choose>
81
					<xsl:when test="./@classid='doi'">
82
						<doi>
83
							<xsl:value-of select='.'/>
84
						</doi>
85
					</xsl:when>
86
					<xsl:when test="./@classid='handle'">
87
						<handle>
88
							<xsl:value-of select='.'/>
89
						</handle>
90
					</xsl:when>
91
					<xsl:when test="./@classidtest!= ''">
92
						<other>
93
							<xsl:attribute name="type">
94
								<xsl:value-of select="./@classid"/>
95
							</xsl:attribute>
96
							<xsl:value-of select='.'/>
97
						</other>
98
					</xsl:when>
99
				</xsl:choose>
100
			</xsl:for-each>
101
		</pids>
102

    
103
		<xsl:choose>
104
			<xsl:when test="count(//instance/refereed[@classid='0001']) > 0">
105
				<xsl:for-each select="(//instance/refereed[@classid='0001'])[1]">
106
					<peerReviewed>true</peerReviewed>
107
					<publicationtype><xsl:value-of select="../instancetype/@classname"/></publicationtype>
108
					<pid_published>
109
						<xsl:attribute name="type">
110
							<xsl:value-of select="../pid/@classid"/>
111
						</xsl:attribute>
112
						<xsl:value-of select="../pid"/>
113
					</pid_published>
114
					<license><xsl:value-of select="../license"/></license>
115
				</xsl:for-each>
116
			</xsl:when>
117
			<xsl:otherwise>
118
				<xsl:apply-templates select="//instance[1]"/>
119
			</xsl:otherwise>
120
		</xsl:choose>
121

    
122
		<xsl:for-each select = "./title">
123
			<title><xsl:value-of select='.'/></title>
124
		</xsl:for-each>
125

    
126
		<authors>
127
			<?xml-multiple?>
128
			<xsl:for-each select="./creator">
129
				<xsl:sort select="./@rank"/>
130
				<author>
131
					<xsl:if test="./@orcid">
132
						<xsl:attribute name="orcid">
133
							<xsl:value-of select='./@orcid'/>
134
						</xsl:attribute>
135
					</xsl:if>
136
					<xsl:value-of select='.'/>
137
				</author>
138
			</xsl:for-each>
139
		</authors>
140

    
141
		<xsl:for-each select = "./description">
142
			<description>
143
				<xsl:value-of select='.'/>
144
			</description>
145
		</xsl:for-each>
146

    
147
		<xsl:for-each select = "./journal">
148
			<journal>
149
				<name><xsl:value-of select="."/></name>
150
				<issn><xsl:value-of select="./@issn"/></issn>
151
				<eissn><xsl:value-of select="./@eissn"/></eissn>
152
				<lissn><xsl:value-of select="./@lissn"/></lissn>
153
				<issue><xsl:value-of select="./@iss"/></issue>
154
				<volume><xsl:value-of select="./@vol"/></volume>
155
			</journal>
156
		</xsl:for-each>
157

    
158
		<publisher>
159
			<xsl:value-of select = "./publisher"/>
160
		</publisher>
161

    
162
		<dateofacceptance>
163
			<xsl:value-of select = "./dateofacceptance"/>
164
		</dateofacceptance>
165

    
166
		<xsl:for-each select="./children/instance/webresource">
167
			<webresource><xsl:value-of select="url"/></webresource>
168
		</xsl:for-each>
169

    
170
		<bestaccessright>
171
			<xsl:value-of select="./bestaccessright/@classid"/>
172
		</bestaccessright>
173

    
174
		<embargoenddate>
175
			<xsl:value-of select="./embargoenddate"/>
176
		</embargoenddate>
177

    
178
		<processingchargeamount>
179
			<xsl:value-of select="./processingchargeamount"/>
180
		</processingchargeamount>
181

    
182
		<processingchargecurrency>
183
			<xsl:value-of select="./processingchargecurrency"/>
184
		</processingchargecurrency>
185

    
186
	</xsl:template>
187

    
188
</xsl:stylesheet>
189

    
190

    
(50-50/58)