Project

General

Profile

« Previous | Next » 

Revision 55110

Adding elixir-gr concepts only if the author belongs to the given list that I cannot commit

View differences:

modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/xslt_cleaning_ORP-biotools.xml
11 11
			<IMPORTED/>
12 12
			<SCRIPT>
13 13
				<TITLE>xslt_cleaning_ORP-biotools</TITLE>
14
				<CODE>
15
					<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1"
16
					                xmlns:oaf="http://namespace.openaire.eu/oaf"
17
					                xmlns:dr="http://www.driver-repository.eu/namespace/dr"
18
					                xmlns:datacite="http://datacite.org/schema/kernel-4"
19
					                xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy"
20
					                extension-element-prefixes="TransformationFunction"
21
					                exclude-result-prefixes="TransformationFunction">
14
				<CODE><![CDATA[
15
				<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
16
    xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:xs="http://www.w3.org/2001/XMLSchema"
17
    xmlns:dr="http://www.driver-repository.eu/namespace/dr"
18
    xmlns:datacite="http://datacite.org/schema/kernel-4" xmlns:functx="http://www.functx.com"
19
    xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy"
20
    extension-element-prefixes="TransformationFunction"
21
    exclude-result-prefixes="TransformationFunction">
22 22

  
23
						<xsl:param name="varOfficialName"/>
24
						<xsl:param name="varDsType"/>
25
						<xsl:param name="varDataSourceId"/>
26
						<xsl:param name="index" select="0"/>
27
						<xsl:param name="transDate" select="current-dateTime()"/>
28
						<xsl:variable name="tf" select="TransformationFunction:getInstance()"/>
23
    <xsl:function xmlns:functx="http://www.functx.com" name="functx:value-intersect" as="xs:anyAtomicType*">
24
        <xsl:param name="arg1" as="xs:anyAtomicType*"/>
25
        <xsl:param name="arg2" as="xs:anyAtomicType*"/>
26
        <xsl:sequence select=" distinct-values($arg1[.=$arg2]) "/>
27
    </xsl:function>
29 28

  
30
						<xsl:template match="/">
31
							<xsl:variable name="datasourcePrefix"
32
							              select="normalize-space(//oaf:datasourceprefix)"/>
33
							<xsl:call-template name="validRecord"/>
34
						</xsl:template>
29
    <xsl:param name="varOfficialName"/>
30
    <xsl:param name="varDsType"/>
31
    <xsl:param name="varDataSourceId"/>
32
    <xsl:param name="index" select="0"/>
33
    <xsl:param name="transDate" select="current-dateTime()"/>
34
    <xsl:variable name="tf" select="TransformationFunction:getInstance()"/>
35 35

  
36
						<xsl:template name="terminate">
37
							<xsl:message terminate="yes">
38
								record is not compliant, transformation is interrupted.
39
							</xsl:message>
40
						</xsl:template>
36
	<!-- TODO: ADD HERE THE LIST OF AUTHORS' EMAILS-->
37
    <xsl:variable name="elixirGRAuthorMails"
38
        select="()"/>
39
    <xsl:template match="/">
40
        <xsl:variable name="datasourcePrefix" select="normalize-space(//oaf:datasourceprefix)"/>
41
        <xsl:call-template name="validRecord"/>
42
    </xsl:template>
41 43

  
42
						<xsl:template name="validRecord">
43
							<record>
44
								<xsl:apply-templates select="//*[local-name() = 'header']"/>
44
    <xsl:template name="terminate">
45
        <xsl:message terminate="yes"> record is not compliant, transformation is interrupted.
46
        </xsl:message>
47
    </xsl:template>
45 48

  
46
								<metadata>
49
    <xsl:template name="validRecord">
50
        <record>
51
            <xsl:apply-templates select="//*[local-name() = 'header']"/>
47 52

  
48
									<!--
53
            <metadata>
54

  
55
                <!--
49 56
									<xsl:apply-templates select="//*[local-name() = 'metadata']//*[local-name() = 'list']"/>
50 57
									-->
51 58

  
52
									<datacite:resource>
59
                <datacite:resource>
53 60

  
54 61

  
55
										<datacite:resourceType>
56
											<xsl:attribute name="resourceTypeGeneral" select="'Software'"/>
57
											<xsl:value-of select="//*[local-name() = 'toolType']"/>
58
										</datacite:resourceType>
62
                    <datacite:resourceType>
63
                        <xsl:attribute name="resourceTypeGeneral" select="'Software'"/>
64
                        <xsl:value-of select="//*[local-name() = 'toolType']"/>
65
                    </datacite:resourceType>
59 66

  
60
										<xsl:for-each select="//*[local-name() = 'language']">
61
											<datacite:format>
62
												<xsl:value-of select="."/>
63
											</datacite:format>
64
										</xsl:for-each>
67
                    <xsl:for-each select="//*[local-name() = 'language']">
68
                        <datacite:format>
69
                            <xsl:value-of select="."/>
70
                        </datacite:format>
71
                    </xsl:for-each>
65 72

  
66
										<!-- DOE CODE does not state languages; projects/funding: funders not known to OpenAIRE
73
                    <!-- DOE CODE does not state languages; projects/funding: funders not known to OpenAIRE
67 74
										-->
68 75

  
69
										<datacite:publisher>
70
											<xsl:value-of select="$varOfficialName"/>
71
										</datacite:publisher>
76
                    <datacite:publisher>
77
                        <xsl:value-of select="$varOfficialName"/>
78
                    </datacite:publisher>
72 79

  
73
										<datacite:relatedIdentifiers>
74
											<xsl:for-each select="//*[local-name() = 'documentation'][not(./*[local-name() = 'type'] = ('Terms of use', 'Citation instructions', 'Contributions policy', 'Governance'))]">
75
												<datacite:relatedIdentifier>
76
													<xsl:attribute name="relatedIdentifierType" select="'URL'"/>
77
													<xsl:attribute name="relationType" select="'IsDocumentedBy'"/>
78
													<xsl:value-of select="./*[local-name() = 'url']"/>
79
												</datacite:relatedIdentifier>
80
											</xsl:for-each>
81
											<!-- paper references -->
82
											<xsl:call-template name="relatedPaper"/>
83
										</datacite:relatedIdentifiers>
80
                    <datacite:relatedIdentifiers>
81
                        <xsl:for-each
82
                            select="//*[local-name() = 'documentation'][not(./*[local-name() = 'type'] = ('Terms of use', 'Citation instructions', 'Contributions policy', 'Governance'))]">
83
                            <datacite:relatedIdentifier>
84
                                <xsl:attribute name="relatedIdentifierType" select="'URL'"/>
85
                                <xsl:attribute name="relationType" select="'IsDocumentedBy'"/>
86
                                <xsl:value-of select="./*[local-name() = 'url']"/>
87
                            </datacite:relatedIdentifier>
88
                        </xsl:for-each>
89
                        <!-- paper references -->
90
                        <xsl:call-template name="relatedPaper"/>
91
                    </datacite:relatedIdentifiers>
84 92

  
85
										<datacite:alternateIdentifiers>
86
											<!-- landing page, documentation, distribution -->
87
											<datacite:alternateIdentifier>
88
												<xsl:attribute name="alternateIdentifierType" select="'LandingPage'"/>
89
												<xsl:value-of select="concat('https://bio.tools/', //*[local-name() = 'id'])"/>
90
											</datacite:alternateIdentifier>
93
                    <datacite:alternateIdentifiers>
94
                        <!-- landing page, documentation, distribution -->
95
                        <datacite:alternateIdentifier>
96
                            <xsl:attribute name="alternateIdentifierType" select="'LandingPage'"/>
97
                            <xsl:value-of
98
                                select="concat('https://bio.tools/', //*[local-name() = 'id'])"/>
99
                        </datacite:alternateIdentifier>
91 100

  
92
											<!--
101
                        <!--
93 102
											<xsl:for-each select="distinct-values((//*[local-name() = 'link'][./*[local-name() = 'type' and . = 'Repository']]/*[local-name() = 'url'], //*[local-name() = 'link'][./*[local-name() = 'url' and starts-with(., 'https://github.com/')]]/*[local-name() = 'url']/replace(., '(https://github.com/[^/]*/[^/]*)(/.*)?', '$1')))">
94 103
											-->
95
											<xsl:for-each select="distinct-values((//*[local-name() = 'link'][./*[local-name() = 'type' and . = 'Repository']]/*[local-name() = 'url'], //*[starts-with(., 'https://github.com/') and contains(., concat('/', //*[local-name() = 'id']))]/replace(., '(https://github.com/[^/]*/[^/]*)(/.*)?', '$1')))">
96
												<datacite:alternateIdentifier>
97
													<xsl:attribute name="alternateIdentifierType" select="'DistributionLocation'"/>
98
													<xsl:value-of select="."/>
99
												</datacite:alternateIdentifier>
100
											</xsl:for-each>
104
                        <xsl:for-each
105
                            select="distinct-values((//*[local-name() = 'link'][./*[local-name() = 'type' and . = 'Repository']]/*[local-name() = 'url'], //*[starts-with(., 'https://github.com/') and contains(., concat('/', //*[local-name() = 'id']))]/replace(., '(https://github.com/[^/]*/[^/]*)(/.*)?', '$1')))">
106
                            <datacite:alternateIdentifier>
107
                                <xsl:attribute name="alternateIdentifierType"
108
                                    select="'DistributionLocation'"/>
109
                                <xsl:value-of select="."/>
110
                            </datacite:alternateIdentifier>
111
                        </xsl:for-each>
101 112

  
102
											<!-- identifier -->
103
											<datacite:alternateIdentifier>
104
												<xsl:attribute name="alternateIdentifierType" select="'local accession id'"/>
105
												<xsl:value-of select="//*[local-name() = 'id']"/>
106
											</datacite:alternateIdentifier>
107
										</datacite:alternateIdentifiers>
113
                        <!-- identifier -->
114
                        <datacite:alternateIdentifier>
115
                            <xsl:attribute name="alternateIdentifierType"
116
                                select="'local accession id'"/>
117
                            <xsl:value-of select="//*[local-name() = 'id']"/>
118
                        </datacite:alternateIdentifier>
119
                    </datacite:alternateIdentifiers>
108 120

  
109
										<datacite:identifier>
110
											<xsl:attribute name="identifierType" select="'URL'"/>
111
											<xsl:value-of select="concat('https://bio.tools/', //*[local-name() = 'id'])"/>
112
										</datacite:identifier>
121
                    <datacite:identifier>
122
                        <xsl:attribute name="identifierType" select="'URL'"/>
123
                        <xsl:value-of
124
                            select="concat('https://bio.tools/', //*[local-name() = 'id'])"/>
125
                    </datacite:identifier>
113 126

  
114
										<!-- title -->
115
										<datacite:titles>
116
											<datacite:title>
117
												<xsl:value-of select="//*[local-name() = 'list']/*[local-name() = 'name']"/>
118
											</datacite:title>
119
										</datacite:titles>
127
                    <!-- title -->
128
                    <datacite:titles>
129
                        <datacite:title>
130
                            <xsl:value-of
131
                                select="//*[local-name() = 'list']/*[local-name() = 'name']"/>
132
                        </datacite:title>
133
                    </datacite:titles>
120 134

  
121
										<!-- version -->
122
										<xsl:if test="//*[local-name() = 'list']/*[local-name() = 'version'][not(. = 'null')]">
123
											<datacite:version>
124
												<xsl:value-of select="//*[local-name() = 'list']/*[local-name() = 'version'][not(. = 'null')]"/>
125
											</datacite:version>
126
										</xsl:if>
135
                    <!-- version -->
136
                    <xsl:if
137
                        test="//*[local-name() = 'list']/*[local-name() = 'version'][not(. = 'null')]">
138
                        <datacite:version>
139
                            <xsl:value-of
140
                                select="//*[local-name() = 'list']/*[local-name() = 'version'][not(. = 'null')]"
141
                            />
142
                        </datacite:version>
143
                    </xsl:if>
127 144

  
128
										<!-- bio.tools' credit/typeRole Developer/... is not identical with statements on GitHub ??? (Scoary) -->
129
										<xsl:call-template name="authors"/>
145
                    <!-- bio.tools' credit/typeRole Developer/... is not identical with statements on GitHub ??? (Scoary) -->
146
                    <xsl:call-template name="authors"/>
130 147

  
131
										<datacite:contributors>
132
											<xsl:for-each select="//*[local-name() = 'contact']/*[local-name() = 'name' and not(. = 'null')]">
133
												<xsl:variable name="varContributorName" select="TransformationFunction:convertString($tf, ., 'Person')"/>
134
												<datacite:contributor>
135
													<xsl:attribute name="contributorType" select="'ContactPerson'"/>
136
													<datacite:contributorName>
137
														<xsl:value-of select="$varContributorName"/>
138
													</datacite:contributorName>
139
													<datacite:givenName>
140
														<xsl:value-of select="substring-after($varContributorName, ', ')"/>
141
													</datacite:givenName>
142
													<datacite:familyName>
143
														<xsl:value-of select="substring-before($varContributorName, ', ')"/>
144
													</datacite:familyName>
145
												</datacite:contributor>
146
											</xsl:for-each>
147
										</datacite:contributors>
148
                    <datacite:contributors>
149
                        <xsl:for-each
150
                            select="//*[local-name() = 'contact']/*[local-name() = 'name' and not(. = 'null')]">
151
                            <xsl:variable name="varContributorName"
152
                                select="TransformationFunction:convertString($tf, ., 'Person')"/>
153
                            <datacite:contributor>
154
                                <xsl:attribute name="contributorType" select="'ContactPerson'"/>
155
                                <datacite:contributorName>
156
                                    <xsl:value-of select="$varContributorName"/>
157
                                </datacite:contributorName>
158
                                <datacite:givenName>
159
                                    <xsl:value-of
160
                                        select="substring-after($varContributorName, ', ')"/>
161
                                </datacite:givenName>
162
                                <datacite:familyName>
163
                                    <xsl:value-of
164
                                        select="substring-before($varContributorName, ', ')"/>
165
                                </datacite:familyName>
166
                            </datacite:contributor>
167
                        </xsl:for-each>
168
                    </datacite:contributors>
148 169

  
149
										<datacite:descriptions>
150
											<datacite:description>
151
												<xsl:attribute name="descriptionType">
152
													<xsl:value-of select="'Abstract'"/>
153
												</xsl:attribute>
154
												<xsl:value-of select="//*[local-name() = 'description']"/>
155
											</datacite:description>
170
                    <datacite:descriptions>
171
                        <datacite:description>
172
                            <xsl:attribute name="descriptionType">
173
                                <xsl:value-of select="'Abstract'"/>
174
                            </xsl:attribute>
175
                            <xsl:value-of select="//*[local-name() = 'description']"/>
176
                        </datacite:description>
156 177

  
157
											<!--
178
                        <!--
158 179
											<xsl:for-each select="//*[local-name() = 'operatingSystem'], //*[local-name() = 'function']/*[local-name() = 'comment' and not(. = 'null')]">
159 180
											-->
160 181

  
161
											<xsl:for-each select="//*[local-name() = 'function']/*[local-name() = 'comment' and not(. = 'null')]">
162
												<datacite:description>
163
													<xsl:attribute name="descriptionType" select="'Abstract'"/>
164
													<xsl:value-of select="."/>
165
												</datacite:description>
166
											</xsl:for-each>
182
                        <xsl:for-each
183
                            select="//*[local-name() = 'function']/*[local-name() = 'comment' and not(. = 'null')]">
184
                            <datacite:description>
185
                                <xsl:attribute name="descriptionType" select="'Abstract'"/>
186
                                <xsl:value-of select="."/>
187
                            </datacite:description>
188
                        </xsl:for-each>
167 189

  
168
											<xsl:for-each select="//*[local-name() = 'operatingSystem']">
169
												<datacite:description>
170
													<xsl:attribute name="descriptionType" select="'TechnicalInfo'"/>
171
													<xsl:value-of select="."/>
172
												</datacite:description>
173
											</xsl:for-each>
190
                        <xsl:for-each select="//*[local-name() = 'operatingSystem']">
191
                            <datacite:description>
192
                                <xsl:attribute name="descriptionType" select="'TechnicalInfo'"/>
193
                                <xsl:value-of select="."/>
194
                            </datacite:description>
195
                        </xsl:for-each>
174 196

  
175
										</datacite:descriptions>
197
                    </datacite:descriptions>
176 198

  
177
										<!-- subject -->
178
										<!-- dropping duplicate topics - funny that this seemingly works -->
179
										<datacite:subjects>
180
											<xsl:for-each select="//*[local-name() = 'topic'][index-of(distinct-values(//*[local-name() = 'topic']/*[local-name() = 'uri']), ./*[local-name() = 'uri'])]">
181
												<xsl:if test=".">
182
													<datacite:subject>
183
														<xsl:attribute name="subjectScheme" select="'EDAM Ontology'"/>
184
														<xsl:attribute name="schemeURI" select="'http://edamontology.org'"/>
185
														<xsl:attribute name="valueURI" select="./*[local-name() = 'uri']"/>
186
														<xsl:value-of select="./*[local-name() = 'term']"/>
187
													</datacite:subject>
188
												</xsl:if>
189
											</xsl:for-each>
190
										</datacite:subjects>
199
                    <!-- subject -->
200
                    <!-- dropping duplicate topics - funny that this seemingly works -->
201
                    <datacite:subjects>
202
                        <xsl:for-each
203
                            select="//*[local-name() = 'topic'][index-of(distinct-values(//*[local-name() = 'topic']/*[local-name() = 'uri']), ./*[local-name() = 'uri'])]">
204
                            <xsl:if test=".">
205
                                <datacite:subject>
206
                                    <xsl:attribute name="subjectScheme" select="'EDAM Ontology'"/>
207
                                    <xsl:attribute name="schemeURI"
208
                                        select="'http://edamontology.org'"/>
209
                                    <xsl:attribute name="valueURI"
210
                                        select="./*[local-name() = 'uri']"/>
211
                                    <xsl:value-of select="./*[local-name() = 'term']"/>
212
                                </datacite:subject>
213
                            </xsl:if>
214
                        </xsl:for-each>
215
                    </datacite:subjects>
191 216

  
192
									</datacite:resource>
217
                </datacite:resource>
193 218

  
194
									<!--
219
                <!--
195 220
									CobjCategory, SuperType
196 221
									-->
197
									<xsl:variable name='varCobjCategory' select="'0029'"/>
198
									<xsl:variable name='varSuperType' select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')"/>
199
									<dr:CobjCategory>
200
										<xsl:attribute name="type" select="$varSuperType"/>
201
										<xsl:value-of select="$varCobjCategory"/>
202
									</dr:CobjCategory>
222
                <xsl:variable name="varCobjCategory" select="'0029'"/>
223
                <xsl:variable name="varSuperType"
224
                    select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')"/>
225
                <dr:CobjCategory>
226
                    <xsl:attribute name="type" select="$varSuperType"/>
227
                    <xsl:value-of select="$varCobjCategory"/>
228
                </dr:CobjCategory>
203 229

  
204
									<!--
230
                <!--
205 231
									access rights, licenses
206 232
									-->
207
									<xsl:for-each select="//*[local-name() = ('license', 'accessibility') and not(. = 'null')]">
208
										<oaf:accessrights>
209
											<xsl:variable name='varAccessRights' select="TransformationFunction:convertString($tf, ., 'AccessRights')"/>
210
											<xsl:choose>
211
												<xsl:when test="$varAccessRights = ('OPEN', 'OPEN SOURCE') and $varSuperType = 'software'">
212
													<xsl:value-of select="'OPEN SOURCE'"/>
213
												</xsl:when>
214
												<xsl:otherwise>
215
													<xsl:value-of select="$varAccessRights"/>
216
												</xsl:otherwise>
217
											</xsl:choose>
218
										</oaf:accessrights>
219
									</xsl:for-each>
233
                <xsl:for-each
234
                    select="//*[local-name() = ('license', 'accessibility') and not(. = 'null')]">
235
                    <oaf:accessrights>
236
                        <xsl:variable name="varAccessRights"
237
                            select="TransformationFunction:convertString($tf, ., 'AccessRights')"/>
238
                        <xsl:choose>
239
                            <xsl:when
240
                                test="$varAccessRights = ('OPEN', 'OPEN SOURCE') and $varSuperType = 'software'">
241
                                <xsl:value-of select="'OPEN SOURCE'"/>
242
                            </xsl:when>
243
                            <xsl:otherwise>
244
                                <xsl:value-of select="$varAccessRights"/>
245
                            </xsl:otherwise>
246
                        </xsl:choose>
247
                    </oaf:accessrights>
248
                </xsl:for-each>
220 249

  
221
									<xsl:for-each select="//*[local-name() = 'license' and not(. = 'null')]">
222
										<oaf:license>
223
											<xsl:value-of select="."/>
224
										</oaf:license>
225
									</xsl:for-each>
250
                <xsl:for-each select="//*[local-name() = 'license' and not(. = 'null')]">
251
                    <oaf:license>
252
                        <xsl:value-of select="."/>
253
                    </oaf:license>
254
                </xsl:for-each>
226 255

  
227
									<oaf:hostedBy>
228
										<xsl:attribute name="name" select="$varOfficialName"/>
229
										<xsl:attribute name="id" select="$varDataSourceId"/>
230
									</oaf:hostedBy>
231
									<oaf:collectedFrom>
232
										<xsl:attribute name="name" select="$varOfficialName"/>
233
										<xsl:attribute name="id" select="$varDataSourceId"/>
234
									</oaf:collectedFrom>
256
                <oaf:hostedBy>
257
                    <xsl:attribute name="name" select="$varOfficialName"/>
258
                    <xsl:attribute name="id" select="$varDataSourceId"/>
259
                </oaf:hostedBy>
260
                <oaf:collectedFrom>
261
                    <xsl:attribute name="name" select="$varOfficialName"/>
262
                    <xsl:attribute name="id" select="$varDataSourceId"/>
263
                </oaf:collectedFrom>
235 264

  
236
									<!--
265
                <!--
237 266
									<oaf:identifier>
238 267
									<xsl:value-of select="//*[local-name() = 'id']"/>
239 268
									</oaf:identifier>
240 269
									-->
241 270

  
271
                <xsl:variable name="authorMails" select="//contact/email"/>
272
                <xsl:if test="count(functx:value-intersect($authorMails, $elixirGRAuthorMails)) > 0">
273
                    <oaf:concept>
274
                        <xsl:attribute name="id" select="'elixir-gr'"/>
275
                    </oaf:concept>
276
                </xsl:if>
242 277

  
243
									<oaf:concept>
244
										<xsl:attribute name="id" select="'elixir-gr'"/>
245
									</oaf:concept>
246 278

  
279
                <!-- date -->
280
                <oaf:dateAccepted>
281
                    <xsl:value-of
282
                        select="//*[local-name() = 'additionDate']/substring-before(., 'T')"/>
283
                </oaf:dateAccepted>
247 284

  
248
									<!-- date -->
249
									<oaf:dateAccepted>
250
										<xsl:value-of select="//*[local-name() = 'additionDate']/substring-before(., 'T')"/>
251
									</oaf:dateAccepted>
285
            </metadata>
286
            <xsl:copy-of select="//*[local-name() = 'about']"/>
287
        </record>
252 288

  
253
								</metadata>
254
								<xsl:copy-of select="//*[local-name() = 'about']"/>
255
							</record>
289
    </xsl:template>
256 290

  
257
						</xsl:template>
291
    <xsl:template match="node() | @*">
292
        <xsl:copy>
293
            <xsl:apply-templates select="node() | @*"/>
294
        </xsl:copy>
295
    </xsl:template>
258 296

  
259
						<xsl:template match="node()|@*">
260
							<xsl:copy>
261
								<xsl:apply-templates select="node()|@*"/>
262
							</xsl:copy>
263
						</xsl:template>
297
    <xsl:template match="//*[local-name() = 'metadata']//*[local-name() = 'resource']">
298
        <xsl:copy>
299
            <xsl:apply-templates select="node() | @*"/>
300
        </xsl:copy>
301
    </xsl:template>
264 302

  
265
						<xsl:template match="//*[local-name() = 'metadata']//*[local-name() = 'resource']">
266
							<xsl:copy>
267
								<xsl:apply-templates select="node()|@*"/>
268
							</xsl:copy>
269
						</xsl:template>
303
    <xsl:template match="//*[local-name() = 'header']">
304
        <xsl:copy>
305
            <xsl:apply-templates select="node() | @*"/>
306
            <xsl:element name="dr:dateOfTransformation">
307
                <xsl:value-of select="$transDate"/>
308
            </xsl:element>
309
        </xsl:copy>
310
    </xsl:template>
270 311

  
271
						<xsl:template match="//*[local-name() = 'header']">
272
							<xsl:copy>
273
								<xsl:apply-templates select="node()|@*"/>
274
								<xsl:element name="dr:dateOfTransformation">
275
									<xsl:value-of select="$transDate"/>
276
								</xsl:element>
277
							</xsl:copy>
278
						</xsl:template>
279

  
280
						<!--
312
    <!--
281 313
						<xsl:template match="//*[local-name() = 'authors']">
282 314
						-->
283
						<xsl:template name="authors">
284
							<xsl:choose>
285
								<xsl:when test="not(//*[local-name() = 'credit'][./*[local-name() = 'typeRole' and . = 'Developer']][./*[local-name() = 'name' and not(. = 'null')]])">
286
									<xsl:call-template name="terminate"/>
287
								</xsl:when>
288
								<xsl:otherwise>
289
									<datacite:creators>
290
										<xsl:for-each select="//*[local-name() = 'credit'][./*[local-name() = 'typeRole' and . = 'Developer']]/*[local-name() = 'name' and not(. = 'null')]">
291
											<xsl:for-each select="tokenize(., ', ')">
292
												<xsl:variable name="varDeveloperName" select="TransformationFunction:convertString($tf, normalize-space(.), 'Person')"/>
293
												<datacite:creator>
294
													<datacite:creatorName>
295
														<xsl:value-of select="$varDeveloperName"/>
296
													</datacite:creatorName>
297
													<datacite:givenName>
298
														<xsl:value-of select="substring-after($varDeveloperName, ', ')"/>
299
													</datacite:givenName>
300
													<datacite:familyName>
301
														<xsl:value-of select="substring-before($varDeveloperName, ', ')"/>
302
													</datacite:familyName>
303
													<!--
315
    <xsl:template name="authors">
316
        <xsl:choose>
317
            <xsl:when
318
                test="not(//*[local-name() = 'credit'][./*[local-name() = 'typeRole' and . = 'Developer']][./*[local-name() = 'name' and not(. = 'null')]])">
319
                <xsl:call-template name="terminate"/>
320
            </xsl:when>
321
            <xsl:otherwise>
322
                <datacite:creators>
323
                    <xsl:for-each
324
                        select="//*[local-name() = 'credit'][./*[local-name() = 'typeRole' and . = 'Developer']]/*[local-name() = 'name' and not(. = 'null')]">
325
                        <xsl:for-each select="tokenize(., ', ')">
326
                            <xsl:variable name="varDeveloperName"
327
                                select="TransformationFunction:convertString($tf, normalize-space(.), 'Person')"/>
328
                            <datacite:creator>
329
                                <datacite:creatorName>
330
                                    <xsl:value-of select="$varDeveloperName"/>
331
                                </datacite:creatorName>
332
                                <datacite:givenName>
333
                                    <xsl:value-of select="substring-after($varDeveloperName, ', ')"
334
                                    />
335
                                </datacite:givenName>
336
                                <datacite:familyName>
337
                                    <xsl:value-of select="substring-before($varDeveloperName, ', ')"
338
                                    />
339
                                </datacite:familyName>
340
                                <!--
304 341
													<xsl:if test="string-length(./*[local-name() = 'orcid']) > 0">
305 342
													<xsl:element name="datacite:nameIdentifier">
306 343
													<xsl:attribute name="nameIdentifierScheme" select="'ORCID'"/>
......
314 351
													</xsl:element>
315 352
													</xsl:for-each>
316 353
													-->
317
												</datacite:creator>
318
											</xsl:for-each>
319
										</xsl:for-each>
320
									</datacite:creators>
321
								</xsl:otherwise>
322
							</xsl:choose>
323
						</xsl:template>
354
                            </datacite:creator>
355
                        </xsl:for-each>
356
                    </xsl:for-each>
357
                </datacite:creators>
358
            </xsl:otherwise>
359
        </xsl:choose>
360
    </xsl:template>
324 361

  
325
						<!--
362
    <!--
326 363
						<xsl:template match="//*[local-name() = 'DOI']">
327 364
						-->
328
						<xsl:template name="relatedPaper">
329
							<xsl:for-each select="//*[local-name() = 'publication']/*[local-name() = ('doi', 'pmid', 'pmcid') and not(. = 'null')]">
330
								<xsl:element name="datacite:relatedIdentifier">
331
									<xsl:attribute name="relatedIdentifierType" select="upper-case(local-name())"/>
332
									<xsl:attribute name="relationType">
333
										<xsl:choose>
334
											<xsl:when test="../*[local-name() = 'type'] = 'Primary'">
335
												<xsl:value-of select="'isSupplementTo'"/>
336
											</xsl:when>
337
											<xsl:when test="../*[local-name() = 'type'] = ('Review', 'Benchmark', 'Comparison')">
338
												<xsl:value-of select="'isReviewedBy'"/>
339
											</xsl:when>
340
											<xsl:when test="../*[local-name() = 'type'] = 'Usage'">
341
												<xsl:value-of select="'isReferencedBy'"/>
342
											</xsl:when>
343
											<xsl:when test="../*[local-name() = 'type'] = 'Method'">
344
												<xsl:value-of select="'references'"/>
345
											</xsl:when>
346
											<xsl:otherwise>
347
												<xsl:value-of select="'isReferencedBy'"/>
348
											</xsl:otherwise>
349
										</xsl:choose>
350
									</xsl:attribute>
351
									<xsl:value-of select="."/>
352
								</xsl:element>
353
							</xsl:for-each>
354
						</xsl:template>
365
    <xsl:template name="relatedPaper">
366
        <xsl:for-each
367
            select="//*[local-name() = 'publication']/*[local-name() = ('doi', 'pmid', 'pmcid') and not(. = 'null')]">
368
            <xsl:element name="datacite:relatedIdentifier">
369
                <xsl:attribute name="relatedIdentifierType" select="upper-case(local-name())"/>
370
                <xsl:attribute name="relationType">
371
                    <xsl:choose>
372
                        <xsl:when test="../*[local-name() = 'type'] = 'Primary'">
373
                            <xsl:value-of select="'isSupplementTo'"/>
374
                        </xsl:when>
375
                        <xsl:when
376
                            test="../*[local-name() = 'type'] = ('Review', 'Benchmark', 'Comparison')">
377
                            <xsl:value-of select="'isReviewedBy'"/>
378
                        </xsl:when>
379
                        <xsl:when test="../*[local-name() = 'type'] = 'Usage'">
380
                            <xsl:value-of select="'isReferencedBy'"/>
381
                        </xsl:when>
382
                        <xsl:when test="../*[local-name() = 'type'] = 'Method'">
383
                            <xsl:value-of select="'references'"/>
384
                        </xsl:when>
385
                        <xsl:otherwise>
386
                            <xsl:value-of select="'isReferencedBy'"/>
387
                        </xsl:otherwise>
388
                    </xsl:choose>
389
                </xsl:attribute>
390
                <xsl:value-of select="."/>
391
            </xsl:element>
392
        </xsl:for-each>
393
    </xsl:template>
355 394

  
356
					</xsl:stylesheet>
395
</xsl:stylesheet>
396
]]>
357 397
				</CODE>
358 398
			</SCRIPT>
359 399
		</CONFIGURATION>

Also available in: Unified diff