Project

General

Profile

1

    
2
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
                xmlns:dri="http://www.driver-repository.eu/namespace/dri"
4
                xmlns:oaf="http://namespace.openaire.eu/oaf"
5
                xmlns:dc="http://purl.org/dc/elements/1.1/">
6

    
7
    <!-- Turn off auto-insertion of <?xml> tag and set indenting on -->
8
    <xsl:output method="text" encoding="utf-8" omit-xml-declaration="yes" media-type="text/csv" />
9

    
10
    <!-- strip whitespace from whitespace-only nodes -->
11
    <xsl:strip-space elements="*"/>
12

    
13

    
14
    <xsl:template match = "/">
15
        <xsl:apply-templates select="//oaf:project"/>
16
    </xsl:template>
17

    
18
    <!-- Title, Funder, Start Date, End Date, Participants -->
19
    <xsl:template match="oaf:project">
20
        <!-- Title -->
21
        <xsl:text>"</xsl:text>
22
        <xsl:value-of select="title"/>
23
        <xsl:text>",</xsl:text>
24

    
25
        <!-- Funder -->
26
        <xsl:value-of select="fundingtree/funder/name"/>
27
        <xsl:text>(</xsl:text>
28
        <xsl:value-of select="fundingtree/funder/shortname"/>
29
        <xsl:text>),</xsl:text>
30

    
31
        <!-- Start Date -->
32
        <xsl:value-of select="startdate"/>
33
        <xsl:text>,</xsl:text>
34

    
35
        <!-- End Date -->
36
        <xsl:value-of select="enddate"/>
37
        <xsl:text>,</xsl:text>
38

    
39
        <!-- Participants -->
40
        <xsl:text>"</xsl:text>
41
            <xsl:for-each select="rels/rel/to[@class='hasParticipant']">
42
                <xsl:value-of select="../legalname"/>
43
                <xsl:if test="not(position()=last())">
44
                    <xsl:text>;</xsl:text>
45
                </xsl:if>
46
            </xsl:for-each>
47
        <xsl:text>"</xsl:text>
48
        <xsl:text>&#xd;</xsl:text>
49
        
50
    </xsl:template>
51

    
52
</xsl:stylesheet>
(10-10/47)