Project

General

Profile

« Previous | Next » 

Revision 48139

integrated (hopefully) all required changes from dnet40

View differences:

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

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

  
9 9
	<xsl:template match="/">
10
		<xsl:variable name="funding">
11
			<xsl:choose>
12
				<xsl:when test="normalize-space(.//FundingStream)">
13
					<xsl:value-of select="normalize-space(.//FundingStream)" />
14
				</xsl:when>
15
				<xsl:otherwise>
16
					<xsl:value-of select="string('UNKNOWN')" />
17
				</xsl:otherwise>
18
			</xsl:choose>
19
		</xsl:variable>
20

  
21
		<fundingtree>
22
			<funder>
23
				<id>
24
					<xsl:value-of select="$funderID" />
25
				</id>
26
				<shortname>WT</shortname>
27
				<name>Wellcome Trust</name>
28
				<jurisdiction></jurisdiction>
29
			</funder>
30
			<funding_level_0>
31
				<id>
32
					<xsl:value-of select="concat($funderID, '::', $funding)" />
33
				</id>
34
				<description>
35
					<xsl:value-of select="$funding" />
36
				</description>
37
				<name>
38
					<xsl:value-of select="$funding" />
39
				</name>
40
				<parent></parent>
41
				<class>wt:fundingStream</class>
42
			</funding_level_0>
43
		</fundingtree>
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>
44 38
	</xsl:template>
45 39

  
46
</xsl:stylesheet>
40
</xsl:stylesheet>

Also available in: Unified diff