1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
3
|
<xsl:template match="/">
|
4
|
<record xmlns="http://www.openarchives.org/OAI/2.0/"
|
5
|
xmlns:dr="http://www.driver-repository.eu/namespace/dr"
|
6
|
xmlns:dri="http://www.driver-repository.eu/namespace/dri"
|
7
|
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
8
|
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/">
|
9
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
10
|
<metadata>
|
11
|
<xsl:for-each select=".//*[local-name()='metadata']/*/*">
|
12
|
<xsl:choose>
|
13
|
<xsl:when test="local-name()='type'">
|
14
|
<dr:CobjCategory>0001</dr:CobjCategory>
|
15
|
</xsl:when>
|
16
|
<xsl:when test="local-name()='identifier'">
|
17
|
<dr:CobjIdentifier><xsl:value-of select="normalize-space(.)"/></dr:CobjIdentifier>
|
18
|
<xsl:if test="starts-with(., 'doi')">
|
19
|
<oaf:identifier identifierType="doi"><xsl:value-of select="normalize-space(.)"/></oaf:identifier>
|
20
|
</xsl:if>
|
21
|
</xsl:when>
|
22
|
<xsl:when test="local-name()='relation'">
|
23
|
<xsl:if test="contains(., 'grantAgreement/EC/FP7')">
|
24
|
<oaf:projectid><xsl:value-of select="concat('corda_______::', substring-after(normalize-space(.), 'FP7/'))"/></oaf:projectid>
|
25
|
</xsl:if>
|
26
|
</xsl:when>
|
27
|
<xsl:when test="local-name()='rights'">
|
28
|
<oaf:accessrights>
|
29
|
<xsl:choose>
|
30
|
<xsl:when test="contains(., 'closed')">CLOSED</xsl:when>
|
31
|
<xsl:when test="contains(., 'restricted')">RESTRICTED</xsl:when>
|
32
|
<xsl:when test="contains(., 'embargo')">EMBARGO</xsl:when>
|
33
|
<xsl:when test="contains(., 'open')">OPEN</xsl:when>
|
34
|
<xsl:otherwise>UNKNOWN</xsl:otherwise>
|
35
|
</xsl:choose>
|
36
|
</oaf:accessrights>
|
37
|
</xsl:when>
|
38
|
<xsl:otherwise>
|
39
|
<xsl:copy-of select="."/>
|
40
|
</xsl:otherwise>
|
41
|
</xsl:choose>
|
42
|
</xsl:for-each>
|
43
|
<oaf:hostedBy name="DATASOURCE NAME" id="datasource id (database)"/>
|
44
|
<oaf:collectedFrom name="DATASOURCE NAME" id="datasource id (database)"/>
|
45
|
<oaf:collectedDatasourceid>datasource id taken from the database, es: opendoar____::2659</oaf:collectedDatasourceid>
|
46
|
</metadata>
|
47
|
</record>
|
48
|
</xsl:template>
|
49
|
</xsl:stylesheet>
|