Revision 60427
Added by Miriam Baglioni about 3 years ago
anr2db.xml | ||
---|---|---|
40 | 40 |
<xsl:message terminate="yes"> record is not compliant, transformation is interrupted. |
41 | 41 |
</xsl:message> |
42 | 42 |
</xsl:template> |
43 |
|
|
44 |
<xsl:template name="orgPid"> |
|
45 |
<xsl:param name="organizationPidList"/> |
|
46 |
<xsl:param name="position"/> |
|
47 |
<xsl:param name="organizationId"/> |
|
48 |
<xsl:if test="$organizationPidList[$position]"> |
|
49 |
<xsl:variable name="organizationPid" |
|
50 |
select="concat('RNSR:', $organizationPidList[$position])"/> |
|
51 |
<xsl:variable name="organizationPidType" select="'RNSR'"/> |
|
52 |
<ROW table="dsm_identities"> |
|
53 |
<FIELD name="_dnet_resource_identifier_"> |
|
54 |
<xsl:value-of select="concat($organizationPid, '@@', $organizationPidType)"/> |
|
55 |
</FIELD> |
|
56 |
<FIELD name="pid"> |
|
57 |
<xsl:value-of select="$organizationPid"/> |
|
58 |
</FIELD> |
|
59 |
<FIELD name="issuertype"> |
|
60 |
<xsl:value-of select="$organizationPidType"/> |
|
61 |
</FIELD> |
|
62 |
</ROW> |
|
63 |
<ROW table="dsm_organizationpids"> |
|
64 |
<FIELD name="organization"> |
|
65 |
<xsl:value-of select="$organizationId"/> |
|
66 |
</FIELD> |
|
67 |
<FIELD name="_dnet_resource_identifier_"> |
|
68 |
<xsl:value-of select="concat($organizationPid, '@@', $organizationId)"/> |
|
69 |
</FIELD> |
|
70 |
<FIELD name="pid"> |
|
71 |
<xsl:value-of select="$organizationPid"/> |
|
72 |
</FIELD> |
|
73 |
</ROW> |
|
74 |
</xsl:if> |
|
75 |
|
|
76 |
|
|
77 |
</xsl:template> |
|
43 | 78 |
<xsl:template match="/"> |
44 | 79 |
<xsl:choose> |
45 | 80 |
<xsl:when |
... | ... | |
69 | 104 |
<xsl:value-of select="$Id"/> |
70 | 105 |
</FIELD> |
71 | 106 |
<xsl:choose> |
72 |
<xsl:when |
|
73 |
test=".//column[@name = 'Titre.Anglais']"> |
|
107 |
<xsl:when test=".//column[@name = 'Titre.Anglais']"> |
|
74 | 108 |
<FIELD name="title"> |
75 | 109 |
<xsl:value-of |
76 |
select=".//column[@name = 'Titre.Anglais']" |
|
77 |
/> |
|
110 |
select=".//column[@name = 'Titre.Anglais']"/> |
|
78 | 111 |
</FIELD> |
79 | 112 |
</xsl:when> |
80 |
<xsl:when |
|
81 |
test=".//column[@name = 'Titre.Francais']"> |
|
113 |
<xsl:when test=".//column[@name = 'Titre.Francais']"> |
|
82 | 114 |
<FIELD name="title"> |
83 | 115 |
<xsl:value-of |
84 |
select=".//column[@name = 'Titre.Francais']" |
|
85 |
/> |
|
116 |
select=".//column[@name = 'Titre.Francais']"/> |
|
86 | 117 |
</FIELD> |
87 | 118 |
</xsl:when> |
88 | 119 |
<xsl:otherwise> |
89 | 120 |
<FIELD name="title"> |
90 |
<xsl:value-of |
|
91 |
select=".//column[@name = 'Acronyme']" |
|
92 |
/> |
|
121 |
<xsl:value-of select=".//column[@name = 'Acronyme']"/> |
|
93 | 122 |
</FIELD> |
94 | 123 |
</xsl:otherwise> |
95 | 124 |
</xsl:choose> |
... | ... | |
105 | 134 |
</FIELD> |
106 | 135 |
<FIELD name="enddate" type="date" format="{$dateFormat}"> |
107 | 136 |
<xsl:value-of select="$endDate"/> |
108 |
</FIELD>--> <xsl:if test=".//column[@name = 'Responsable_scientifique']"> |
|
109 |
<FIELD name ="contactfullname"> |
|
110 |
<xsl:value-of select="normalize-space(.//column[@name='Responsable_scientifique'])"/> |
|
111 |
</FIELD> |
|
137 |
</FIELD>--> |
|
138 |
<xsl:if test=".//column[@name = 'Responsable_scientifique']"> |
|
139 |
<FIELD name="contactfullname"> |
|
140 |
<xsl:value-of |
|
141 |
select="normalize-space(.//column[@name = 'Responsable_scientifique'])" |
|
142 |
/> |
|
143 |
</FIELD> |
|
112 | 144 |
</xsl:if> |
113 | 145 |
|
114 | 146 |
<xsl:if test=".//column[@name = 'Aide_allouee']"> |
115 | 147 |
<FIELD name="fundedamount" type="float"> |
116 | 148 |
|
117 | 149 |
<xsl:value-of select=".//column[@name = 'Aide_allouee']"/> |
118 |
</FIELD> |
|
119 |
<FIELD name="currency"> |
|
120 |
<xsl:value-of select="string('EUR')"/> |
|
121 |
</FIELD> |
|
150 |
</FIELD>
|
|
151 |
<FIELD name="currency">
|
|
152 |
<xsl:value-of select="string('EUR')"/>
|
|
153 |
</FIELD>
|
|
122 | 154 |
</xsl:if> |
123 |
<xsl:if test=".//column[@name = 'Resume.Francais'] or .//column[@name = 'Resume.Anglais']"> |
|
155 |
<xsl:if |
|
156 |
test=".//column[@name = 'Resume.Francais'] or .//column[@name = 'Resume.Anglais']"> |
|
124 | 157 |
<xsl:choose> |
125 | 158 |
<xsl:when test=".//column[@name = 'Resume.Anglais']"> |
126 | 159 |
<FIELD name="summary"> |
127 |
<xsl:value-of select=".//column[@name = 'Resume.Anglais']"/> |
|
160 |
<xsl:value-of |
|
161 |
select=".//column[@name = 'Resume.Anglais']"/> |
|
128 | 162 |
</FIELD> |
129 | 163 |
</xsl:when> |
130 | 164 |
<xsl:otherwise> |
131 | 165 |
<FIELD name="summary"> |
132 |
<xsl:value-of select=".//column[@name = 'Resume.Francais']"/> |
|
166 |
<xsl:value-of |
|
167 |
select=".//column[@name = 'Resume.Francais']"/> |
|
133 | 168 |
</FIELD> |
134 | 169 |
</xsl:otherwise> |
135 | 170 |
</xsl:choose> |
... | ... | |
146 | 181 |
<xsl:value-of select="current-dateTime()"/> |
147 | 182 |
</FIELD> |
148 | 183 |
</ROW> |
184 |
<xsl:variable name="organizationCodeList" |
|
185 |
select="tokenize(.//column[@name = 'Partenaire.Code_RNSR'], '@')"/> |
|
149 | 186 |
<xsl:if test=".//column[@name = 'Partenaire.Coordinature']"> |
150 | 187 |
<xsl:variable name="Coord"> |
151 |
<xsl:value-of select="utils:md5(.//column[@name = 'Partenaire.Coordinature'])"/> |
|
188 |
<xsl:value-of |
|
189 |
select="utils:md5(.//column[@name = 'Partenaire.Coordinature'])" |
|
190 |
/> |
|
152 | 191 |
</xsl:variable> |
153 |
<xsl:variable name="organizationId" >
|
|
192 |
<xsl:variable name="organizationId"> |
|
154 | 193 |
<xsl:value-of select="concat($namespacePrefix, '::', $Coord)"/> |
155 | 194 |
</xsl:variable> |
156 | 195 |
<ROW table="dsm_organizations"> |
... | ... | |
160 | 199 |
<FIELD name="id"> |
161 | 200 |
<xsl:value-of select="$organizationId"/> |
162 | 201 |
</FIELD> |
163 |
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD> |
|
202 |
<FIELD name="lastupdate" type="date"> |
|
203 |
<xsl:value-of select="current-dateTime()"/> |
|
204 |
</FIELD> |
|
164 | 205 |
|
165 | 206 |
<FIELD name="legalname"> |
166 |
<xsl:value-of select=".//column[@name = 'Partenaire.Coordinature']"/> |
|
207 |
<xsl:value-of |
|
208 |
select=".//column[@name = 'Partenaire.Coordinature']"/> |
|
167 | 209 |
</FIELD> |
168 | 210 |
|
169 | 211 |
<FIELD name="collectedfrom"> |
170 | 212 |
<xsl:value-of select="$varDataSourceId"/> |
171 | 213 |
</FIELD> |
172 |
<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD> |
|
214 |
<FIELD name="provenanceaction" |
|
215 |
>sysimport:crosswalk:entityregistry</FIELD> |
|
173 | 216 |
<FIELD name="trust" type="float"> |
174 | 217 |
<xsl:value-of select="0.81"/> |
175 | 218 |
</FIELD> |
... | ... | |
177 | 220 |
|
178 | 221 |
<ROW table="project_organization"> |
179 | 222 |
<FIELD name="_dnet_resource_identifier_"> |
180 |
<xsl:value-of select='concat($projectId, "@@", $organizationId)'/> |
|
223 |
<xsl:value-of |
|
224 |
select='concat($projectId, "@@", $organizationId)'/> |
|
181 | 225 |
</FIELD> |
182 | 226 |
|
183 | 227 |
<FIELD name="project"> |
... | ... | |
193 | 237 |
|
194 | 238 |
|
195 | 239 |
</ROW> |
240 |
<xsl:call-template name="orgPid"> |
|
241 |
<xsl:with-param name="position" select="1"/> |
|
242 |
<xsl:with-param name="organizationPidList" |
|
243 |
select="$organizationCodeList"/> |
|
244 |
<xsl:with-param name="organizationId" select="$organizationId"/> |
|
245 |
</xsl:call-template> |
|
246 |
|
|
196 | 247 |
</xsl:if> |
197 | 248 |
|
198 | 249 |
<xsl:if test=".//column[@name = 'Partenaire.Nom_organisme']"> |
199 |
<xsl:for-each select="tokenize(.//column[@name = 'Partenaire.Nom_organisme'],'@')"> |
|
250 |
<xsl:for-each |
|
251 |
select="tokenize(.//column[@name = 'Partenaire.Nom_organisme'], '@')"> |
|
200 | 252 |
<xsl:if test="string-length(.) > 0"> |
201 |
<xsl:variable name="organizationId" > |
|
202 |
<xsl:value-of select="concat($namespacePrefix, '::', utils:md5(.))"/> |
|
253 |
<xsl:variable name="organizationId"> |
|
254 |
<xsl:value-of |
|
255 |
select="concat($namespacePrefix, '::', utils:md5(.))" |
|
256 |
/> |
|
203 | 257 |
</xsl:variable> |
204 | 258 |
<ROW table="dsm_organizations"> |
205 | 259 |
<FIELD name="_dnet_resource_identifier_"> |
... | ... | |
208 | 262 |
<FIELD name="id"> |
209 | 263 |
<xsl:value-of select="$organizationId"/> |
210 | 264 |
</FIELD> |
211 |
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD> |
|
265 |
<FIELD name="lastupdate" type="date"> |
|
266 |
<xsl:value-of select="current-dateTime()"/> |
|
267 |
</FIELD> |
|
212 | 268 |
|
213 | 269 |
<FIELD name="legalname"> |
214 | 270 |
<xsl:value-of select="."/> |
... | ... | |
217 | 273 |
<FIELD name="collectedfrom"> |
218 | 274 |
<xsl:value-of select="$varDataSourceId"/> |
219 | 275 |
</FIELD> |
220 |
<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD> |
|
276 |
<FIELD name="provenanceaction" |
|
277 |
>sysimport:crosswalk:entityregistry</FIELD> |
|
221 | 278 |
<FIELD name="trust" type="float"> |
222 | 279 |
<xsl:value-of select="0.81"/> |
223 | 280 |
</FIELD> |
... | ... | |
225 | 282 |
|
226 | 283 |
<ROW table="project_organization"> |
227 | 284 |
<FIELD name="_dnet_resource_identifier_"> |
228 |
<xsl:value-of select='concat($projectId, "@@", $organizationId)'/> |
|
285 |
<xsl:value-of |
|
286 |
select='concat($projectId, "@@", $organizationId)' |
|
287 |
/> |
|
229 | 288 |
</FIELD> |
230 | 289 |
|
231 | 290 |
<FIELD name="project"> |
... | ... | |
241 | 300 |
<FIELD name="semanticclass">participant</FIELD> |
242 | 301 |
|
243 | 302 |
</ROW> |
303 |
<xsl:call-template name="orgPid"> |
|
304 |
<xsl:with-param name="organizationId" |
|
305 |
select="$organizationId"/> |
|
306 |
<xsl:with-param name="organizationPidList" |
|
307 |
select="$organizationCodeList"/> |
|
308 |
<xsl:with-param name="position" select="position()"/> |
|
309 |
</xsl:call-template> |
|
244 | 310 |
</xsl:if> |
311 |
|
|
245 | 312 |
</xsl:for-each> |
246 | 313 |
|
247 | 314 |
|
... | ... | |
278 | 345 |
</xsl:template> |
279 | 346 |
</xsl:stylesheet> |
280 | 347 |
|
348 |
|
|
281 | 349 |
]]> |
282 | 350 |
</CODE> |
283 | 351 |
</SCRIPT> |
Also available in: Unified diff
added in the TR specific rules for the institution code. Modification of the tables dsm_identities and dsm_organizationpids