Project

General

Profile

1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="dff3a83e-97a3-4a8b-9e57-7aed12804f30_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
        <RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
        <RESOURCE_KIND value="TransformationRuleDSResources"/>
6
        <RESOURCE_URI value=""/>
7
        <DATE_OF_CREATION value="2016-11-21T11:15:30+00:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <IMPORTED/>
12
            <SCRIPT>
13
                <TITLE>core_springer2oaf</TITLE>
14
                <CODE>
15
                    <![CDATA[
16
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
17
    xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://purl.org/dc/elements/1.1/"
18
    xmlns:dr="http://www.driver-repository.eu/namespace/dr"
19
    xmlns:dri="http://www.driver-repository.eu/namespace/dri"
20
    xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:date="http://exslt.org/dates-and-times"
21
    extension-element-prefixes="date" exclude-result-prefixes="xs" version="2.0">
22

    
23
    <xsl:output omit-xml-declaration="yes" indent="yes"/>
24
    <xsl:param name="varOfficialName"/>
25
    <xsl:param name="varDataSourceId"/>
26

    
27
    <xsl:variable name="issn" select=".//ISSN"/>
28
    <xsl:variable name="volume" select=".//volume"/>
29
    <xsl:variable name="licence" select=".//license/URL"/>
30
    <xsl:variable name="issue" select=".//issue"/>
31
    <xsl:variable name="spage" select="normalize-space(tokenize(.//page,'-')[1])"/>
32
    <xsl:variable name="epage" select="normalize-space(tokenize(.//page,'-')[2])"/>
33
    <xsl:template match="publisher">
34
        <dc:publisher>
35
            <xsl:value-of select="."/>
36
        </dc:publisher>
37
    </xsl:template>
38
    <xsl:template match="license">
39
        <dc:rights>
40
            <xsl:value-of select="./URL"/>
41
        </dc:rights>
42
    </xsl:template>
43
    <xsl:template name="terminate">
44
        <xsl:message terminate="yes">
45
            record is not compliant, transformation is interrupted.
46
        </xsl:message>
47
    </xsl:template>
48
    <xsl:template match="/">
49
        <xsl:choose>
50
            <xsl:when test=".//error or string-length(.//title) = 0">
51
                <xsl:call-template name="terminate"/>
52
            </xsl:when>
53
            <xsl:otherwise>
54
                <record>
55
                    <header>
56
                        <xsl:copy-of select="//*[local-name() = 'header']/*" copy-namespaces="no"/>
57
                        <dr:dateOfTransformation>
58
                            <xsl:value-of select="date:date-time()"/>
59
                        </dr:dateOfTransformation>
60
                    </header>
61
                    <metadata>
62
                        <dc:language>eng</dc:language>
63
                        <oaf:accessrights>OPEN</oaf:accessrights>
64
                        <oaf:hostedBy id="openaire____::SpringerOA"
65
                            name="SpringerOpen"/>
66
                        <oaf:collectedFrom>
67
                            <xsl:attribute name="name">
68
                                <xsl:value-of select="$varOfficialName"/>
69
                            </xsl:attribute>
70
                            <xsl:attribute name="id">
71
                                <xsl:value-of select="$varDataSourceId"/>
72
                            </xsl:attribute>
73
                        </oaf:collectedFrom>
74

    
75
                        <xsl:apply-templates select=".//*"/>
76
                    </metadata>
77
                    <xsl:copy-of select="//*[local-name() = 'about']/*" copy-namespaces="no"/>
78
                </record>
79
            </xsl:otherwise>
80
        </xsl:choose>
81

    
82
    </xsl:template>
83

    
84

    
85
    <xsl:template match="title">
86
        <dc:title>
87
            <xsl:value-of select="normalize-space(.)"/>
88
        </dc:title>
89
    </xsl:template>
90

    
91
    <xsl:template match="author">
92
        <dc:creator>
93
            <xsl:value-of select="concat(./family, ', ', ./given)"/>
94
        </dc:creator>
95
    </xsl:template>
96

    
97
    <xsl:template match="created">
98
        <xsl:variable name="d">
99
            <xsl:variable name="date" select=".//array"/>
100

    
101
            <xsl:value-of select="string-join(($date[1], $date[2], $date[3]), '-')"/>
102
        </xsl:variable>
103

    
104
        <dc:date>
105
            <xsl:value-of select="$d"/>
106
        </dc:date>
107

    
108

    
109
    </xsl:template>
110

    
111
    <xsl:template match="DOI">
112
        <dc:identifier>
113
            <xsl:value-of select="concat('http://dx.doi.org/', .)"/>
114
        </dc:identifier>
115
        <oaf:identifier identifierType="doi">
116
            <xsl:value-of select="."/>
117
        </oaf:identifier>
118
    </xsl:template>
119

    
120
    <xsl:template match="type">
121
        <xsl:choose>
122
            <xsl:when test=". eq 'conference-paper'">
123
                <dc:type>
124
                    <xsl:value-of select="string('info:eu-repo/semantics/conferenceObject')"/>
125
                </dc:type>
126
                <dc:type>
127
                    <xsl:value-of select="string('conference paper')"/>
128
                </dc:type>
129
                <dr:CobjCategory>0004</dr:CobjCategory>
130
            </xsl:when>
131
            <xsl:when test=". eq 'journal-article'">
132
                <dc:type>
133
                    <xsl:value-of select="string('info:eu-repo/semantics/article')"/>
134
                </dc:type>
135
                <dc:type>
136
                    <xsl:value-of select="string('journal article')"/>
137
                </dc:type>
138

    
139
                <dr:CobjCategory>0001</dr:CobjCategory>
140
                <xsl:choose>
141
                    <xsl:when test="count($issn) > 0">
142
                        <oaf:journal issn="{$issn[1]}"
143
                            volq="{$volume}"
144
                            issue="{$issue}"
145
                            sp="{$spage}"
146
                            ep="{$epage}"
147
                            >
148
                            <xsl:value-of select="normalize-space(../container-title)"/>
149
                        </oaf:journal>
150
                    </xsl:when>
151
                </xsl:choose>
152

    
153
            </xsl:when>
154
            <xsl:when test=". eq book-chapter">
155
                <dc:type>
156
                    <xsl:value-of select="string('info:eu-repo/semantics/bookPart')"/>
157
                </dc:type>
158
                <dc:type>
159
                    <xsl:value-of select="string('book chapter')"/>
160
                </dc:type>
161
                <dc:source>
162
                    <xsl:value-of select="../container-title"/>
163
                </dc:source>
164

    
165
                <dr:CobjCategory>0013</dr:CobjCategory>
166
            </xsl:when>
167

    
168
        </xsl:choose>
169
    </xsl:template>
170

    
171

    
172

    
173
    <xsl:template match="subject">
174
        <dc:subject>
175
            <xsl:value-of select="."/>
176
        </dc:subject>
177
    </xsl:template>
178

    
179
    <!-- Extend with new templates for additional types of publication     -->
180

    
181
    <xsl:template match="* | @*"/>
182

    
183
</xsl:stylesheet>
184

    
185

    
186

    
187

    
188

    
189

    
190
]]>
191
                </CODE>
192
            </SCRIPT>
193
        </CONFIGURATION>
194
        <STATUS/>
195
        <SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
196
    </BODY>
197
</RESOURCE_PROFILE>
(4-4/5)