1 |
39178
|
michele.ar
|
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
48139
|
alessia.ba
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
3 |
|
|
version="1.0">
|
4 |
43168
|
alessia.ba
|
|
5 |
48139
|
alessia.ba
|
<xsl:param name="parentDatasourceId"/>
|
6 |
|
|
<xsl:param name="funderAcronym"/>
|
7 |
43168
|
alessia.ba
|
|
8 |
39178
|
michele.ar
|
<xsl:template name="formatDate">
|
9 |
48139
|
alessia.ba
|
<xsl:param name="datename"/>
|
10 |
|
|
<xsl:param name="datevalue"/>
|
11 |
39178
|
michele.ar
|
<xsl:choose>
|
12 |
|
|
<xsl:when test="string-length($datevalue) = 4 and $datename = 'startdate'">
|
13 |
48139
|
alessia.ba
|
<FIELD name="{$datename}" type="date" format="yyyy-MM-dd">
|
14 |
|
|
<xsl:value-of select="concat($datevalue, '-01-01')"/>
|
15 |
|
|
</FIELD>
|
16 |
39178
|
michele.ar
|
</xsl:when>
|
17 |
|
|
<xsl:when test="string-length($datevalue) = 4 and $datename = 'enddate'">
|
18 |
48139
|
alessia.ba
|
<FIELD name="{$datename}" type="date" format="yyyy-MM-dd">
|
19 |
|
|
<xsl:value-of select="concat($datevalue, '-12-31')"/>
|
20 |
|
|
</FIELD>
|
21 |
39178
|
michele.ar
|
</xsl:when>
|
22 |
|
|
<xsl:when test="string-length($datevalue) = 10">
|
23 |
48139
|
alessia.ba
|
<FIELD name="{$datename}" type="date" format="yyyy-MM-dd">
|
24 |
|
|
<xsl:value-of select="$datevalue"/>
|
25 |
|
|
</FIELD>
|
26 |
39178
|
michele.ar
|
</xsl:when>
|
27 |
|
|
</xsl:choose>
|
28 |
|
|
</xsl:template>
|
29 |
43168
|
alessia.ba
|
|
30 |
48139
|
alessia.ba
|
<xsl:variable name="namespacePrefix" select="string('irb_hr______')"/>
|
31 |
43168
|
alessia.ba
|
|
32 |
39178
|
michele.ar
|
<xsl:template match="/">
|
33 |
48960
|
claudio.at
|
<record>
|
34 |
43168
|
alessia.ba
|
<xsl:if test="contains(//column[@name='FUNDER_NAME'], $funderAcronym)">
|
35 |
|
|
|
36 |
48139
|
alessia.ba
|
<xsl:variable name="fundingId" select="normalize-space(concat($namespacePrefix, '::', $funderAcronym))"/>
|
37 |
43168
|
alessia.ba
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
38 |
|
|
<metadata>
|
39 |
|
|
<ROWS>
|
40 |
|
|
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(//column[@name = 'PROJECT_IDENTIFIER']))"/>
|
41 |
43170
|
alessia.ba
|
<xsl:variable name="projectTitle">
|
42 |
48139
|
alessia.ba
|
<xsl:choose>
|
43 |
|
|
<xsl:when test="//column[@name = 'PROJECT_TITLE'] != ''">
|
44 |
|
|
<xsl:value-of select="//column[@name = 'PROJECT_TITLE']"/>
|
45 |
|
|
</xsl:when>
|
46 |
|
|
<xsl:otherwise>
|
47 |
|
|
<xsl:value-of select="//column[@name = 'PROJECT_IDENTIFIER']"/>
|
48 |
|
|
</xsl:otherwise>
|
49 |
|
|
</xsl:choose>
|
50 |
43170
|
alessia.ba
|
</xsl:variable>
|
51 |
|
|
|
52 |
39178
|
michele.ar
|
<ROW table="projects">
|
53 |
48139
|
alessia.ba
|
<FIELD name="_dnet_resource_identifier_">
|
54 |
|
|
<xsl:value-of select="$projectId"/>
|
55 |
|
|
</FIELD>
|
56 |
|
|
<FIELD name="id">
|
57 |
|
|
<xsl:value-of select="$projectId"/>
|
58 |
|
|
</FIELD>
|
59 |
|
|
<FIELD name="code">
|
60 |
|
|
<xsl:value-of select="//column[@name = 'PROJECT_IDENTIFIER']"/>
|
61 |
|
|
</FIELD>
|
62 |
|
|
<FIELD name="title">
|
63 |
|
|
<xsl:value-of select="$projectTitle"/>
|
64 |
|
|
</FIELD>
|
65 |
39178
|
michele.ar
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
66 |
|
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
67 |
43348
|
claudio.at
|
<FIELD name="collectedfrom">
|
68 |
|
|
<xsl:value-of select="$parentDatasourceId"/>
|
69 |
|
|
</FIELD>
|
70 |
39178
|
michele.ar
|
<xsl:call-template name="formatDate">
|
71 |
|
|
<xsl:with-param name="datename">startdate</xsl:with-param>
|
72 |
|
|
<xsl:with-param name="datevalue" select="//column[@name = 'START_DATE']"></xsl:with-param>
|
73 |
|
|
</xsl:call-template>
|
74 |
|
|
<xsl:call-template name="formatDate">
|
75 |
|
|
<xsl:with-param name="datename">enddate</xsl:with-param>
|
76 |
|
|
<xsl:with-param name="datevalue" select="//column[@name = 'END_DATE']"></xsl:with-param>
|
77 |
|
|
</xsl:call-template>
|
78 |
|
|
</ROW>
|
79 |
43168
|
alessia.ba
|
<xsl:if test="string-length(normalize-space(//column[@name = 'ORGANIZATION_INVOLVED'])) > 0">
|
80 |
48139
|
alessia.ba
|
<xsl:variable name="organizationId" select="concat($namespacePrefix, '::', normalize-space(//column[@name = 'ORGANIZATION_INVOLVED']))"/>
|
81 |
39178
|
michele.ar
|
<ROW table="organizations">
|
82 |
48139
|
alessia.ba
|
<FIELD name="_dnet_resource_identifier_">
|
83 |
|
|
<xsl:value-of select="$organizationId"/>
|
84 |
|
|
</FIELD>
|
85 |
|
|
<FIELD name="id">
|
86 |
|
|
<xsl:value-of select="$organizationId"/>
|
87 |
|
|
</FIELD>
|
88 |
|
|
<FIELD name="legalname">
|
89 |
|
|
<xsl:value-of select="//column[@name = 'ORGANIZATION_INVOLVED']"/>
|
90 |
|
|
</FIELD>
|
91 |
39178
|
michele.ar
|
<FIELD name="countryclass">HR</FIELD>
|
92 |
|
|
<FIELD name="countryscheme">dnet:countries</FIELD>
|
93 |
48139
|
alessia.ba
|
<FIELD name="collectedfrom">
|
94 |
|
|
<xsl:value-of select="$parentDatasourceId"/>
|
95 |
|
|
</FIELD>
|
96 |
39178
|
michele.ar
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
97 |
|
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
98 |
|
|
</ROW>
|
99 |
|
|
<ROW table="project_organization">
|
100 |
48139
|
alessia.ba
|
<FIELD name="_dnet_resource_identifier_">
|
101 |
|
|
<xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
|
102 |
|
|
</FIELD>
|
103 |
|
|
<FIELD name="project">
|
104 |
|
|
<xsl:value-of select="$projectId"/>
|
105 |
|
|
</FIELD>
|
106 |
|
|
<FIELD name="resporganization">
|
107 |
|
|
<xsl:value-of select="$organizationId"/>
|
108 |
|
|
</FIELD>
|
109 |
39178
|
michele.ar
|
<FIELD name="participantnumber" type="int">1</FIELD>
|
110 |
|
|
<FIELD name="semanticclass">coordinator</FIELD>
|
111 |
|
|
<FIELD name="semanticscheme">dnet:project_organization_relations</FIELD>
|
112 |
|
|
</ROW>
|
113 |
43168
|
alessia.ba
|
</xsl:if>
|
114 |
|
|
<xsl:if test="string-length($fundingId) > 0">
|
115 |
|
|
<ROW table="project_fundingpath">
|
116 |
48139
|
alessia.ba
|
<FIELD name="_dnet_resource_identifier_">
|
117 |
|
|
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
|
118 |
|
|
</FIELD>
|
119 |
|
|
<FIELD name="funding">
|
120 |
|
|
<xsl:value-of select="$fundingId"/>
|
121 |
|
|
</FIELD>
|
122 |
|
|
<FIELD name="project">
|
123 |
|
|
<xsl:value-of select="$projectId"/>
|
124 |
|
|
</FIELD>
|
125 |
43168
|
alessia.ba
|
<xsl:call-template name="formatDate">
|
126 |
|
|
<xsl:with-param name="datename">startdate</xsl:with-param>
|
127 |
|
|
<xsl:with-param name="datevalue" select="//column[@name = 'START_DATE']"></xsl:with-param>
|
128 |
|
|
</xsl:call-template>
|
129 |
|
|
<xsl:call-template name="formatDate">
|
130 |
|
|
<xsl:with-param name="datename">enddate</xsl:with-param>
|
131 |
|
|
<xsl:with-param name="datevalue" select="//column[@name = 'END_DATE']"></xsl:with-param>
|
132 |
|
|
</xsl:call-template>
|
133 |
|
|
</ROW>
|
134 |
|
|
</xsl:if>
|
135 |
|
|
</ROWS>
|
136 |
|
|
</metadata>
|
137 |
39178
|
michele.ar
|
|
138 |
43168
|
alessia.ba
|
</xsl:if>
|
139 |
39178
|
michele.ar
|
</record>
|
140 |
|
|
</xsl:template>
|
141 |
|
|
</xsl:stylesheet>
|