Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/"
3
                xmlns:oai="http://www.openarchives.org/OAI/2.0/"
4
                xmlns:datetime="http://exslt.org/dates-and-times"
5
                xmlns:dri="http://www.driver-repository.eu/namespace/dri"
6
                xmlns:oaa="http://namespace.openaire.eu/oaa"
7
                xmlns:oaf="http://namespace.openaire.eu/oaf"
8
                xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:dnet="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions"
9
                xmlns:stringUtils="org.apache.commons.lang.StringUtils"
10
                version="1.0"
11
                exclude-result-prefixes="xsl dc dnet oaa fn stringUtils datetime">
12

    
13
	<xsl:param name="namespacePrefix"/>
14
	<xsl:param name="dataSourceId"/>
15
	<xsl:param name="dataprovider_id"/>
16

    
17
	<xsl:template match="/">
18
		<xsl:variable name="identifier">
19
			<xsl:value-of
20
					select="stringUtils:substringAfter(/*[local-name()='datasetsRecord']/*[local-name()='metadata']/*[local-name()='MetaData']/*[local-name()='citation']/*[local-name()='URI'],'doi:')"
21
			/>
22
		</xsl:variable>
23
		<oai:record>
24
			<oai:header>
25
				<dri:objIdentifier>
26
					<xsl:value-of select="concat($namespacePrefix,'::', dnet:md5($identifier))"/>
27
				</dri:objIdentifier>
28
				<dri:recordIdentifier>
29
					<xsl:value-of select="$identifier"/>
30
				</dri:recordIdentifier>
31
				<dri:dateOfCollection>
32
					<xsl:value-of select="datetime:dateTime()"/>
33
				</dri:dateOfCollection>
34
				<dri:repositoryId>
35
					<xsl:value-of select="$dataSourceId"/>
36
				</dri:repositoryId>
37
				<oaf:datasourceprefix>
38
					<xsl:value-of select="$namespacePrefix"/>
39
				</oaf:datasourceprefix>
40
				<dri:repositoryId>
41
					<xsl:value-of select="$dataprovider_id"/>
42
				</dri:repositoryId>
43
			</oai:header>
44
			<oai:metadata>
45
				<xsl:copy-of select="."/>
46
			</oai:metadata>
47
		</oai:record>
48

    
49
	</xsl:template>
50
</xsl:stylesheet>
(2-2/3)