Re: Atom 2 RSS Script? Anyone got one?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 14 Nov 2004 16:48:57 +0100 Nick Wilson <nick@xxxxxxxxxxxxxx>
wrote:
hi all,

im all tired out of searching, just cant seem to find a script that will
convert atom 0.3 to any rss format. Does anyone have one or know where i
can get hold of one?

<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns:atom="http://purl.org/atom/ns#"; xmlns:dc="http://purl.org/dc/elements/1.1/";> <xsl:output cdata-section-elements="description" /> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="atom:feed[@version='0.3']"> <xsl:element name="rss"> <xsl:attribute name="version">2.0</xsl:attribute> <xsl:element name="channel"> <xsl:apply-templates select="atom:title"/> <xsl:apply-templates select="atom:link[@type='text/html']/@href"/> <xsl:element name="description"> <xsl:value-of select="atom:tagline"/> </xsl:element> <xsl:apply-templates select="atom:modified"/> <xsl:element name="docs">http://backend.userland.com/rss</xsl:element> <xsl:apply-templates select="atom:entry"/> </xsl:element> </xsl:element> </xsl:template> <xsl:template match="atom:entry"> <xsl:element name="item"> <xsl:apply-templates select="atom:title"/> <xsl:apply-templates select="atom:link[@type='text/html']/@href"/> <xsl:element name="guid"> <xsl:attribute name="isPermaLink">false</xsl:attribute> <xsl:value-of select="atom:id"/> </xsl:element> <xsl:apply-templates select="atom:modified"/> <xsl:element name="description"> <xsl:choose> <xsl:when test="atom:content[@mode='escaped']"> <xsl:value-of select="atom:content" disable-output-escaping="yes"/> </xsl:when> <xsl:otherwise> <xsl:copy-of select="atom:content/*"/> </xsl:otherwise> </xsl:choose> </xsl:element> </xsl:element> </xsl:template> <xsl:template match="atom:title"> <xsl:element name="title"> <xsl:value-of select="."/> </xsl:element> </xsl:template> <xsl:template match="atom:link[@type='text/html']/@href"> <xsl:element name="link"> <xsl:value-of select="."/> </xsl:element> </xsl:template> <xsl:template match="atom:modified"> <xsl:element name="dc:date"> <xsl:value-of select="."/> </xsl:element> </xsl:template> </xsl:stylesheet>


-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

http://www.smempire.org

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux