Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3

    
4
    <!-- Turn off auto-insertion of <?xml> tag and set indenting on -->
5
    <xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" />
6

    
7
    <!-- strip whitespace from whitespace-only nodes -->
8
    <xsl:strip-space elements="*"/>
9

    
10
    <xsl:template match = "/">
11
        <table>
12
            <thead>
13
                <tr>
14
                    <th>Title</th>
15
                    <th>Authors</th>
16
                    <th>Publication Year</th>
17
                    <th>DOI</th>
18
                    <th>Permanent Identifier</th>
19
                    <th>Publication type</th>
20
                    <th>Journal</th>
21
                    <th>Project Name (GA Number)</th>
22
                    <th>Access Mode</th>
23
                </tr>
24
            </thead>
25
            <tbody>
26
                <xsl:apply-templates select="//result"/>
27
            </tbody>
28
        </table>
29
    </xsl:template>
30

    
31
    <!-- Title, Authors, Description, Year, DOI, Permanent identifier, Publication type, Journal, Project Name, GA number, Access -->
32
    <xsl:template match="result">
33
        <tr>
34
            <!-- title -->
35
            <td>
36
                <xsl:value-of select="replace(field[@name='title']/@value, '[&#x007F;-&#x009F;]', ' ')"/>
37
            </td>
38

    
39
            <!-- authors -->
40
            <td>
41
                <xsl:for-each select="field[@name='hasAuthor']">
42
                    <xsl:sort select="field[@name='ranking']/@value" data-type="number"/>
43
                    <xsl:value-of select="replace(field[@name='fullname']/@value, '[&#x007F;-&#x009F;]', ' ')"/>
44
                    <xsl:if test="not(position()=last())">
45
                        <xsl:text>; </xsl:text>
46
                    </xsl:if>
47
                </xsl:for-each>
48
            </td>
49

    
50
            <!-- description
51
            <xsl:text>&quot;</xsl:text>
52
                <xsl:value-of select="field[@name='description']/@value"/>
53
                <xsl:if test="position() != last()"><xsl:text>&#160;</xsl:text></xsl:if>
54
            <xsl:text>&quot;</xsl:text>
55
            <xsl:text>,</xsl:text>
56
    -->
57
            <!-- year -->
58
            <td>
59
                <xsl:value-of select="field[@name='dateofacceptance']/@value"/>
60
            </td>
61

    
62
            <!-- DOI -->
63
            <td>
64
                <xsl:for-each select="field[@name='pid']">
65
                    <xsl:if test="field[@name='classid' and @value='doi']/@value = 'doi'">
66
                        <xsl:value-of select="replace(field[@name='value']/@value, '[&#x007F;-&#x009F;]', ' ')"/>
67
                    </xsl:if>
68
                </xsl:for-each>
69
            </td>
70

    
71
            <!-- Permanent Identifier -->
72
            <td>
73
                <a target="_blank">
74
                    <xsl:attribute name="href">
75
                        <xsl:value-of select="replace(field[@name='datasource'][1]/field[@name='url']/@value, '[&#x007F;-&#x009F;]', ' ')"/>
76
                    </xsl:attribute>
77
                    <xsl:value-of select="field[@name='datasource'][1]/field[@name='url']/@value"/>
78
                </a>
79
            </td>
80

    
81
            <!-- Publication type -->
82
            <td>
83
                <xsl:value-of select="field[@name='datasource'][1]/field[@name='typename']/@value"/>
84
            </td>
85

    
86
            <!-- journal -->
87
            <td>
88
                <xsl:for-each select="field[@name='source']">
89
                    <xsl:value-of select="replace(@value, '[&#x007F;-&#x009F;]', ' ')"/>
90
                </xsl:for-each>
91
            </td>
92

    
93
            <!-- project name -->
94
            <td>
95
                <xsl:for-each select="field[@name='project'] ">
96
                    <!-- project name -->
97
                    <xsl:choose>
98
                        <xsl:when test="field[@name='projectacronym']/@value != ''" >
99
                            <xsl:value-of select="replace(field[@name='projectacronym']/@value, '[&#x007F;-&#x009F;]', ' ')"/>
100
                        </xsl:when>
101
                        <xsl:otherwise>
102
                            <xsl:value-of select="replace(field[@name='projecttitle']/@value, '[&#x007F;-&#x009F;]', ' ')"/>
103
                        </xsl:otherwise>
104
                    </xsl:choose>
105
                    <xsl:if test="field[@name='projectcode']/@value!= ''">
106
                        <xsl:value-of select="concat('(',field[@name='projectcode']/@value,')')"/>
107
                    </xsl:if>
108
                    <xsl:if test="not(position()=last())">
109
                        <xsl:text>; </xsl:text>
110
                    </xsl:if>
111
                </xsl:for-each>
112
            </td>
113

    
114
            <!--access -->
115
            <td>
116
                <xsl:value-of select="field[@name='bestaccessright']/@value"/>
117
            </td>
118
       </tr>
119

    
120
    </xsl:template>
121

    
122
</xsl:stylesheet>
(21-21/46)