Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
                xmlns:fn="http://www.w3.org/2005/xpath-functions" exclude-result-prefixes="fn">
4

    
5
	<xsl:variable name="namespacePrefix" select="string('ec__________')"/>
6
	<xsl:variable name="funderID" select="concat($namespacePrefix, '::EC')"/>
7

    
8
	<xsl:template match="/">
9
		<fundingtree>
10
			<funder>
11
				<id>
12
					<xsl:value-of select="$funderID"/>
13
				</id>
14
				<shortname>EC</shortname>
15
				<name>European Commission</name>
16
				<jurisdiction>EU</jurisdiction>
17
			</funder>
18
			<xsl:variable name="toaCode" select=".//ProjectTOACode"/>
19
			<xsl:choose>
20
				<xsl:when test="$toaCode and starts-with($toaCode, 'ERC-')">
21
					<xsl:call-template name="ERC">
22
						<xsl:with-param name="toaCode" select="$toaCode"/>
23
					</xsl:call-template>
24
				</xsl:when>
25
				<xsl:when test="$toaCode and not(starts-with($toaCode, 'ERC-'))">
26
					<xsl:call-template name="other">
27
						<xsl:with-param name="toaCode" select="$toaCode"/>
28
					</xsl:call-template>
29
				</xsl:when>
30
				<xsl:otherwise>
31
					<xsl:call-template name="h2020"/>
32
				</xsl:otherwise>
33
			</xsl:choose>
34
		</fundingtree>
35
	</xsl:template>
36

    
37
	<xsl:template name="h2020">
38
		<funding_level_0>
39
			<id>
40
				<xsl:value-of select="concat($funderID, '::H2020')"/>
41
			</id>
42
			<name>H2020</name>
43
			<description>Horizon 2020 Framework Programme</description>
44
			<parent/>
45
			<class>ec:h2020fundings</class>
46
		</funding_level_0>
47
	</xsl:template>
48

    
49
	<xsl:template name="ERC">
50
		<xsl:param name="toaCode"/>
51
		<xsl:variable name="toaId" select="concat($funderID, '::H2020::ERC::', $toaCode)"/>
52
		<funding_level_2>
53
			<id>
54
				<xsl:value-of select="$toaId"/>
55
			</id>
56
			<description>
57
				<xsl:value-of select=".//ProjectTOADescr"/>
58
			</description>
59
			<name>
60
				<xsl:value-of select="$toaCode"/>
61
			</name>
62
			<class>ec:h2020toas</class>
63
			<parent>
64
				<funding_level_1>
65
					<id>
66
						<xsl:value-of select="concat($funderID, '::H2020::ERC')"/>
67
					</id>
68
					<description>
69
						<xsl:value-of select="string('European Research Council')"/>
70
					</description>
71
					<name>
72
						<xsl:value-of select="string('ERC')"/>
73
					</name>
74
					<class>ec:h2020fundings</class>
75
					<parent>
76
						<funding_level_0>
77
							<id>
78
								<xsl:value-of select="concat($funderID, '::H2020')"/>
79
							</id>
80
							<name>H2020</name>
81
							<description>Horizon 2020 Framework Programme</description>
82
							<parent/>
83
							<class>ec:h2020fundings</class>
84
						</funding_level_0>
85
					</parent>
86
				</funding_level_1>
87
			</parent>
88
		</funding_level_2>
89
	</xsl:template>
90

    
91
	<xsl:template name="other">
92
		<xsl:param name="toaCode"/>
93
		<xsl:variable name="toaId" select="concat($funderID, '::H2020::', $toaCode)"/>
94
		<funding_level_1>
95
			<id>
96
				<xsl:value-of select="$toaId"/>
97
			</id>
98
			<description>
99
				<xsl:value-of select=".//ProjectTOADescr"/>
100
			</description>
101
			<name>
102
				<xsl:value-of select="$toaCode"/>
103
			</name>
104
			<class>ec:h2020toas</class>
105
			<parent>
106
				<funding_level_0>
107
					<id>
108
						<xsl:value-of select="concat($funderID, '::H2020')"/>
109
					</id>
110
					<name>H2020</name>
111
					<description>Horizon 2020 Framework Programme</description>
112
					<parent/>
113
					<class>ec:h2020fundings</class>
114
				</funding_level_0>
115
			</parent>
116
		</funding_level_1>
117
	</xsl:template>
118
</xsl:stylesheet>
(6-6/30)