Project

General

Profile

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="1.0">
5

    
6
	<xsl:param name="parentDatasourceId"/>
7
	<xsl:param name="namespacePrefix"/>
8

    
9
	<xsl:template match="/">
10

    
11
		<xsl:variable name="funderId" select="string('taraexp_____::tara')"/>
12

    
13
		<record
14
		>
15

    
16
			<xsl:copy-of select=".//*[local-name()='header']"/>
17

    
18
			<metadata>
19
				<ROWS>
20
					<xsl:variable name="projectId" select="concat($namespacePrefix, '::',  normalize-space(.//column[@name='PROJECT ID']))"/>
21
					<xsl:variable name="startDate" select=".//column[@name='START DATE']"/>
22
					<xsl:variable name="endDate" select=".//column[@name='END DATE']"/>
23

    
24
					<ROW table="projects">
25
						<FIELD name="_dnet_resource_identifier_">
26
							<xsl:value-of select="$projectId"/>
27
						</FIELD>
28
						<FIELD name="id">
29
							<xsl:value-of select="$projectId"/>
30
						</FIELD>
31
						<FIELD name="code">
32
							<xsl:value-of select=".//column[@name='PROJECT ID']"/>
33
						</FIELD>
34
						<FIELD name="title">
35
							<xsl:value-of select=".//column[@name='PROJECT TITLE']"/>
36
						</FIELD>
37
						<FIELD name="jsonextrainfo">
38
							<xsl:value-of select=".//column[@name='DM KEYWORDS']"/>
39
						</FIELD>
40
						<FIELD name="startdate" type="date" format="yyyy">
41
							<xsl:value-of select="$startDate"/>
42
						</FIELD>
43
						<FIELD name="enddate" type="date" format="yyyy">
44
							<xsl:value-of select="$endDate"/>
45
						</FIELD>
46
						<FIELD name="collectedfrom">
47
							<xsl:value-of select="$parentDatasourceId"/>
48
						</FIELD>
49
						<FIELD name="provenanceactionclass">sysimport:crosswalk:entityregistry</FIELD>
50
					</ROW>
51

    
52
					<ROW table="project_fundingpath">
53
						<FIELD name="_dnet_resource_identifier_">
54
							<xsl:value-of select="concat($funderId, '@@', $projectId)"/>
55
						</FIELD>
56
						<FIELD name="funding">
57
							<xsl:value-of select="$funderId"/>
58
						</FIELD>
59
						<FIELD name="project">
60
							<xsl:value-of select="$projectId"/>
61
						</FIELD>
62
						<FIELD name="startdate" type="date" format="yyyy">
63
							<xsl:value-of select="$startDate"/>
64
						</FIELD>
65
						<FIELD name="enddate" type="date" format="yyyy">
66
							<xsl:value-of select="$endDate"/>
67
						</FIELD>
68
					</ROW>
69

    
70
				</ROWS>
71
			</metadata>
72
		</record>
73
	</xsl:template>
74

    
75
</xsl:stylesheet>
(24-24/25)