1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
3
|
|
4
|
<!-- Turn off auto-insertion of <?xml> tag and set indenting on -->
|
5
|
<xsl:output method="text" encoding="utf-8" omit-xml-declaration="yes" media-type="text/csv" />
|
6
|
|
7
|
<!-- strip whitespace from whitespace-only nodes -->
|
8
|
<xsl:strip-space elements="*"/>
|
9
|
|
10
|
<xsl:template match = "/">
|
11
|
<!--
|
12
|
<xsl:text disable-output-escaping="yes">Title,Authors,Publication Year,DOI,Permanent identifier,Publication type,Journal,Funder,Project Name (GA Number),Access
</xsl:text>
|
13
|
-->
|
14
|
<xsl:apply-templates select="//result"/>
|
15
|
</xsl:template>
|
16
|
|
17
|
<!-- Title, Authors, Description, Year, DOI, Permanent identifier, Publication type, Journal, Project Name, GA number, Access -->
|
18
|
<xsl:template match="result">
|
19
|
<xsl:choose>
|
20
|
<xsl:when test="field[@name='project']">
|
21
|
<xsl:for-each select="field[@name='project']">
|
22
|
<!-- title -->
|
23
|
<xsl:text>"</xsl:text>
|
24
|
<xsl:value-of select="../field[@name='title']/@value"/>
|
25
|
<xsl:text>"</xsl:text>
|
26
|
<xsl:text>,</xsl:text>
|
27
|
|
28
|
<!-- authors -->
|
29
|
<xsl:text>"</xsl:text>
|
30
|
<xsl:for-each select="../field[@name='hasAuthor']">
|
31
|
<xsl:value-of select="field[@name='fullname']/@value"/>
|
32
|
<xsl:if test="not(position()=last())">
|
33
|
<xsl:text>;</xsl:text>
|
34
|
</xsl:if>
|
35
|
</xsl:for-each>
|
36
|
<xsl:text>"</xsl:text>
|
37
|
<xsl:text>,</xsl:text>
|
38
|
|
39
|
<!-- description
|
40
|
<xsl:text>"</xsl:text>
|
41
|
<xsl:value-of select="field[@name='description']/@value"/>
|
42
|
<xsl:if test="position() != last()"><xsl:text> </xsl:text></xsl:if>
|
43
|
<xsl:text>"</xsl:text>
|
44
|
<xsl:text>,</xsl:text>
|
45
|
-->
|
46
|
<!-- year -->
|
47
|
<xsl:text>"</xsl:text>
|
48
|
<xsl:value-of select="../field[@name='dateofacceptance']/@value"/>
|
49
|
<xsl:text>"</xsl:text>
|
50
|
<xsl:text>,</xsl:text>
|
51
|
|
52
|
<!-- DOI -->
|
53
|
<xsl:for-each select="../field[@name='pid']">
|
54
|
<xsl:if test="field[@name='classid' and @value='doi']/@value = 'doi'">
|
55
|
<xsl:text>"</xsl:text>
|
56
|
<xsl:value-of select="field[@name='value']/@value"/>
|
57
|
<xsl:text>"</xsl:text>
|
58
|
</xsl:if>
|
59
|
</xsl:for-each>
|
60
|
<xsl:text>,</xsl:text>
|
61
|
|
62
|
<!-- Permanent Identifier -->
|
63
|
<xsl:text>"</xsl:text>
|
64
|
<xsl:value-of select="../field[@name='datasource'][1]/field[@name='url']/@value"/>
|
65
|
<xsl:text>"</xsl:text>
|
66
|
<xsl:text>,</xsl:text>
|
67
|
|
68
|
<!-- Publication type -->
|
69
|
<xsl:text>"</xsl:text>
|
70
|
<xsl:value-of select="../field[@name='datasource'][1]/field[@name='typename']/@value"/>
|
71
|
<xsl:text>"</xsl:text>
|
72
|
<xsl:text>,</xsl:text>
|
73
|
|
74
|
<!-- journal -->
|
75
|
<xsl:text>"</xsl:text>
|
76
|
<xsl:for-each select="../field[@name='source']">
|
77
|
<xsl:value-of select="@value"/>
|
78
|
</xsl:for-each>
|
79
|
<xsl:text>"</xsl:text>
|
80
|
<xsl:text>,</xsl:text>
|
81
|
|
82
|
<!-- Funder -->
|
83
|
<xsl:text>"</xsl:text>
|
84
|
<xsl:for-each select="field[@name='funding']/field[@name='funder']">
|
85
|
<xsl:value-of select="@value"/>
|
86
|
</xsl:for-each>
|
87
|
<xsl:text>"</xsl:text>
|
88
|
<xsl:text>,</xsl:text>
|
89
|
|
90
|
<!-- project name -->
|
91
|
<xsl:text>"</xsl:text>
|
92
|
<!-- project name -->
|
93
|
<xsl:choose>
|
94
|
<xsl:when test="field[@name='projectacronym']/@value != ''" >
|
95
|
<xsl:value-of select="field[@name='projectacronym']/@value"/>
|
96
|
</xsl:when>
|
97
|
<xsl:otherwise>
|
98
|
<xsl:value-of select="field[@name='projecttitle']/@value"/>
|
99
|
</xsl:otherwise>
|
100
|
</xsl:choose>
|
101
|
<xsl:if test="field[@name='projectcode']/@value!= ''">
|
102
|
<xsl:value-of select="concat('(',field[@name='projectcode']/@value,')')"/>
|
103
|
</xsl:if>
|
104
|
|
105
|
<xsl:text>"</xsl:text>
|
106
|
<xsl:text>,</xsl:text>
|
107
|
|
108
|
<!--access -->
|
109
|
<xsl:text>"</xsl:text>
|
110
|
<xsl:value-of select="../field[@name='bestlicense']/@value"/>
|
111
|
<xsl:text>"</xsl:text>
|
112
|
<xsl:text>
</xsl:text>
|
113
|
|
114
|
</xsl:for-each>
|
115
|
</xsl:when>
|
116
|
<xsl:otherwise>
|
117
|
<!-- title -->
|
118
|
<xsl:text>"</xsl:text>
|
119
|
<xsl:value-of select="field[@name='title']/@value"/>
|
120
|
<xsl:text>"</xsl:text>
|
121
|
<xsl:text>,</xsl:text>
|
122
|
|
123
|
<!-- authors -->
|
124
|
<xsl:text>"</xsl:text>
|
125
|
<xsl:for-each select="field[@name='hasAuthor']">
|
126
|
<xsl:value-of select="field[@name='fullname']/@value"/>
|
127
|
<xsl:if test="not(position()=last())">
|
128
|
<xsl:text>;</xsl:text>
|
129
|
</xsl:if>
|
130
|
</xsl:for-each>
|
131
|
<xsl:text>"</xsl:text>
|
132
|
<xsl:text>,</xsl:text>
|
133
|
|
134
|
<!-- year -->
|
135
|
<xsl:text>"</xsl:text>
|
136
|
<xsl:value-of select="field[@name='dateofacceptance']/@value"/>
|
137
|
<xsl:text>"</xsl:text>
|
138
|
<xsl:text>,</xsl:text>
|
139
|
|
140
|
<!-- DOI -->
|
141
|
<xsl:for-each select="field[@name='pid']">
|
142
|
<xsl:if test="field[@name='classid' and @value='doi']/@value = 'doi'">
|
143
|
<xsl:text>"</xsl:text>
|
144
|
<xsl:value-of select="field[@name='value']/@value"/>
|
145
|
<xsl:text>"</xsl:text>
|
146
|
</xsl:if>
|
147
|
</xsl:for-each>
|
148
|
<xsl:text>,</xsl:text>
|
149
|
|
150
|
<!-- Permanent Identifier -->
|
151
|
<xsl:text>"</xsl:text>
|
152
|
<xsl:value-of select="field[@name='datasource'][1]/field[@name='url']/@value"/>
|
153
|
<xsl:text>"</xsl:text>
|
154
|
<xsl:text>,</xsl:text>
|
155
|
|
156
|
<!-- Publication type -->
|
157
|
<xsl:text>"</xsl:text>
|
158
|
<xsl:value-of select="field[@name='datasource'][1]/field[@name='typename']/@value"/>
|
159
|
<xsl:text>"</xsl:text>
|
160
|
<xsl:text>,</xsl:text>
|
161
|
|
162
|
<!-- journal -->
|
163
|
<xsl:text>"</xsl:text>
|
164
|
<xsl:for-each select="field[@name='source']">
|
165
|
<xsl:value-of select="@value"/>
|
166
|
</xsl:for-each>
|
167
|
<xsl:text>"</xsl:text>
|
168
|
<xsl:text>,</xsl:text>
|
169
|
|
170
|
<!-- Funder -->
|
171
|
<xsl:text>"</xsl:text>
|
172
|
<xsl:text>"</xsl:text>
|
173
|
<xsl:text>,</xsl:text>
|
174
|
|
175
|
<!-- project name -->
|
176
|
<xsl:text>"</xsl:text>
|
177
|
<!-- project name -->
|
178
|
<xsl:text>"</xsl:text>
|
179
|
<xsl:text>,</xsl:text>
|
180
|
|
181
|
<!--access -->
|
182
|
<xsl:text>"</xsl:text>
|
183
|
<xsl:value-of select="../field[@name='bestlicense']/@value"/>
|
184
|
<xsl:text>"</xsl:text>
|
185
|
<xsl:text>
</xsl:text>
|
186
|
</xsl:otherwise>
|
187
|
</xsl:choose>
|
188
|
|
189
|
</xsl:template>
|
190
|
|
191
|
</xsl:stylesheet>
|