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
			<xsl:copy-of select=".//*[local-name()='header']"/>
16

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

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

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

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

    
74
</xsl:stylesheet>
(28-28/30)