Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
                                xmlns="http://namespace.openaire.eu/sygma">
4
    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
5

    
6
    <xsl:template match = "/">
7
        <response>
8
            <xsl:apply-templates select="response/header"/>
9
            <publications>
10
                <xsl:apply-templates select="//result"/>
11
            </publications>
12
        </response>
13
    </xsl:template>
14

    
15
    <xsl:template match="response/header">
16
        <header>
17
            <size><xsl:value-of select="size"/></size>
18
            <page><xsl:value-of select="page"/></page>
19
            <total><xsl:value-of select="total"/></total>
20
        </header>
21
    </xsl:template>
22

    
23

    
24
    <xsl:template match="result">
25
        <publication>
26
            <openaireid><xsl:value-of select="field[@name='resultId']/@value"/></openaireid>
27
            <xsl:for-each select="field[@name='pid']">
28
                <xsl:if test="field[@name='classid' and @value='doi']/@value = 'doi'">
29
                    <doi>
30
                        <xsl:value-of select="field[@name='value']/@value"/>
31
                    </doi>
32
                </xsl:if>
33
            </xsl:for-each>
34
            <description><xsl:value-of select="field[@name='description']/@value"/></description>
35
            <publicationtype><xsl:value-of select="field[@name='datasource'][1]/field[@name='typename']/@value"/></publicationtype>
36
            <title><xsl:value-of select="field[@name='title']/@value"/></title>
37
            <authors>
38
                <xsl:for-each select="field[@name='hasAuthor']">
39
                    <xsl:sort select="./field[@name='ranking']/@value" data-type="number"/>
40
                    <author><xsl:value-of select="field[@name='fullname']/@value"/></author>
41
                </xsl:for-each>
42
            </authors>
43
            <xsl:for-each select="field[@name='source']">
44
                <sourcejournal><xsl:value-of select="@value"/></sourcejournal>
45
            </xsl:for-each>
46
            <dateofacceptance><xsl:value-of select="field[@name='dateofacceptance']/@value"/></dateofacceptance>
47
            <xsl:for-each select="field[@name='datasource']">
48
                <xsl:for-each select="field[@name='url']">
49
                    <webresource><xsl:value-of select="@value"/></webresource>
50
                </xsl:for-each>
51
            </xsl:for-each>
52
            <bestlicense><xsl:value-of select="field[@name='bestlicense']/@value"/></bestlicense>
53
        </publication>
54
    </xsl:template>
55

    
56
</xsl:stylesheet>
(43-43/48)