Project

General

Profile

1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="f2a0afea-39a3-439c-a6fb-a4f34691f8ad_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_frontiers2oaf</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:template match="issn-type">
28
        <xsl:choose>
29
            <xsl:when test="./type = 'electronic'">
30
                <dc:source>
31
                    <xsl:value-of select="concat(string('eissn: '), normalize-space(./value))"/>
32
                </dc:source>
33
            </xsl:when>
34
            <xsl:otherwise>
35
                <dc:source>
36
                    <xsl:value-of
37
                        select="concat(string('issn: '), normalize-space(./value))"
38
                    />
39
                </dc:source>
40
            </xsl:otherwise>
41
        </xsl:choose>
42
    </xsl:template>
43

    
44
    <xsl:template match="publisher">
45
        <dc:publisher>
46
            <xsl:value-of select="."/>
47
        </dc:publisher>
48
    </xsl:template>
49

    
50
    <xsl:template match="/">
51
        <xsl:if test="not(.//error)">
52
            <record>
53
                <header>
54
                    <xsl:copy-of select="//*[local-name() = 'header']/*" copy-namespaces="no"/>
55
                    <dr:dateOfTransformation>
56
                        <xsl:value-of select="date:date-time()"/>
57
                    </dr:dateOfTransformation>
58
                </header>
59
                <metadata>
60
                    <dc:language>eng</dc:language>
61
                    <oaf:accessrights>OPEN</oaf:accessrights>
62
                    <oaf:hostedBy id="openaire____::frontiers"
63
                        name="Frontiers"/>
64
                   <!-- <oaf:accessrights>UNKNOWN</oaf:accessrights>
65
                    <oaf:hostedBy id="openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18"
66
                        name="Unknown Repository"/>-->
67
                    <oaf:collectedFrom>
68
                        <xsl:attribute name="name">
69
                            <xsl:value-of select="$varOfficialName"/>
70
                        </xsl:attribute>
71
                        <xsl:attribute name="id">
72
                            <xsl:value-of select="$varDataSourceId"/>
73
                        </xsl:attribute>
74
                    </oaf:collectedFrom>
75

    
76
                    <xsl:apply-templates select=".//*"/>
77
                </metadata>
78
                <xsl:copy-of select="//*[local-name() = 'about']/*" copy-namespaces="no"/>
79
            </record>
80
        </xsl:if>
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
        <xsl:if test="../type = 'journal-article'">
104
            <dc:date>
105
                <xsl:value-of select="$d"/>
106
            </dc:date>
107
        </xsl:if>
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:if test="../issn-type/type eq 'electronic'">
141
                    <oaf:journal eissn="{../issn-type/value}">
142
                        <xsl:value-of select="concat(normalize-space(../container-title), ' - ' , normalize-space(../title))"/>
143
                    </oaf:journal>
144
                </xsl:if>
145

    
146
            </xsl:when>
147
        </xsl:choose>
148
    </xsl:template>
149

    
150
    <xsl:template match="downloadFileUrl">
151
        <downloadFileUrl><xsl:value-of select="."/></downloadFileUrl>
152
    </xsl:template>
153

    
154

    
155
    <!-- Extend with new templates for additional types of publication     -->
156

    
157
    <xsl:template match="* | @*"/>
158

    
159
</xsl:stylesheet>
160

    
161
]]>
162
                </CODE>
163
            </SCRIPT>
164
        </CONFIGURATION>
165
        <STATUS/>
166
        <SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
167
    </BODY>
168
</RESOURCE_PROFILE>
(2-2/5)