Project

General

Profile

1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER
4
				value="3927475c-3068-4859-a5cc-3506be5996e3_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
5
		<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
6
		<RESOURCE_KIND value="TransformationRuleDSResources"/>
7
		<RESOURCE_URI value=""/>
8
		<DATE_OF_CREATION value="2015-03-04T22:32:36+01:00"/>
9
	</HEADER>
10
	<BODY>
11
		<CONFIGURATION>
12
			<IMPORTED/>
13
			<SCRIPT>
14
				<TITLE>OAI_Datacite CCDC transform</TITLE>
15
				<CODE><![CDATA[
16
                    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
17
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18
    xmlns:datetime="http://exslt.org/dates-and-times" xmlns:exslt="http://exslt.org/common"
19
    xmlns:oai="http://www.openarchives.org/OAI/2.0/"
20
    xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:dli="http://www.dli.eu"
21
    exclude-result-prefixes="xsl datetime exslt ">
22
    
23
    <xsl:template match="/">
24
        <xsl:choose>
25
            <xsl:when test="not(//*[lower-case(local-name())='relatedidentifier'])">
26
                <record> </record>
27
            </xsl:when>           
28
            <xsl:otherwise>
29
                <record>
30
                    <xsl:copy-of select="//*[local-name()='header']"/>
31
                    <metadata>
32
                    	<xsl:variable name="pid">
33
                            <xsl:value-of select="//*[local-name()='header']/*[local-name()='recordIdentifier']"/>
34
                        </xsl:variable>
35

    
36
                        <xsl:variable name="namespacePrefix">
37
                            <xsl:value-of select="//*[local-name()='header']/*[local-name()='datasourceprefix']"/>
38
                        </xsl:variable>
39
                        <dli:dliObject>
40
                            <dnetResourceIdentifier>
41
                                <xsl:value-of
42
                                    select="//*[local-name()='header']/*[local-name()='objIdentifier']"
43
                                />
44
                            </dnetResourceIdentifier>
45
                            <localIdentifier type="doi">
46
                                <xsl:value-of
47
                                    select="//*[local-name()='header']/*[local-name()='recordIdentifier']"
48
                                />
49
                            </localIdentifier>
50
                            <provenance>
51
                                <datasource>
52
                                    <xsl:attribute name="completionStatus">complete</xsl:attribute>
53
                                    <xsl:attribute name="provisionMode">collected</xsl:attribute>
54
                                    <xsl:value-of select="$namespacePrefix" />
55
                                </datasource>
56
                            </provenance>
57
                            <xsl:for-each
58
                                select="//*[local-name()='titles']/*[local-name()='title']">
59
                                <title>
60
                                    <xsl:value-of select="."/>
61
                                </title>
62
                            </xsl:for-each>
63
                            <xsl:for-each
64
                                    select="//*[local-name()='resource']//*[local-name()='date']">
65
                            	<date> <xsl:value-of select="." /> </date>
66
                             </xsl:for-each>
67
                            <objectType>dataset</objectType>
68
                            <xsl:for-each
69
                                select="//*[local-name()='resource']//*[local-name()='creators']">
70
                                <authors>
71
                                    <xsl:for-each select=".//*[local-name()='creator']">
72
                                        <author>
73
                                            <fullname>
74
                                                <xsl:value-of
75
                                                    select="./*[local-name()='creatorName']"/>
76
                                            </fullname>
77
                                        </author>
78
                                    </xsl:for-each>
79
                                    
80
                                </authors>
81
                            </xsl:for-each>
82
                            <relations>
83
                                <xsl:for-each select="//*[local-name()='relatedIdentifier']">
84
                                    <relation> 
85
                                        <xsl:variable name="relationType"><xsl:value-of select="lower-case(./@relationType)"/> </xsl:variable>
86
                                        <pid>
87
                                            <xsl:attribute name="type">
88
                                                <xsl:value-of select="./@relatedIdentifierType"/>
89
                                            </xsl:attribute>
90
                                            <xsl:value-of select="."/>
91
                                        </pid>
92
                                        <xsl:choose>
93
                                            <xsl:when test="$relationType = 'cites'">
94
                                                <typeOfRelation>Cites</typeOfRelation>        
95
                                            </xsl:when>
96
                                            <xsl:when test="$relationType = 'iscitedby'">
97
                                                <typeOfRelation>isCitedBy</typeOfRelation>        
98
                                            </xsl:when>
99
                                            <xsl:when test="$relationType = 'issupplementto'">
100
                                                <typeOfRelation>IsSupplementTo</typeOfRelation>        
101
                                            </xsl:when>
102
                                            <xsl:when test="$relationType = 'issupplementedby'">
103
                                                <typeOfRelation>IsSupplementedBy</typeOfRelation>        
104
                                            </xsl:when>
105
                                            <xsl:when test="$relationType = 'references'">
106
                                                <typeOfRelation>References</typeOfRelation>        
107
                                            </xsl:when>
108
                                            <xsl:when test="$relationType = 'isreferencedby'">
109
                                                <typeOfRelation>IsReferencedBy</typeOfRelation>        
110
                                            </xsl:when>                                            
111
                                            <xsl:otherwise>
112
                                                <typeOfRelation>References</typeOfRelation>
113
                                            </xsl:otherwise>
114
                                        </xsl:choose>                      
115
                                    </relation>
116
                                </xsl:for-each>
117
                            </relations>                            
118
                        </dli:dliObject>                        
119
                    </metadata>
120
                </record>
121
            </xsl:otherwise>
122
        </xsl:choose>        
123
    </xsl:template>    
124
</xsl:stylesheet>
125
                    
126
                    
127
                    
128
                    
129
                    ]]></CODE>
130
			</SCRIPT>
131
		</CONFIGURATION>
132
		<STATUS/>
133
		<SECURITY_PARAMETERS/>
134
	</BODY>
135
</RESOURCE_PROFILE>
(10-10/17)