Project

General

Profile

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">
5

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

    
9
    <xsl:template match="/">
10
        <xsl:variable name="funding" select="//funder/name"/>
11
        <fundingtree>
12
            <funder>
13
                <id>
14
                    <xsl:value-of select="$funderID"/>
15
                </id>
16
                <shortname>UKRI</shortname>
17
                <name>UK Research and Innovation</name>
18
                <jurisdiction>GB</jurisdiction>
19
            </funder>
20
            <xsl:if test="string-length($funding) > 0">
21
                <funding_level_0>
22
                    <id>
23
                        <xsl:value-of select="concat($funderID, '::', $funding)"/>
24
                    </id>
25
                    <description>
26
                        <xsl:value-of select="$funding"/>
27
                    </description>
28
                    <name>
29
                        <xsl:value-of select="$funding"/>
30
                    </name>
31
                    <parent></parent>
32
                    <class>ukri:fundingStream</class>
33
                </funding_level_0>
34
            </xsl:if>
35
        </fundingtree>
36
    </xsl:template>
37
</xsl:stylesheet>
(31-31/33)