Revision 55112
Added by Alessia Bardi over 5 years ago
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/xslt_cleaning_ORP-biotools.xml | ||
---|---|---|
310 | 310 |
</xsl:copy> |
311 | 311 |
</xsl:template> |
312 | 312 |
|
313 |
<!-- |
|
314 |
<xsl:template match="//*[local-name() = 'authors']"> |
|
315 |
--> |
|
316 |
<xsl:template name="authors"> |
|
313 |
<xsl:template name="authors"> |
|
314 |
<!-- Allowed roles : |
|
315 |
Developer |
|
316 |
Maintainer |
|
317 |
Provider |
|
318 |
Documentor |
|
319 |
Contributor |
|
320 |
Support |
|
321 |
Primary contact |
|
322 |
We'll consider Developer and Primary Contact as authors. |
|
323 |
--> |
|
317 | 324 |
<xsl:choose> |
318 | 325 |
<xsl:when |
319 |
test="not(//*[local-name() = 'credit'][./*[local-name() = 'typeRole' and . = 'Developer']][./*[local-name() = 'name' and not(. = 'null')]])">
|
|
326 |
test="not(//*[local-name() = 'credit'][./*[local-name() = 'typeRole' and (. = 'Developer' or . = 'Primary contact')]][./*[local-name() = 'name' and not(. = 'null')]])">
|
|
320 | 327 |
<xsl:call-template name="terminate"/> |
321 | 328 |
</xsl:when> |
322 | 329 |
<xsl:otherwise> |
323 | 330 |
<datacite:creators> |
324 | 331 |
<xsl:for-each |
325 |
select="//*[local-name() = 'credit'][./*[local-name() = 'typeRole' and . = 'Developer']]/*[local-name() = 'name' and not(. = 'null')]">
|
|
332 |
select="//*[local-name() = 'credit'][./*[local-name() = 'typeRole' and (. = 'Developer' or . = 'Primary contact')]]/*[local-name() = 'name' and not(. = 'null')]">
|
|
326 | 333 |
<xsl:for-each select="tokenize(., ', ')"> |
327 | 334 |
<xsl:variable name="varDeveloperName" |
328 | 335 |
select="TransformationFunction:convertString($tf, normalize-space(.), 'Person')"/> |
... | ... | |
338 | 345 |
<xsl:value-of select="substring-before($varDeveloperName, ', ')" |
339 | 346 |
/> |
340 | 347 |
</datacite:familyName> |
341 |
<!-- |
|
342 |
<xsl:if test="string-length(./*[local-name() = 'orcid']) > 0"> |
|
343 |
<xsl:element name="datacite:nameIdentifier"> |
|
344 |
<xsl:attribute name="nameIdentifierScheme" select="'ORCID'"/> |
|
345 |
<xsl:attribute name="schemeURI" select="'http://orcid.org'"/> |
|
346 |
<xsl:value-of select="./*[local-name()='orcid']"/> |
|
347 |
</xsl:element> |
|
348 |
</xsl:if> |
|
349 |
<xsl:for-each select="./*[local-name() = 'affiliations'][string-length(.) > 0]"> |
|
350 |
<xsl:element name="datacite:affiliation"> |
|
351 |
<xsl:value-of select="."/> |
|
352 |
</xsl:element> |
|
353 |
</xsl:for-each> |
|
354 |
--> |
|
348 |
<xsl:if |
|
349 |
test="string-length(./*[local-name() = 'orcidId']) > 0 and ./*[local-name() = 'orcidId'] != 'null'"> |
|
350 |
<nameIdentifier nameIdentifierScheme="ORCID" |
|
351 |
schemeURI="https://orcid.org"> |
|
352 |
<xsl:value-of select="./*[local-name() = 'orcidId']"/> |
|
353 |
</nameIdentifier> |
|
354 |
</xsl:if> |
|
355 | 355 |
</datacite:creator> |
356 | 356 |
</xsl:for-each> |
357 | 357 |
</xsl:for-each> |
Also available in: Unified diff
Let's consider authors also primary contacts, otherwise we exclude too many records.