1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER value="fdc19de8-87b2-487b-8ad0-d6217ec11b1d_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
4
|
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
|
5
|
<RESOURCE_KIND value="TransformationRuleDSResources"/>
|
6
|
<RESOURCE_URI value=""/>
|
7
|
<DATE_OF_CREATION value="2018-11-23T11:15:30+00:00"/>
|
8
|
</HEADER>
|
9
|
<BODY>
|
10
|
<CONFIGURATION>
|
11
|
<IMPORTED/>
|
12
|
<SCRIPT>
|
13
|
<TITLE>RIF to DB</TITLE>
|
14
|
<CODE><![CDATA[
|
15
|
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
16
|
xmlns:utils="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions">
|
17
|
|
18
|
<xsl:param name="varDataSourceId"/>
|
19
|
<xsl:variable name="namespacePrefix" select="string('rif_________')"/>
|
20
|
|
21
|
<xsl:variable name="dateFormat" select="string('dd-MM-yyyy')"/>
|
22
|
<xsl:variable name="funderID" select="concat($namespacePrefix, '::RIF')"/>
|
23
|
|
24
|
<xsl:variable name="fundingId">
|
25
|
<xsl:value-of
|
26
|
select="concat($funderID, '::', translate(.//column[@name = 'FUNDING STREAM'], ' ', ''))"
|
27
|
/>
|
28
|
</xsl:variable>
|
29
|
<xsl:variable name="quot">"</xsl:variable>
|
30
|
|
31
|
<xsl:template match="/">
|
32
|
<record>
|
33
|
|
34
|
<xsl:copy-of select=".//*[local-name() = 'header']"/>
|
35
|
|
36
|
<metadata>
|
37
|
<ROWS>
|
38
|
<xsl:variable name="projectId"
|
39
|
select="concat($namespacePrefix, '::', normalize-space(.//column[@name = 'PROJECT IDENTIFIER']))"/>
|
40
|
<xsl:variable name="startDate"
|
41
|
select="replace(.//column[@name = 'PROJECT STARTING DATE'], '/', '-')"/>
|
42
|
<xsl:variable name="endDate"
|
43
|
select="replace(.//column[@name = 'PROJECT COMPLETION DATE'], '/', '-')"/>
|
44
|
|
45
|
|
46
|
<ROW table="projects">
|
47
|
<FIELD name="_dnet_resource_identifier_">
|
48
|
<xsl:value-of select="$projectId"/>
|
49
|
</FIELD>
|
50
|
<FIELD name="id">
|
51
|
<xsl:value-of select="$projectId"/>
|
52
|
</FIELD>
|
53
|
<FIELD name="code">
|
54
|
<xsl:value-of
|
55
|
select="normalize-space(.//column[@name = 'PROJECT IDENTIFIER'])"/>
|
56
|
</FIELD>
|
57
|
<FIELD name="title">
|
58
|
<xsl:value-of select=".//column[@name = 'PROJECT TITLE']"/>
|
59
|
</FIELD>
|
60
|
|
61
|
<FIELD name="acronym">
|
62
|
<xsl:value-of select=".//column[@name = 'PROJECT ACRONYM']"/>
|
63
|
</FIELD>
|
64
|
<FIELD name="startdate" type="date" format="{$dateFormat}">
|
65
|
<xsl:value-of select="$startDate"/>
|
66
|
</FIELD>
|
67
|
<FIELD name="enddate" type="date" format="{$dateFormat}">
|
68
|
<xsl:value-of select="$endDate"/>
|
69
|
</FIELD>
|
70
|
|
71
|
<FIELD name="collectedfrom">
|
72
|
<xsl:value-of select="$varDataSourceId"/>
|
73
|
</FIELD>
|
74
|
<FIELD name="provenanceactionclass"
|
75
|
>sysimport:crosswalk:entityregistry</FIELD>
|
76
|
<FIELD name="provenanceactionscheme">dnet:provenanceActions</FIELD>
|
77
|
<FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
|
78
|
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
|
79
|
</ROW>
|
80
|
<ROW table="project_fundingpath">
|
81
|
<FIELD name="_dnet_resource_identifier_">
|
82
|
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
|
83
|
</FIELD>
|
84
|
<FIELD name="funding">
|
85
|
<xsl:value-of select="$fundingId"/>
|
86
|
</FIELD>
|
87
|
<FIELD name="project">
|
88
|
<xsl:value-of select="$projectId"/>
|
89
|
</FIELD>
|
90
|
<FIELD name="startdate" type="date" format="{$dateFormat}">
|
91
|
<xsl:value-of select="$startDate"/>
|
92
|
</FIELD>
|
93
|
<FIELD name="enddate" type="date" format="{$dateFormat}">
|
94
|
<xsl:value-of select="$endDate"/>
|
95
|
</FIELD>
|
96
|
</ROW>
|
97
|
|
98
|
</ROWS>
|
99
|
</metadata>
|
100
|
</record>
|
101
|
</xsl:template>
|
102
|
</xsl:stylesheet>
|
103
|
|
104
|
]]>
|
105
|
</CODE>
|
106
|
</SCRIPT>
|
107
|
</CONFIGURATION>
|
108
|
<STATUS/>
|
109
|
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
|
110
|
</BODY>
|
111
|
</RESOURCE_PROFILE>
|