Project

General

Profile

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('fct_________')"/>
8
	<xsl:variable name="funderID" select="concat($namespacePrefix, '::FCT')"/>
9

    
10
	<xsl:template match="/">
11
		<xsl:variable name="p1" select="normalize-space(.//*[local-name() = 'Identifier'][@type = 'https://w3id.org/cerif/vocab/IdentifierTypes#FundingProgram'])"/>
12

    
13
		<fundingtree>
14
			<funder>
15
				<id>
16
					<xsl:value-of select="$funderID"/>
17
				</id>
18
				<shortname>FCT</shortname>
19
				<name>Fundação para a Ciência e a Tecnologia, I.P.</name>
20
				<jurisdiction>PT</jurisdiction>
21
			</funder>
22
			<xsl:if test="string-length($p1) &gt; 0">
23

    
24
				<xsl:variable name="level0" select="concat($funderID, '::', $p1)"/>
25
				<funding_level_0>
26
					<id>
27
						<xsl:value-of select="$level0"/>
28
					</id>
29
					<description>
30
						<xsl:value-of select="$p1"/>
31
					</description>
32
					<name>
33
						<xsl:value-of select="$p1"/>
34
					</name>
35
					<parent/>
36
					<class>fct:program</class>
37
				</funding_level_0>
38
			</xsl:if>
39
		</fundingtree>
40
	</xsl:template>
41

    
42
</xsl:stylesheet>
(12-12/33)