1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
3
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
4
|
exclude-result-prefixes="xs" version="2.0">
|
5
|
|
6
|
<xsl:param name="parentDatasourceId"/>
|
7
|
<xsl:variable name="namespacePrefix" select="xs:string('tubitakf____')"/>
|
8
|
<xsl:param name="quote">"</xsl:param>
|
9
|
|
10
|
<xsl:variable name="funderID" select="concat('tubitakf____', '::tubitak')"/>
|
11
|
|
12
|
|
13
|
<xsl:variable name="stream" select="normalize-space(.//column[@name='FUNDING STREAM(S)'])"/>
|
14
|
<xsl:variable name="fundingID">
|
15
|
<xsl:choose>
|
16
|
<xsl:when test="string-length($stream) > 0">
|
17
|
<xsl:value-of select="concat($funderID, '::', $stream)"/>
|
18
|
</xsl:when>
|
19
|
<xsl:otherwise>
|
20
|
<xsl:value-of select="$funderID"/>
|
21
|
</xsl:otherwise>
|
22
|
</xsl:choose>
|
23
|
|
24
|
</xsl:variable>
|
25
|
|
26
|
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='PROJECT IDENTIFIER']))"/>
|
27
|
|
28
|
|
29
|
<xsl:variable name="startDate" select="translate(.//column[@name='START DATE'],'/\','--')"/>
|
30
|
<xsl:variable name="endDate" select="translate(.//column[@name='END DATE'],'/\','--')"/>
|
31
|
|
32
|
<xsl:variable name="dateFormat" select="string('dd-MM-yyyy')"/>
|
33
|
<xsl:variable name="projectTitle" select="normalize-space(.//column[@name='PROJECT TITLE or ACRONYM'])"/>
|
34
|
|
35
|
<xsl:template match="/">
|
36
|
<record>
|
37
|
|
38
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
39
|
<metadata>
|
40
|
<ROWS>
|
41
|
<xsl:if test="string-length($projectTitle) > 0 and string-length($projectId) > 0">
|
42
|
<ROW table="projects">
|
43
|
<FIELD name="_dnet_resource_identifier_">
|
44
|
<xsl:value-of select="$projectId"/>
|
45
|
</FIELD>
|
46
|
<FIELD name="id">
|
47
|
<xsl:value-of select="$projectId"/>
|
48
|
</FIELD>
|
49
|
<FIELD name="code">
|
50
|
<xsl:value-of select="normalize-space(.//column[@name='PROJECT IDENTIFIER'])"/>
|
51
|
</FIELD>
|
52
|
<FIELD name="startdate" type="date" format="{$dateFormat}">
|
53
|
<xsl:value-of select="$startDate"/>
|
54
|
</FIELD>
|
55
|
<FIELD name="enddate" type="date" format="{$dateFormat}">
|
56
|
<xsl:value-of select="$endDate"/>
|
57
|
</FIELD>
|
58
|
<FIELD name="title">
|
59
|
<xsl:value-of select="$projectTitle"/>
|
60
|
</FIELD>
|
61
|
|
62
|
|
63
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
64
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
65
|
<FIELD name="collectedfrom">
|
66
|
<xsl:value-of select="$parentDatasourceId"/>
|
67
|
</FIELD>
|
68
|
|
69
|
<FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
|
70
|
|
71
|
</ROW>
|
72
|
</xsl:if>
|
73
|
<ROW table="project_fundingpath">
|
74
|
<FIELD name="_dnet_resource_identifier_">
|
75
|
<xsl:value-of select="concat($fundingID,'@@', $projectId)"/>
|
76
|
</FIELD>
|
77
|
<FIELD name="funding">
|
78
|
<xsl:value-of select="$fundingID"/>
|
79
|
</FIELD>
|
80
|
<FIELD name="project">
|
81
|
<xsl:value-of select="$projectId"/>
|
82
|
</FIELD>
|
83
|
<FIELD name="startdate" type="date" format="{$dateFormat}">
|
84
|
<xsl:value-of select="$startDate"/>
|
85
|
</FIELD>
|
86
|
<FIELD name="enddate" type="date" format="{$dateFormat}">
|
87
|
<xsl:value-of select="$endDate"/>
|
88
|
</FIELD>
|
89
|
</ROW>
|
90
|
|
91
|
|
92
|
</ROWS>
|
93
|
</metadata>
|
94
|
</record>
|
95
|
</xsl:template>
|
96
|
</xsl:stylesheet>
|