Project

General

Profile

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:dri="http://www.driver-repository.eu/namespace/dri" 
8
    xmlns:dli="http://www.dli.eu"
9
    exclude-result-prefixes="xsl datetime dnet exslt">
10
    <!--  " -->  
11
    <xsl:param name="repositoryId" />
12
    <xsl:param name="namespacePrefix"></xsl:param>
13
    <xsl:param name="dataprovider_id"></xsl:param>
14
    
15
    <xsl:variable name="id" select="//*[local-name()='dataset']/@doi"></xsl:variable>   
16
    <xsl:variable name="doitype" select="//*[local-name()='column' and ./@name='db']"></xsl:variable>
17
    <xsl:variable name="dnetId" select="concat('doi','::',$id)"></xsl:variable>  
18
    <xsl:template match="/">
19
        <oai:record xmlns="http://namespace.openaire.eu/"
20
            xmlns:dc="http://purl.org/dc/elements/1.1/"
21
            xmlns:dr="http://www.driver-repository.eu/namespace/dr"
22
            xmlns:prov="http://www.openarchives.org/OAI/2.0/provenance"
23
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
24
            
25
            <oai:header> 
26
                <xsl:if test=" string-length(normalize-space($id)) &gt; 0">
27
                    <dri:objIdentifier><xsl:value-of select="concat($namespacePrefix,'::', dnet:md5($dnetId))"/></dri:objIdentifier>
28
                </xsl:if>               
29
                
30
                <dri:recordIdentifier><xsl:value-of select="$id"/></dri:recordIdentifier>
31
                <dri:dateOfCollection><xsl:value-of select="datetime:dateTime()"/></dri:dateOfCollection>
32
                <dri:repositoryId><xsl:value-of select="$dataprovider_id"/></dri:repositoryId>
33
                <dri:datasourceprefix><xsl:value-of select="$namespacePrefix"/></dri:datasourceprefix>                
34
            </oai:header>
35
            <metadata>
36
                <dli:dliObject>
37
                    <dnetResourceIdentifier><xsl:value-of select="concat($namespacePrefix,'::', dnet:md5($dnetId))"/></dnetResourceIdentifier>
38
                    <localIdentifier>
39
                        <xsl:attribute name="type">doi</xsl:attribute>                        
40
                        <xsl:value-of select="$id"/>
41
                    </localIdentifier>               
42
                    <objectType>dataset</objectType>                    
43
                    <provenance>
44
                        <datasource completionStatus="incomplete" provisionMode="collected"><xsl:value-of select="$namespacePrefix"/></datasource>
45
                    </provenance>
46
                    <completionStatus>incomplete</completionStatus>
47
                    <relations>
48
                        <xsl:for-each select="//*[local-name()='link']">
49
                            <relation>
50
                                <pid type="uri"><xsl:value-of select="./@uri"/></pid>
51
                                <typeOfRelation>unknown</typeOfRelation>
52
                            </relation>    
53
                        </xsl:for-each>                        
54
                    </relations>
55
                </dli:dliObject>                
56
            </metadata>           
57
        </oai:record>
58
    </xsl:template>    
59
</xsl:stylesheet>
(3-3/7)