Revision 59895
Added by Alessia Bardi over 3 years ago
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/xslt_cleaning_datarepo_datacite.xml | ||
---|---|---|
12 | 12 |
<SCRIPT> |
13 | 13 |
<TITLE>xslt_cleaning_datarepo_datacite</TITLE> |
14 | 14 |
<CODE> |
15 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:oai="http://www.openarchives.org/OAI/2.0/" xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy" xmlns:dr="http://www.driver-repository.eu/namespace/dr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="TransformationFunction" extension-element-prefixes="TransformationFunction" version="1.1"> |
|
15 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
16 |
xmlns:oaf="http://namespace.openaire.eu/oaf" |
|
17 |
xmlns:oai="http://www.openarchives.org/OAI/2.0/" |
|
18 |
xmlns:datacite="http://datacite.org/schema/kernel-3" |
|
19 |
xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy" |
|
20 |
xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
21 |
exclude-result-prefixes="TransformationFunction" |
|
22 |
extension-element-prefixes="TransformationFunction" |
|
23 |
version="2.0"> |
|
16 | 24 |
<xsl:param name="varOfficialName"/> |
17 | 25 |
<xsl:param name="varDsType"/> |
18 | 26 |
<xsl:param name="varDataSourceId"/> |
... | ... | |
281 | 289 |
</xsl:copy> |
282 | 290 |
</xsl:template> |
283 | 291 |
<xsl:template match="//*[local-name() = 'resource']/*[local-name()='alternateIdentifiers']"> |
284 |
<xsl:element name="alternateIdentifiers" namespace="http://www.openarchives.org/OAI/2.0/">
|
|
292 |
<xsl:element name="alternateIdentifiers" namespace="http://datacite.org/schema/kernel-3">
|
|
285 | 293 |
<xsl:copy-of select="./*"/> |
286 | 294 |
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='Handle']"> |
287 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
|
295 |
<xsl:element name="alternateIdentifier" namespace="http://datacite.org/schema/kernel-3">
|
|
288 | 296 |
<xsl:attribute name="alternateIdentifierType"> |
289 | 297 |
<xsl:value-of select="'URL'"/> |
290 | 298 |
</xsl:attribute> |
... | ... | |
292 | 300 |
</xsl:element> |
293 | 301 |
</xsl:if> |
294 | 302 |
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='URN']"> |
295 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
|
303 |
<xsl:element name="alternateIdentifier" namespace="http://datacite.org/schema/kernel-3">
|
|
296 | 304 |
<xsl:attribute name="alternateIdentifierType"> |
297 | 305 |
<xsl:value-of select="'URL'"/> |
298 | 306 |
</xsl:attribute> |
... | ... | |
300 | 308 |
</xsl:element> |
301 | 309 |
</xsl:if> |
302 | 310 |
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='DOI']"> |
303 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
|
311 |
<xsl:element name="alternateIdentifier" namespace="http://datacite.org/schema/kernel-3">
|
|
304 | 312 |
<xsl:attribute name="alternateIdentifierType"> |
305 | 313 |
<xsl:value-of select="'URL'"/> |
306 | 314 |
</xsl:attribute><!-- |
... | ... | |
314 | 322 |
</xsl:template> |
315 | 323 |
<xsl:template match="//*[local-name() = 'resource']/*[local-name()='identifier']"><!-- cut off DOI resolver prefix to just get the number part --> |
316 | 324 |
<xsl:if test=".[@identifierType='DOI'][contains(., '://dx.doi.org/')]"> |
317 |
<xsl:element name="identifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
|
325 |
<xsl:element name="identifier" namespace="http://datacite.org/schema/kernel-3">
|
|
318 | 326 |
<xsl:attribute name="identifierType"> |
319 | 327 |
<xsl:value-of select="'DOI'"/> |
320 | 328 |
</xsl:attribute> |
... | ... | |
325 | 333 |
<xsl:copy-of select="."/> |
326 | 334 |
--> |
327 | 335 |
<xsl:if test="not(//*[local-name() = 'resource']/*[local-name()='alternateIdentifiers'])"> |
328 |
<xsl:element name="alternateIdentifiers" namespace="http://www.openarchives.org/OAI/2.0/">
|
|
336 |
<xsl:element name="alternateIdentifiers" namespace="http://datacite.org/schema/kernel-3">
|
|
329 | 337 |
<xsl:if test=".[@identifierType='Handle']"> |
330 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
|
338 |
<xsl:element name="alternateIdentifier" namespace="http://datacite.org/schema/kernel-3">
|
|
331 | 339 |
<xsl:attribute name="alternateIdentifierType"> |
332 | 340 |
<xsl:value-of select="'URL'"/> |
333 | 341 |
</xsl:attribute> |
... | ... | |
335 | 343 |
</xsl:element> |
336 | 344 |
</xsl:if> |
337 | 345 |
<xsl:if test=".[@identifierType='URN']"> |
338 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
|
346 |
<xsl:element name="alternateIdentifier" namespace="http://datacite.org/schema/kernel-3">
|
|
339 | 347 |
<xsl:attribute name="alternateIdentifierType"> |
340 | 348 |
<xsl:value-of select="'URL'"/> |
341 | 349 |
</xsl:attribute> |
... | ... | |
343 | 351 |
</xsl:element> |
344 | 352 |
</xsl:if> |
345 | 353 |
<xsl:if test=".[@identifierType='DOI']"> |
346 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
|
354 |
<xsl:element name="alternateIdentifier" namespace="http://datacite.org/schema/kernel-3">
|
|
347 | 355 |
<xsl:attribute name="alternateIdentifierType"> |
348 | 356 |
<xsl:value-of select="'URL'"/> |
349 | 357 |
</xsl:attribute> |
Also available in: Unified diff
using datacite kernel3 namespace instead of wrong oai namespace