Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
3
    xmlns:oaf="http://namespace.openaire.eu/oaf"
4
    xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
5
    xmlns:dc="http://purl.org/dc/elements/1.1/" exclude-result-prefixes="oaf">
6

    
7
    <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
8

    
9
    <xsl:template match="//oaf:result">
10
        <oai_dc:dc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
11
            <xsl:apply-templates/>
12
        </oai_dc:dc>
13
    </xsl:template>
14

    
15
    <xsl:template match="subject">
16
        <dc:subject><xsl:value-of select="."/></dc:subject>
17
    </xsl:template>
18
    
19
    <xsl:template match="oaf:result/publisher">
20
        <dc:publisher><xsl:value-of select="."/></dc:publisher>
21
    </xsl:template>
22
    
23
    <!-- classname of instanceType for dataset is currently UNKNOWN and we want to skip it -->
24
    <xsl:template match="oaf:result/resulttype | instanceType[./@classname!='Unknown'] | resourceType[./@classname != '']">
25
        <dc:type xml:lang="eng"><xsl:value-of select="./@classname"/></dc:type>
26
    </xsl:template>
27
    
28
    <xsl:template match="language[./@classid != '']">
29
        <dc:language><xsl:value-of select="./@classid"/></dc:language>
30
    </xsl:template>
31
    
32
    <xsl:template match="description">
33
        <dc:description><xsl:value-of select="."/></dc:description>
34
    </xsl:template>
35
    
36
    <xsl:template match="source | collectedFrom/@name">
37
        <dc:source><xsl:value-of select="."/></dc:source>
38
    </xsl:template>
39
    
40
    <xsl:template match="oaf:result/title">
41
        <dc:title><xsl:value-of select="."/></dc:title>
42
    </xsl:template>
43
    
44
    <xsl:template match="oaf:result/dateofacceptance">
45
        <dc:date><xsl:value-of select="concat('date of acceptance: ', .)"/></dc:date>
46
    </xsl:template>
47
    
48
    <xsl:template match="oaf:result/embargoenddate">
49
        <dc:date><xsl:value-of select="concat('end of embargo: ', .)"/></dc:date>
50
    </xsl:template>
51
    
52
    <xsl:template match="format">
53
        <dc:format><xsl:value-of select="."/></dc:format>
54
    </xsl:template>
55
    
56
    <xsl:template match="originalId | pid">
57
        <dc:identifier><xsl:value-of select="."/></dc:identifier>
58
    </xsl:template>
59
    
60
    <xsl:template match="bestlicense">
61
        <dc:rights><xsl:value-of select="./@classname"/></dc:rights>
62
    </xsl:template>
63
    
64
    <xsl:template match="rel[./to/@class='author']">
65
        <dc:creator><xsl:value-of select="./fullname"/></dc:creator>
66
    </xsl:template>
67
    
68
    <xsl:template match="rel[./to/@class='contributor']">
69
        <dc:contributor><xsl:value-of select="./fullname"/></dc:contributor>
70
    </xsl:template>
71
    
72
    <xsl:template match="rel[./to/@class='isResultOf']">
73
        <dc:relation><xsl:value-of select="concat(./acronym, ', grant id: ', ./code)"/></dc:relation>
74
    </xsl:template>
75
    
76
    <!-- Links from dataset to publications: only title and openaire identifiers are available...would be better to have the original id, or a pid...-->
77
    <xsl:template match="rel[/to/@class='isRelatedTo']">
78
        <dc:relation><xsl:value-of select="./to"/></dc:relation>
79
        <dc:relation><xsl:value-of select="./title"/></dc:relation>
80
    </xsl:template>
81
    
82
    <xsl:template match="context | category | concept">
83
        <dc:relation><xsl:value-of select="./@label"/></dc:relation>
84
    </xsl:template>
85
    
86
    <xsl:template match="webresource/url">
87
        <dc:identifier><xsl:value-of select="."/></dc:identifier>
88
    </xsl:template>
89
    
90
    <!-- Override default template -->
91
    <xsl:template match="text()|@*">
92
    </xsl:template>
93

    
94
</xsl:stylesheet>
    (1-1/1)