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:opensearch="http://a9.com/-/spec/opensearch/1.1/">
4
    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
5

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

    
15
    <xsl:template match="response/header">
16
        <title>OpenAIRE search results</title>
17
        <link>www.openaire.eu</link>
18
        <description><xsl:value-of select="concat('Results for query: ', query)"/></description>
19
        <language><xsl:value-of select="locale"/></language>
20
        <pubDate><xsl:value-of  select="current-dateTime()"/></pubDate>
21
        <lastBuildDate><xsl:value-of  select="current-dateTime()"/></lastBuildDate>
22
        <generator>OpenAIRE RSS Generator</generator>
23

    
24
        <opensearch:totalResults><xsl:value-of select="total"/></opensearch:totalResults>
25
        <opensearch:startIndex><xsl:value-of select="page"/></opensearch:startIndex>
26
        <opensearch:itemsPerPage><xsl:value-of select="size"/></opensearch:itemsPerPage>
27
    </xsl:template>
28

    
29
    <xsl:template match="result">
30
        <item>
31
            <title><xsl:value-of select="field[@name='title']/@value"/></title>
32
            <description><xsl:value-of select="field[@name='description']/@value"/></description>
33
            <xsl:for-each select="field[@name='hasAuthor']">
34
                <author><xsl:value-of select="field[@name='fullname']/@value"/></author>
35
            </xsl:for-each>
36
            <xsl:for-each select="field[@name='datasource']">
37
                <xsl:for-each select="field[@name='url']">
38
                    <link><xsl:value-of select="@value"/></link>
39
                </xsl:for-each>
40
            </xsl:for-each>
41
            <pubDate><xsl:value-of select="field[@name='dateofacceptance']/@value"/></pubDate>
42
        </item>
43
    </xsl:template>
44

    
45
</xsl:stylesheet>
46

    
47

    
(40-40/48)