Login   Register  
PHP Classes
elePHPant
Icontem

File: deviantart.xsl

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Steve  >  Deviantart Feed  >  deviantart.xsl  >  Download  
File: deviantart.xsl
Role: Auxiliary data
Content type: text/plain
Description: XSL Transformation Script
Class: Deviantart Feed
Generate RSS feeds from submissions to Deviantart
Author: By
Last change:
Date: 2008-12-02 19:14
Size: 3,550 bytes
 

Contents

Class file image Download
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:media="http://search.yahoo.com/mrss/"
    xmlns:php="http://php.net/xsl"
    xsl:extension-element-prefixes="php"
    >

    <xsl:output
        method="xml" 
        encoding="iso-8859-1"
        indent="yes"
        />

    <xsl:template match="/">
        <rss version="2.0">
            <channel>
                <xsl:element name="title">
                    <xsl:value-of select="/channel/title" />
                </xsl:element>
                <xsl:element name="link">
                    <xsl:value-of select="/channel/link" />
                </xsl:element>
                <xsl:element name="description">
                    <xsl:value-of select="/channel/description" />
                </xsl:element>
                <xsl:element name="language">
                    <xsl:value-of select="/channel/language" />
                </xsl:element>
                <xsl:apply-templates select="/channel/items/item"/>
                <!--xsl:call-template name="items"/-->
            </channel>
        </rss>
    </xsl:template>

    <xsl:template name="items" match="/channel/items/item">

        <item>
            <title>
                <xsl:copy-of
                    select="php:functionString('deviantartfeed::xsl_get_title',div/span/span/a/@title)"
                    />
            </title>
            <link>
                <xsl:value-of select="div/span/span/a/@href" />
            </link>
            <xsl:element name="media:thumbnail">
                <xsl:attribute name="url">
                    <xsl:copy-of
                        select="php:functionString('deviantartfeed::xsl_make_local_cache',div/span/span/a/img/@src,/channel/@imageurl,/channel/@imagecache)"
                        />
                </xsl:attribute>
                <xsl:attribute name="width">
                    <xsl:value-of select="div/span/span/a/img/@width" />
                </xsl:attribute>
                <xsl:attribute name="height">
                    <xsl:value-of select="div/span/span/a/img/@height" />
                </xsl:attribute>
            </xsl:element>
            <description>
                <xsl:text>&lt;p&gt;&lt;a href=&quot;</xsl:text>
                <xsl:value-of select="div/span/span/a/@href" />
                <xsl:text>&quot; title=&quot;</xsl:text>
                <xsl:value-of select="div/span/span/a/@title" />
                <xsl:text>&quot;&gt;&lt;img src=&quot;</xsl:text>
                <xsl:copy-of
                    select="php:functionString('deviantartfeed::xsl_make_local_cache',div/span/span/a/img/@src,/channel/@imageurl,/channel/@imagecache)"
                    />
                <xsl:text>&quot; width=&quot;</xsl:text>
                <xsl:value-of select="div/span/span/a/img/@width" />
                <xsl:text>&quot; height=&quot;</xsl:text>
                <xsl:value-of select="div/span/span/a/img/@height" />
                <xsl:text>&quot; alt=&quot;</xsl:text>
                <xsl:value-of select="div/span/span/a/@title" />
                <xsl:text>&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</xsl:text>
            </description>
            <pubDate>
                <xsl:copy-of
                    select="php:functionString('deviantartfeed::xsl_get_date',div/span/span/a/@title)"
                    />
            </pubDate>
            <guid isPermaLink="true"><xsl:value-of select="div/span/span/a/@href" /></guid>
        </item>

    </xsl:template>

</xsl:stylesheet>