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:fn="http://www.w3.org/2005/xpath-functions" version="1.0"
4
                exclude-result-prefixes="fn">
5

    
6
	<xsl:variable name="namespacePrefix" select="string('wt__________')"/>
7
	<xsl:variable name="funderID" select="concat($namespacePrefix, '::WT')"/>
8

    
9
	<xsl:template match="/">
10
		<fundings>
11
			<fundingtree>
12
				<funder>
13
					<id>
14
						<xsl:value-of select="$funderID"/>
15
					</id>
16
					<shortname>WT</shortname>
17
					<name>Wellcome Trust</name>
18
					<jurisdiction></jurisdiction>
19
				</funder>
20
				<xsl:variable name="stream" select="normalize-space(.//Grant/Stream)"/>
21
				<xsl:if test="string-length($stream) > 0">
22
					<funding_level_0>
23
						<id>
24
							<xsl:value-of select="concat($funderID, '::', $stream)"/>
25
						</id>
26
						<description>
27
							<xsl:value-of select="$stream"/>
28
						</description>
29
						<name>
30
							<xsl:value-of select="$stream"/>
31
						</name>
32
						<parent></parent>
33
						<class>wt:fundingStream</class>
34
					</funding_level_0>
35
				</xsl:if>
36
			</fundingtree>
37
		</fundings>
38
	</xsl:template>
39

    
40
</xsl:stylesheet>
(33-33/33)