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
    <xsl:template match="field[@name='pid']/field[@name='classid' and @value='doi']" name="idnode">
24
    </xsl:template>
25

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

    
57
</xsl:stylesheet>
(24-24/27)