1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
3
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
4
|
xmlns:datetime="http://exslt.org/dates-and-times" xmlns:exslt="http://exslt.org/common"
|
5
|
xmlns:oai="http://www.openarchives.org/OAI/2.0/"
|
6
|
xmlns:dnet="eu.dnetlib.miscutils.functional.xml.DnetXsltFunctions"
|
7
|
xmlns:oaf="http://namespace.openaire.eu/oaf"
|
8
|
exclude-result-prefixes="xsl datetime exslt dnet"
|
9
|
xmlns:dri="http://www.driver-repository.eu/namespace/dri">
|
10
|
|
11
|
<xsl:template match="/">
|
12
|
<oai:record xmlns="http://namespace.openaire.eu/"
|
13
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
14
|
xmlns:dr="http://www.driver-repository.eu/namespace/dr"
|
15
|
xmlns:prov="http://www.openarchives.org/OAI/2.0/provenance"
|
16
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
17
|
|
18
|
<oai:header>
|
19
|
<xsl:if test="not(.//dri:objIdentifier)">
|
20
|
<dri:objIdentifier><xsl:value-of select="concat('$namespacePrefix$::', dnet:md5($xpath$))"/></dri:objIdentifier>
|
21
|
</xsl:if>
|
22
|
<xsl:if test="not(.//dri:recordIdentifier)">
|
23
|
<dri:recordIdentifier><xsl:value-of select="xpath"/></dri:recordIdentifier>
|
24
|
</xsl:if>
|
25
|
<xsl:if test="not(.//dri:dateOfCollection)">
|
26
|
<dri:dateOfCollection><xsl:value-of select="datetime:dateTime()"/></dri:dateOfCollection>
|
27
|
</xsl:if>
|
28
|
<xsl:if test="not(.//dri:repositoryId)">
|
29
|
<dri:repositoryId>$datasourceId$</dri:repositoryId>
|
30
|
</xsl:if>
|
31
|
<xsl:if test="not(.//oaf:datasourceprefix)">
|
32
|
<oaf:datasourceprefix>$namespacePrefix$</oaf:datasourceprefix>
|
33
|
</xsl:if>
|
34
|
|
35
|
<xsl:for-each select="/*[local-name() = 'record']/*[local-name() = 'header']/*">
|
36
|
<xsl:copy-of select="."/>
|
37
|
</xsl:for-each>
|
38
|
</oai:header>
|
39
|
<xsl:choose>
|
40
|
<xsl:when test="count(/*[local-name() = 'record']/*[local-name() = 'metadata']) > 0">
|
41
|
<xsl:copy-of select="/*[local-name() = 'record']/*[local-name() = 'metadata']"/>
|
42
|
</xsl:when>
|
43
|
<xsl:otherwise>
|
44
|
<oai:metadata>
|
45
|
<xsl:copy-of select="."/>
|
46
|
</oai:metadata>
|
47
|
</xsl:otherwise>
|
48
|
</xsl:choose>
|
49
|
<about>
|
50
|
<oaf:datainfo>
|
51
|
<oaf:inferred>$inferred$</oaf:inferred>
|
52
|
<oaf:deletedbyinference>$deletedbyinference$</oaf:deletedbyinference>
|
53
|
<oaf:trust>$trust$</oaf:trust>
|
54
|
<oaf:inferenceprovenance>$inferenceprovenance$</oaf:inferenceprovenance>
|
55
|
<oaf:provenanceaction schemename="dnet:provenanceActions" schemeid="dnet:provenanceActions" classname="$provenanceactionclassname$" classid="$provenanceactionclassid$"/>
|
56
|
</oaf:datainfo>
|
57
|
</about>
|
58
|
</oai:record>
|
59
|
</xsl:template>
|
60
|
|
61
|
</xsl:stylesheet>
|