1 |
26600
|
sandro.lab
|
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
|
|
<xsl:stylesheet version="1.0"
|
3 |
|
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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/" xmlns:dnet="eu.dnetlib.data.transform.xml.DataciteToHbaseXsltFunctions"
|
6 |
|
|
xmlns:oaf="http://namespace.openaire.eu/oaf"
|
7 |
|
|
exclude-result-prefixes="xsl datetime exslt xsi" xmlns:dri="http://www.driver-repository.eu/namespace/dri">
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
<xsl:param name="datasourceId" />
|
11 |
|
|
<xsl:param name="namespacePrefix"/>
|
12 |
|
|
<xsl:output method="xml" version="1.0"
|
13 |
|
|
encoding="UTF-8" indent="yes"/>
|
14 |
|
|
|
15 |
|
|
<xsl:variable name="identifier" select="//column[./@isID='true']"></xsl:variable>
|
16 |
|
|
|
17 |
|
|
<xsl:template match="csvRecord">
|
18 |
|
|
<oai:record >
|
19 |
|
|
<header xmlns:dri="http://www.driver-repository.eu/namespace/dri">
|
20 |
|
|
<dri:objIdentifier>
|
21 |
|
|
<xsl:value-of select="concat($namespacePrefix, '::', dnet:md5($identifier))" />
|
22 |
|
|
</dri:objIdentifier>
|
23 |
|
|
<dri:recordIdentifier>
|
24 |
|
|
<xsl:value-of select="$identifier" />
|
25 |
|
|
</dri:recordIdentifier>
|
26 |
|
|
<dri:dateOfCollection>
|
27 |
|
|
<xsl:value-of select="datetime:dateTime()" />
|
28 |
|
|
</dri:dateOfCollection>
|
29 |
|
|
<dri:repositoryId>
|
30 |
|
|
<xsl:value-of select="$datasourceId" />
|
31 |
|
|
</dri:repositoryId>
|
32 |
|
|
<oaf:datasourceprefix>
|
33 |
|
|
<xsl:value-of select="$namespacePrefix"/>
|
34 |
|
|
</oaf:datasourceprefix>
|
35 |
|
|
</header>
|
36 |
|
|
<metadata>
|
37 |
|
|
<xsl:call-template name="copyAll"></xsl:call-template>
|
38 |
|
|
</metadata>
|
39 |
|
|
</oai:record>
|
40 |
|
|
</xsl:template>
|
41 |
|
|
|
42 |
|
|
<xsl:template name="copyAll" match="@*|*">
|
43 |
|
|
<xsl:copy>
|
44 |
|
|
<xsl:apply-templates select="@*|*|text()" />
|
45 |
|
|
</xsl:copy>
|
46 |
|
|
</xsl:template>
|
47 |
|
|
|
48 |
|
|
</xsl:stylesheet>
|