Revision 48139
Added by Alessia Bardi almost 7 years ago
nsf_contexts.xsl | ||
---|---|---|
1 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 | 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">
|
|
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 | 5 |
|
6 |
<xsl:variable name="namespacePrefix" select="string('nsf_________')" />
|
|
7 |
<xsl:variable name="funderID" select="concat($namespacePrefix, '::NSF')" />
|
|
6 |
<xsl:variable name="namespacePrefix" select="string('nsf_________')"/> |
|
7 |
<xsl:variable name="funderID" select="concat($namespacePrefix, '::NSF')"/> |
|
8 | 8 |
|
9 | 9 |
<xsl:template match="/"> |
10 | 10 |
<fundings> |
11 | 11 |
<fundingtree> |
12 |
<funder> |
|
13 |
<id><xsl:value-of select="$funderID" /></id> |
|
14 |
<shortname>NSF</shortname> |
|
15 |
<name>National Science Foundation</name> |
|
16 |
<jurisdiction>US</jurisdiction> |
|
17 |
</funder> |
|
12 |
<funder> |
|
13 |
<id> |
|
14 |
<xsl:value-of select="$funderID"/> |
|
15 |
</id> |
|
16 |
<shortname>NSF</shortname> |
|
17 |
<name>National Science Foundation</name> |
|
18 |
<jurisdiction>US</jurisdiction> |
|
19 |
</funder> |
|
18 | 20 |
</fundingtree> |
19 | 21 |
<xsl:for-each select=".//funding"> |
20 |
<xsl:variable name="p1" select="normalize-space(./orgDirectorateAbbr)" />
|
|
21 |
<xsl:variable name="p2" select="normalize-space(./orgDivisionAbbr)" />
|
|
22 |
|
|
22 |
<xsl:variable name="p1" select="normalize-space(./orgDirectorateAbbr)"/>
|
|
23 |
<xsl:variable name="p2" select="normalize-space(./orgDivisionAbbr)"/> |
|
24 |
|
|
23 | 25 |
<fundingtree> |
24 | 26 |
<funder> |
25 |
<id><xsl:value-of select="$funderID" /></id> |
|
27 |
<id> |
|
28 |
<xsl:value-of select="$funderID"/> |
|
29 |
</id> |
|
26 | 30 |
<shortname>NSF</shortname> |
27 | 31 |
<name>National Science Foundation</name> |
28 | 32 |
<jurisdiction>US</jurisdiction> |
... | ... | |
30 | 34 |
<xsl:if test="string-length($p1) > 0"> |
31 | 35 |
<xsl:choose> |
32 | 36 |
<xsl:when test="string-length($p2) > 0"> |
33 |
<xsl:variable name="level0" select="concat($funderID, '::', $p1)" />
|
|
34 |
<xsl:variable name="level1" select="concat($funderID, '::', $p1, '::', $p2)" />
|
|
37 |
<xsl:variable name="level0" select="concat($funderID, '::', $p1)"/> |
|
38 |
<xsl:variable name="level1" select="concat($funderID, '::', $p1, '::', $p2)"/> |
|
35 | 39 |
<funding_level_1> |
36 |
<id><xsl:value-of select="$level1" /></id> |
|
37 |
<description><xsl:value-of select="./orgDivisionName" /></description> |
|
38 |
<name><xsl:value-of select="./orgDivisionName" /></name> |
|
40 |
<id> |
|
41 |
<xsl:value-of select="$level1"/> |
|
42 |
</id> |
|
43 |
<description> |
|
44 |
<xsl:value-of select="./orgDivisionName"/> |
|
45 |
</description> |
|
46 |
<name> |
|
47 |
<xsl:value-of select="./orgDivisionName"/> |
|
48 |
</name> |
|
39 | 49 |
<parent> |
40 | 50 |
<funding_level_0> |
41 |
<id><xsl:value-of select="$level0" /></id> |
|
42 |
<description><xsl:value-of select="./orgDirectorateName" /></description> |
|
43 |
<name><xsl:value-of select="./orgDirectorateName" /></name> |
|
44 |
<parent /> |
|
51 |
<id> |
|
52 |
<xsl:value-of select="$level0"/> |
|
53 |
</id> |
|
54 |
<description> |
|
55 |
<xsl:value-of select="./orgDirectorateName"/> |
|
56 |
</description> |
|
57 |
<name> |
|
58 |
<xsl:value-of select="./orgDirectorateName"/> |
|
59 |
</name> |
|
60 |
<parent/> |
|
45 | 61 |
<class>nsf:fundingStream</class> |
46 | 62 |
</funding_level_0> |
47 | 63 |
</parent> |
48 | 64 |
</funding_level_1> |
49 | 65 |
</xsl:when> |
50 | 66 |
<xsl:otherwise> |
51 |
<xsl:variable name="level0" select="concat($funderID, '::', $p1)" />
|
|
67 |
<xsl:variable name="level0" select="concat($funderID, '::', $p1)"/> |
|
52 | 68 |
<funding_level_0> |
53 |
<id><xsl:value-of select="$level0" /></id> |
|
54 |
<description><xsl:value-of select="./orgDirectorateName" /></description> |
|
55 |
<name><xsl:value-of select="./orgDirectorateName" /></name> |
|
56 |
<parent /> |
|
69 |
<id> |
|
70 |
<xsl:value-of select="$level0"/> |
|
71 |
</id> |
|
72 |
<description> |
|
73 |
<xsl:value-of select="./orgDirectorateName"/> |
|
74 |
</description> |
|
75 |
<name> |
|
76 |
<xsl:value-of select="./orgDirectorateName"/> |
|
77 |
</name> |
|
78 |
<parent/> |
|
57 | 79 |
<class>nsf:fundingStream</class> |
58 | 80 |
</funding_level_0> |
59 | 81 |
</xsl:otherwise> |
Also available in: Unified diff
integrated (hopefully) all required changes from dnet40