1 |
28341
|
katerina.i
|
<xsl:stylesheet xmlns:dc="http://purl.org/dc/elements/1.1/"
|
2 |
|
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
|
3 |
|
|
xmlns:oaf="http://namespace.openaire.eu/oaf" exclude-result-prefixes="oaf"
|
4 |
|
|
version="1.0">
|
5 |
|
|
|
6 |
|
|
<xsl:output indent="yes" method="xml" omit-xml-declaration="yes" />
|
7 |
|
|
<xsl:template match="//oaf:result">
|
8 |
|
|
<oai_dc:dc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
9 |
|
|
<xsl:apply-templates />
|
10 |
|
|
</oai_dc:dc>
|
11 |
|
|
</xsl:template>
|
12 |
|
|
<xsl:template match="subject">
|
13 |
|
|
<dc:subject>
|
14 |
|
|
<xsl:value-of select="." />
|
15 |
|
|
</dc:subject>
|
16 |
|
|
</xsl:template>
|
17 |
|
|
<xsl:template match="oaf:result/publisher">
|
18 |
|
|
<dc:publisher>
|
19 |
|
|
<xsl:value-of select="." />
|
20 |
|
|
</dc:publisher>
|
21 |
|
|
</xsl:template>
|
22 |
|
|
|
23 |
|
|
<!-- classname of instanceType for dataset is currently UNKNOWN and we want
|
24 |
|
|
to skip it -->
|
25 |
|
|
<xsl:template
|
26 |
|
|
match="oaf:result/resulttype | instanceType[./@classname!='Unknown'] | resourceType[./@classname != '']">
|
27 |
|
|
<dc:type xml:lang="eng">
|
28 |
|
|
<xsl:value-of select="./@classname" />
|
29 |
|
|
</dc:type>
|
30 |
|
|
</xsl:template>
|
31 |
|
|
<xsl:template match="language[./@classid != '']">
|
32 |
|
|
<dc:language>
|
33 |
|
|
<xsl:value-of select="./@classid" />
|
34 |
|
|
</dc:language>
|
35 |
|
|
</xsl:template>
|
36 |
|
|
<xsl:template match="description">
|
37 |
|
|
<dc:description>
|
38 |
|
|
<xsl:value-of select="." />
|
39 |
|
|
</dc:description>
|
40 |
|
|
</xsl:template>
|
41 |
|
|
<xsl:template match="source | collectedFrom/@name">
|
42 |
|
|
<dc:source>
|
43 |
|
|
<xsl:value-of select="." />
|
44 |
|
|
</dc:source>
|
45 |
|
|
</xsl:template>
|
46 |
|
|
<xsl:template match="oaf:result/title">
|
47 |
|
|
<dc:title>
|
48 |
|
|
<xsl:value-of select="." />
|
49 |
|
|
</dc:title>
|
50 |
|
|
</xsl:template>
|
51 |
|
|
<xsl:template match="oaf:result/dateofacceptance">
|
52 |
|
|
<dc:date>
|
53 |
|
|
<xsl:value-of select="concat('date of acceptance: ', .)" />
|
54 |
|
|
</dc:date>
|
55 |
|
|
</xsl:template>
|
56 |
|
|
<xsl:template match="oaf:result/embargoenddate">
|
57 |
|
|
<dc:date>
|
58 |
|
|
<xsl:value-of select="concat('end of embargo: ', .)" />
|
59 |
|
|
</dc:date>
|
60 |
|
|
</xsl:template>
|
61 |
|
|
<xsl:template match="format">
|
62 |
|
|
<dc:format>
|
63 |
|
|
<xsl:value-of select="." />
|
64 |
|
|
</dc:format>
|
65 |
|
|
</xsl:template>
|
66 |
|
|
<xsl:template match="originalId | pid">
|
67 |
|
|
<dc:identifier>
|
68 |
|
|
<xsl:value-of select="." />
|
69 |
|
|
</dc:identifier>
|
70 |
|
|
</xsl:template>
|
71 |
|
|
<xsl:template match="bestlicense">
|
72 |
|
|
<dc:rights>
|
73 |
|
|
<xsl:value-of select="./@classname" />
|
74 |
|
|
</dc:rights>
|
75 |
|
|
</xsl:template>
|
76 |
|
|
<xsl:template match="rel[./to/@class='author']">
|
77 |
|
|
<dc:creator>
|
78 |
|
|
<xsl:value-of select="./fullname" />
|
79 |
|
|
</dc:creator>
|
80 |
|
|
</xsl:template>
|
81 |
|
|
<xsl:template match="rel[./to/@class='contributor']">
|
82 |
|
|
<dc:contributor>
|
83 |
|
|
<xsl:value-of select="./fullname" />
|
84 |
|
|
</dc:contributor>
|
85 |
|
|
</xsl:template>
|
86 |
|
|
<xsl:template match="rel[./to/@class='isResultOf']">
|
87 |
|
|
<dc:relation>
|
88 |
|
|
<xsl:value-of select="concat(./acronym, ', grant id: ', ./code)" />
|
89 |
|
|
</dc:relation>
|
90 |
|
|
</xsl:template>
|
91 |
|
|
|
92 |
|
|
<!-- Links from dataset to publications: only title and openaire identifiers
|
93 |
|
|
are available...would be better to have the original id, or a pid... -->
|
94 |
|
|
<xsl:template match="rel[/to/@class='isRelatedTo']">
|
95 |
|
|
<dc:relation>
|
96 |
|
|
<xsl:value-of select="./to" />
|
97 |
|
|
</dc:relation>
|
98 |
|
|
<dc:relation>
|
99 |
|
|
<xsl:value-of select="./title" />
|
100 |
|
|
</dc:relation>
|
101 |
|
|
</xsl:template>
|
102 |
|
|
<xsl:template match="context | category | concept">
|
103 |
|
|
<dc:relation>
|
104 |
|
|
<xsl:value-of select="./@label" />
|
105 |
|
|
</dc:relation>
|
106 |
|
|
</xsl:template>
|
107 |
|
|
<xsl:template match="webresource/url">
|
108 |
|
|
<dc:relation>
|
109 |
|
|
<xsl:value-of select="." />
|
110 |
|
|
</dc:relation>
|
111 |
|
|
</xsl:template>
|
112 |
|
|
|
113 |
|
|
|
114 |
|
|
<!-- Override default template -->
|
115 |
|
|
<xsl:template match="text()|@*" />
|
116 |
|
|
</xsl:stylesheet>
|