1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
|
3
|
<xsl:stylesheet version="1.0"
|
4
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/xpath-functions"
|
5
|
exclude-result-prefixes="fn">
|
6
|
|
7
|
<xsl:variable name="namespacePrefix" select="string('sfi_________')"/>
|
8
|
<xsl:variable name="funderId" select="concat($namespacePrefix, '::SFI')"/>
|
9
|
|
10
|
<xsl:template match="/">
|
11
|
<fundingtree>
|
12
|
<funder>
|
13
|
<id>
|
14
|
<xsl:value-of select="$funderId"/>
|
15
|
</id>
|
16
|
<shortname>SFI</shortname>
|
17
|
<name>
|
18
|
<xsl:value-of select=".//column[@name='Funder Name']"/>
|
19
|
</name>
|
20
|
<jurisdiction>IE</jurisdiction>
|
21
|
</funder>
|
22
|
<xsl:variable name="funding" select="normalize-space(.//column[@name='Programme Name'])"/>
|
23
|
<xsl:variable name="sub_funding" select="normalize-space(.//column[@name='Sub-programme Name'])"/>
|
24
|
<xsl:if test="$funding">
|
25
|
<xsl:choose>
|
26
|
<xsl:when test="$sub_funding">
|
27
|
<funding_level_1>
|
28
|
<id>
|
29
|
<xsl:value-of select="concat($funderId, '::' , $funding , '::' ,$sub_funding)"/>
|
30
|
</id>
|
31
|
<description>
|
32
|
<xsl:value-of select="$sub_funding"/>
|
33
|
</description>
|
34
|
<name>
|
35
|
<xsl:value-of select="$sub_funding"/>
|
36
|
</name>
|
37
|
<class>sfi:fundingStream</class>
|
38
|
<parent>
|
39
|
<funding_level_0>
|
40
|
<id>
|
41
|
<xsl:value-of select="concat($funderId, '::' , $funding)"/>
|
42
|
</id>
|
43
|
<description>
|
44
|
<xsl:value-of select="$funding"/>
|
45
|
</description>
|
46
|
<name>
|
47
|
<xsl:value-of select="$funding"/>
|
48
|
</name>
|
49
|
<parent/>
|
50
|
<class>sfi:fundingStream</class>
|
51
|
</funding_level_0>
|
52
|
</parent>
|
53
|
</funding_level_1>
|
54
|
</xsl:when>
|
55
|
<xsl:otherwise>
|
56
|
<funding_level_0>
|
57
|
<id>
|
58
|
<xsl:value-of select="concat($funderId, '::', $funding)"/>
|
59
|
</id>
|
60
|
<description>
|
61
|
<xsl:value-of select="$funding"/>
|
62
|
</description>
|
63
|
<name>
|
64
|
<xsl:value-of select="$funding"/>
|
65
|
</name>
|
66
|
<parent></parent>
|
67
|
<class>sfi:fundingStream</class>
|
68
|
</funding_level_0>
|
69
|
</xsl:otherwise>
|
70
|
</xsl:choose>
|
71
|
</xsl:if>
|
72
|
</fundingtree>
|
73
|
</xsl:template>
|
74
|
</xsl:stylesheet>
|