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="field[@name='title']/@value"/>
37
            </td>
38

    
39
            <!-- authors -->
40
            <td>
41
                <xsl:for-each select="field[@name='hasAuthor']">
42
                    <xsl:value-of select="field[@name='fullname']/@value"/>
43
                    <xsl:if test="not(position()=last())">
44
                        <xsl:text>; </xsl:text>
45
                    </xsl:if>
46
                </xsl:for-each>
47
            </td>
48

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

    
61
            <!-- DOI -->
62
            <td>
63
                <xsl:for-each select="field[@name='pid']">
64
                    <xsl:if test="field[@name='classid' and @value='doi']/@value = 'doi'">
65
                        <xsl:value-of select="field[@name='value']/@value"/>
66
                    </xsl:if>
67
                </xsl:for-each>
68
            </td>
69

    
70
            <!-- Permanent Identifier -->
71
            <td>
72
                <a target="_blank">
73
                    <xsl:attribute name="href">
74
                        <xsl:value-of select="field[@name='datasource'][1]/field[@name='url']/@value"/>
75
                    </xsl:attribute>
76
                    <xsl:value-of select="field[@name='datasource'][1]/field[@name='url']/@value"/>
77
                </a>
78
            </td>
79

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

    
85
            <!-- journal -->
86
            <td>
87
                <xsl:for-each select="field[@name='source']">
88
                    <xsl:value-of select="@value"/>
89
                </xsl:for-each>
90
            </td>
91

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

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

    
119
    </xsl:template>
120

    
121
</xsl:stylesheet>
(16-16/40)