Index: modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/funders/rsf2db.xml
===================================================================
--- modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/funders/rsf2db.xml	(nonexistent)
+++ modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/funders/rsf2db.xml	(revision 57243)
@@ -0,0 +1,164 @@
+<RESOURCE_PROFILE>
+    <HEADER>
+        <RESOURCE_IDENTIFIER value="ace59c22-1c4d-4c9e-8bc6-52bcb6e0726c_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
+        <RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
+        <RESOURCE_KIND value="TransformationRuleDSResources"/>
+        <RESOURCE_URI value=""/>
+        <DATE_OF_CREATION value="2019-09-26T15:17:56+02:00"/>
+    </HEADER>
+    <BODY>
+        <CONFIGURATION>
+            <IMPORTED/>
+            <SCRIPT>
+                <TITLE>RSF to DB</TITLE>
+                <CODE><![CDATA[
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:utils="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions"
+    exclude-result-prefixes="xs" version="2.0">
+
+     <xsl:param name="varDataSourceId"/>
+
+    <xsl:param name="quote">"</xsl:param>
+ <xsl:variable name="namespacePrefix" select="string('rsf_________')"/>
+    <xsl:variable name="funderID" select="concat($namespacePrefix, '::RSF')"/>
+
+
+    <!--<xsl:variable name="stream" select="normalize-space(.//column[@name='FUNDING STREAM(S)'])"/>-->
+    <xsl:variable name="fundingID">
+
+                <xsl:value-of select="$funderID"/>
+    </xsl:variable>
+
+    <xsl:variable name="projectId" select="concat($namespacePrefix, '::',  normalize-space(.//column[@name='Project Number']))"/>
+
+    <xsl:variable name="fundingPeriod" select="tokenize(.//column[@name='Implementation period'],'-')"/>
+    <xsl:variable name="startDate" select="normalize-space(.//column[@name='Start Date'])"/>
+    <xsl:variable name="endDate" select="normalize-space(.//column[@name='End Date'])"/>
+
+    <xsl:variable name="dateFormat" select="string('YYYY')"/>
+    <xsl:variable name="projectTitle" select="normalize-space(.//column[@name='Project title'])"/>
+
+    <xsl:template match="/">
+
+
+
+        <record>
+
+            <xsl:copy-of select=".//*[local-name()='header']"/>
+            <metadata>
+                <xsl:if test="string-length($projectTitle) &gt; 0 and string-length($projectId) &gt; 0">
+                <ROWS>
+
+                        <ROW table="projects">
+                            <FIELD name="_dnet_resource_identifier_">
+                                <xsl:value-of select="$projectId"/>
+                            </FIELD>
+                            <FIELD name="id">
+                                <xsl:value-of select="$projectId"/>
+                            </FIELD>
+                            <FIELD name="code">
+                                <xsl:value-of select="$projectId"/>
+                            </FIELD>
+                            <FIELD name="startdate" type="date" format="{$dateFormat}">
+                                <xsl:value-of select="$startDate"/>
+                            </FIELD>
+                            <FIELD name="enddate" type="date" format="{$dateFormat}">
+                                <xsl:value-of select="$endDate"/>
+                            </FIELD>
+                            <FIELD name="title">
+                                <xsl:value-of select="$projectTitle"/>
+                            </FIELD>
+                            <!-- <FIELD name="call_identifier">
+                                <xsl:value-of select=".//column[@name='Research area']"/>
+                            </FIELD> -->
+                            <FIELD name="contactfullname">
+                                <xsl:value-of select=".//column[@name='Project Lead']"/>
+                            </FIELD>
+                           <!-- <FIELD name="amount"> it was optional1 before
+                                <xsl:value-of select="concat(.//column[@name='Funding'], ' €')"/>
+                            </FIELD> -->
+                            <FIELD name="summary">
+                                <xsl:value-of select=".//column[@name='Annotation']"/>
+                            </FIELD>
+                            <FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
+                            <FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
+                            <FIELD name="collectedfrom">
+                                <xsl:value-of select="$varDataSourceId"/>
+                            </FIELD>
+
+                            <FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
+
+                        </ROW>
+
+
+
+                        <ROW table="project_fundingpath">
+                            <FIELD name="_dnet_resource_identifier_">
+                                <xsl:value-of select="concat($fundingID,'@@', $projectId)"/>
+                            </FIELD>
+                            <FIELD name="funding">
+                                <xsl:value-of select="$fundingID"/>
+                            </FIELD>
+                            <FIELD name="project">
+                                <xsl:value-of select="$projectId"/>
+                            </FIELD>
+                            <FIELD name="startdate" type="date" format="{$dateFormat}">
+                                <xsl:value-of select="$startDate"/>
+                            </FIELD>
+                            <FIELD name="enddate" type="date" format="{$dateFormat}">
+                                <xsl:value-of select="$endDate"/>
+                            </FIELD>
+                        </ROW>
+                    <xsl:variable name="organizationId" select="concat($namespacePrefix,'::',utils:md5(normalize-space(.//column[@name='Affiliation'])))"/>
+                    <ROW table = "dsm_organizations">
+                        <FIELD name="_dnet_resource_identifier_">
+                            <xsl:value-of select="$organizationId"/>
+                        </FIELD>
+                        <FIELD name="id">
+                            <xsl:value-of select="$organizationId"/>
+                        </FIELD>
+                        <FIELD name="legalname">
+         <xsl:choose>
+                                <xsl:when test="string-length(normalize-space(.//column[@name='Affiliation'])) > 255">
+                                    <xsl:value-of select="substring(normalize-space(.//column[@name='Affiliation']),0,254)"/>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    <xsl:value-of select="normalize-space(.//column[@name='Affiliation'])"/>
+                                </xsl:otherwise>
+                            </xsl:choose>
+                        </FIELD>
+                        <FIELD name="collectedfrom">
+                            <xsl:value-of select="$varDataSourceId"/>
+                        </FIELD>
+                            <FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
+                            <FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
+                    </ROW>
+                    <ROW table="project_organization">
+                        <FIELD name="_dnet_resource_identifier_">
+                            <xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
+                        </FIELD>
+                        <FIELD name="project">
+                            <xsl:value-of select="$projectId"/>
+                        </FIELD>
+                        <FIELD name="resporganization">
+                            <xsl:value-of select="$organizationId"/>
+                        </FIELD>
+
+                    <FIELD name="semanticclass">coordinator</FIELD>
+                    </ROW>
+                </ROWS>
+                </xsl:if>
+            </metadata>
+        </record>
+
+    </xsl:template>
+</xsl:stylesheet>
+                ]]>
+
+                </CODE>
+            </SCRIPT>
+        </CONFIGURATION>
+        <STATUS/>
+        <SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
+    </BODY>
+</RESOURCE_PROFILE>
\ No newline at end of file
