Index: modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/funders/anr2db.xml
===================================================================
--- modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/funders/anr2db.xml	(revision 60328)
+++ modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/funders/anr2db.xml	(revision 60329)
@@ -23,25 +23,27 @@
     <xsl:variable name="funderID" select="concat($namespacePrefix, '::ANR')"/>
 
     <!--<xsl:variable name="fundingId">
-        <xsl:value-of
-            select="concat($funderID, '::', translate(.//column[@name = 'FUNDING STREAM'], ' ', ''))"
-        />
-    </xsl:variable>
-    -->
+<xsl:value-of
+select="concat($funderID, '::', translate(.//column[@name = 'FUNDING STREAM'], ' ', ''))"
+/>
+</xsl:variable>
+-->
     <xsl:variable name="fundingId">
         <xsl:value-of select="$funderID"/>
     </xsl:variable>
     <xsl:variable name="quot">"</xsl:variable>
+    <xsl:variable name="dollaro">$</xsl:variable>
     <xsl:variable name="Id">
-        <xsl:value-of select="normalize-space(.//column[@isID='true'])"/>
+        <xsl:value-of select="normalize-space(.//column[@isID = 'true'])"/>
     </xsl:variable>
     <xsl:template name="terminate">
-        <xsl:message terminate="yes"> record is not compliant, transformation is
-            interrupted. </xsl:message>
+        <xsl:message terminate="yes"> record is not compliant, transformation is interrupted.
+        </xsl:message>
     </xsl:template>
     <xsl:template match="/">
         <xsl:choose>
-            <xsl:when test=".//column[@name = 'TitreUk (SIM et autres sources complémentaires)'] | .//column[@name = 'TitreFr (SIM et autres sources complémentaires)'] | .//column[@name = 'Projet Nom Complet'] | .//column[@name = 'Acronyme (SIM)'] | .//column[@name = 'Acronyme']">
+            <xsl:when
+                test=".//column[@name = 'Titre.Francais'] | .//column[@name = 'Titre.Anglais'] | .//column[@name = 'Acronyme']">
                 <record>
 
                     <xsl:copy-of select=".//*[local-name() = 'header']"/>
@@ -51,10 +53,10 @@
                             <xsl:variable name="projectId"
                                 select="concat($namespacePrefix, '::', $Id)"/>
                             <!-- <xsl:variable name="startDate"
-                        select="replace(.//column[@name = 'PROJECT STARTING DATE'], '/', '-')"/>
-                    <xsl:variable name="endDate"
-                        select="replace(.//column[@name = 'PROJECT COMPLETION DATE'], '/', '-')"/>
-                   -->
+select="replace(.//column[@name = 'PROJECT STARTING DATE'], '/', '-')"/>
+<xsl:variable name="endDate"
+select="replace(.//column[@name = 'PROJECT COMPLETION DATE'], '/', '-')"/>
+-->
 
                             <ROW table="projects">
                                 <FIELD name="_dnet_resource_identifier_">
@@ -64,28 +66,30 @@
                                     <xsl:value-of select="$projectId"/>
                                 </FIELD>
                                 <FIELD name="code">
-                                    <xsl:value-of
-                                        select="$Id"/>
+                                    <xsl:value-of select="$Id"/>
                                 </FIELD>
                                 <xsl:choose>
-                                    <xsl:when test=".//column[@name = 'TitreUk (SIM et autres sources complémentaires)']">
+                                    <xsl:when
+                                        test=".//column[@name = 'Titre.Anglais']">
                                         <FIELD name="title">
-                                            <xsl:value-of select=".//column[@name = 'TitreUk (SIM et autres sources complémentaires)']"/>
+                                            <xsl:value-of
+                                                select=".//column[@name = 'Titre.Anglais']"
+                                            />
                                         </FIELD>
                                     </xsl:when>
-                                    <xsl:when test=".//column[@name = 'TitreFr (SIM et autres sources complémentaires)']">
+                                    <xsl:when
+                                        test=".//column[@name = 'Titre.Francais']">
                                         <FIELD name="title">
-                                            <xsl:value-of select=".//column[@name = 'TitreFr (SIM et autres sources complémentaires)']"/>
+                                            <xsl:value-of
+                                                select=".//column[@name = 'Titre.Francais']"
+                                            />
                                         </FIELD>
                                     </xsl:when>
-                                     <xsl:when test=".//column[@name = 'Projet Nom Complet']">
-                                        <FIELD name="title">
-                                            <xsl:value-of select=".//column[@name = 'Projet Nom Complet']"/>
-                                        </FIELD>
-                                    </xsl:when>
                                     <xsl:otherwise>
                                         <FIELD name="title">
-                                            <xsl:value-of select=".//column[@name = 'Acronyme (SIM)'] | .//column[@name = 'Acronyme']"/>
+                                            <xsl:value-of
+                                                select=".//column[@name = 'Acronyme']"
+                                            />
                                         </FIELD>
                                     </xsl:otherwise>
                                 </xsl:choose>
@@ -92,15 +96,44 @@
 
 
                                 <FIELD name="acronym">
-                                    <xsl:value-of select=".//column[@name = 'Acronyme (SIM)'] | .//column[@name = 'Acronyme']"/>
+                                    <xsl:value-of
+                                        select=".//column[@name = 'Acronyme (SIM)'] | .//column[@name = 'Acronyme']"
+                                    />
                                 </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>-->
+<xsl:value-of select="$startDate"/>
+</FIELD>
+<FIELD name="enddate" type="date" format="{$dateFormat}">
+<xsl:value-of select="$endDate"/>
+</FIELD>-->                     <xsl:if test=".//column[@name = 'Responsable_scientifique']">
+                                    <FIELD name ="contactfullname">
+                                        <xsl:value-of select="normalize-space(.//column[@name='Responsable_scientifique'])"/>
+                                   </FIELD>
+                                </xsl:if>
 
+                                <xsl:if test=".//column[@name = 'Aide_allouee']">
+                                    <FIELD name="fundedamount" type="float">
+
+                                        <xsl:value-of select=".//column[@name = 'Aide_allouee']"/>
+                                </FIELD>
+                                <FIELD name="currency">
+                                <xsl:value-of select="string('EUR')"/>
+                                </FIELD>
+                                </xsl:if>
+                                <xsl:if test=".//column[@name = 'Resume.Francais'] or .//column[@name = 'Resume.Anglais']">
+                                    <xsl:choose>
+                                        <xsl:when test=".//column[@name = 'Resume.Anglais']">
+                                            <FIELD name="summary">
+                                                <xsl:value-of select=".//column[@name = 'Resume.Anglais']"/>
+                                            </FIELD>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                            <FIELD name="summary">
+                                                <xsl:value-of select=".//column[@name = 'Resume.Francais']"/>
+                                            </FIELD>
+                                        </xsl:otherwise>
+                                    </xsl:choose>
+                                </xsl:if>
                                 <FIELD name="collectedfrom">
                                     <xsl:value-of select="$varDataSourceId"/>
                                 </FIELD>
@@ -107,9 +140,114 @@
                                 <FIELD name="provenanceactionclass"
                                     >sysimport:crosswalk:entityregistry</FIELD>
                                 <FIELD name="provenanceactionscheme">dnet:provenanceActions</FIELD>
-                                <FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
-                                <FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
+                                <FIELD name="oa_mandate_for_publications" type="boolean"
+                                    >false</FIELD>
+                                <FIELD name="lastupdate" type="date">
+                                    <xsl:value-of select="current-dateTime()"/>
+                                </FIELD>
                             </ROW>
+                            <xsl:if test=".//column[@name = 'Partenaire.Coordinature']">
+                                <xsl:variable name="Coord">
+                                    <xsl:value-of select="utils:md5(.//column[@name = 'Partenaire.Coordinature'])"/>
+                                </xsl:variable>
+                                <xsl:variable name="organizationId" >
+                                    <xsl:value-of select="concat($namespacePrefix, '::', $Coord)"/>
+                                </xsl:variable>
+                                <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="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
+
+                                    <FIELD name="legalname">
+                                        <xsl:value-of select=".//column[@name = 'Partenaire.Coordinature']"/>
+                                    </FIELD>
+
+                                    <FIELD name="collectedfrom">
+                                        <xsl:value-of select="$varDataSourceId"/>
+                                    </FIELD>
+                                    <FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
+                                    <FIELD name="trust" type="float">
+                                        <xsl:value-of select="0.81"/>
+                                    </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>
+                            </xsl:if>
+
+                            <xsl:if test=".//column[@name = 'Partenaire.Nom_organisme']">
+                                <xsl:for-each select="tokenize(.//column[@name = 'Partenaire.Nom_organisme'],'@')">
+                                    <xsl:if test="string-length(.) > 0">
+                                        <xsl:variable name="organizationId" >
+                                            <xsl:value-of select="concat($namespacePrefix, '::', utils:md5(.))"/>
+                                        </xsl:variable>
+                                        <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="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
+
+                                            <FIELD name="legalname">
+                                                <xsl:value-of select="."/>
+                                            </FIELD>
+
+                                            <FIELD name="collectedfrom">
+                                                <xsl:value-of select="$varDataSourceId"/>
+                                            </FIELD>
+                                            <FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
+                                            <FIELD name="trust" type="float">
+                                                <xsl:value-of select="0.81"/>
+                                            </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">participant</FIELD>
+
+                                        </ROW>
+                                    </xsl:if>
+                                </xsl:for-each>
+
+
+                            </xsl:if>
+
+
                             <ROW table="project_fundingpath">
                                 <FIELD name="_dnet_resource_identifier_">
                                     <xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
@@ -133,12 +271,13 @@
                 </record>
             </xsl:when>
             <xsl:otherwise>
-                <xsl:call-template name="terminate"></xsl:call-template>
+                <xsl:call-template name="terminate"/>
             </xsl:otherwise>
         </xsl:choose>
 
     </xsl:template>
 </xsl:stylesheet>
+
 ]]>
                 </CODE>
             </SCRIPT>
