Revision 53944
Added by Miriam Baglioni over 5 years ago
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/funders/rpf2db.xml | ||
---|---|---|
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>RPF 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('rpf_________')"/> |
|
20 |
|
|
21 |
<xsl:variable name="dateFormat" select="string('MM-dd-yy')"/> |
|
22 |
<xsl:variable name="funderID" select="concat($namespacePrefix, '::RPF')"/> |
|
23 |
|
|
24 |
<xsl:variable name="quot">"</xsl:variable> |
|
25 |
|
|
26 |
<xsl:template match="/"> |
|
27 |
<record> |
|
28 |
|
|
29 |
<xsl:copy-of select=".//*[local-name() = 'header']"/> |
|
30 |
|
|
31 |
<metadata> |
|
32 |
<ROWS> |
|
33 |
<xsl:variable name="projectId" |
|
34 |
select="concat($namespacePrefix, '::', normalize-space(.//column[@name = 'PROJECT IDENTIFIER']))"/> |
|
35 |
<xsl:variable name="startDate" |
|
36 |
select="replace(.//column[@name = 'PROJECT STARTING DATE'], '/', '-')"/> |
|
37 |
<xsl:variable name="endDate" |
|
38 |
select="replace(.//column[@name = 'PROJECT COMPLETION DATE'], '/', '-')"/> |
|
39 |
|
|
40 |
|
|
41 |
<ROW table="projects"> |
|
42 |
<FIELD name="_dnet_resource_identifier_"> |
|
43 |
<xsl:value-of select="$projectId"/> |
|
44 |
</FIELD> |
|
45 |
<FIELD name="id"> |
|
46 |
<xsl:value-of select="$projectId"/> |
|
47 |
</FIELD> |
|
48 |
<FIELD name="code"> |
|
49 |
<xsl:value-of |
|
50 |
select="normalize-space(.//column[@name = 'PROJECT IDENTIFIER'])"/> |
|
51 |
</FIELD> |
|
52 |
<FIELD name="title"> |
|
53 |
<xsl:value-of select=".//column[@name = 'PROJECT TITLE']"/> |
|
54 |
</FIELD> |
|
55 |
<xsl:if test=".//column[@name = 'PROJECT ACRONYM']!=''"> |
|
56 |
<FIELD name="acronym"> |
|
57 |
<xsl:value-of select=".//column[@name = 'PROJECT ACRONYM']"/> |
|
58 |
</FIELD></xsl:if> |
|
59 |
<FIELD name="startdate" type="date" format="{$dateFormat}"> |
|
60 |
<xsl:value-of select="$startDate"/> |
|
61 |
</FIELD> |
|
62 |
<FIELD name="enddate" type="date" format="{$dateFormat}"> |
|
63 |
<xsl:value-of select="$endDate"/> |
|
64 |
</FIELD> |
|
65 |
|
|
66 |
<FIELD name="collectedfrom"> |
|
67 |
<xsl:value-of select="$varDataSourceId"/> |
|
68 |
</FIELD> |
|
69 |
<FIELD name="provenanceactionclass" |
|
70 |
>sysimport:crosswalk:entityregistry</FIELD> |
|
71 |
<FIELD name="provenanceactionscheme">dnet:provenanceActions</FIELD> |
|
72 |
<FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD> |
|
73 |
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD> |
|
74 |
</ROW> |
|
75 |
<ROW table="project_fundingpath"> |
|
76 |
<FIELD name="_dnet_resource_identifier_"> |
|
77 |
<xsl:value-of select="concat($funderID, '@@', $projectId)"/> |
|
78 |
</FIELD> |
|
79 |
<FIELD name="funding"> |
|
80 |
<xsl:value-of select="$funderID"/> |
|
81 |
</FIELD> |
|
82 |
<FIELD name="project"> |
|
83 |
<xsl:value-of select="$projectId"/> |
|
84 |
</FIELD> |
|
85 |
<FIELD name="startdate" type="date" format="{$dateFormat}"> |
|
86 |
<xsl:value-of select="$startDate"/> |
|
87 |
</FIELD> |
|
88 |
<FIELD name="enddate" type="date" format="{$dateFormat}"> |
|
89 |
<xsl:value-of select="$endDate"/> |
|
90 |
</FIELD> |
|
91 |
</ROW> |
|
92 |
|
|
93 |
</ROWS> |
|
94 |
</metadata> |
|
95 |
</record> |
|
96 |
</xsl:template> |
|
97 |
</xsl:stylesheet> |
|
98 |
|
|
99 |
]]> |
|
100 |
</CODE> |
|
101 |
</SCRIPT> |
|
102 |
</CONFIGURATION> |
|
103 |
<STATUS/> |
|
104 |
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS> |
|
105 |
</BODY> |
|
106 |
</RESOURCE_PROFILE> |
Also available in: Unified diff
transormation for new RPF funder