RFC 822-ify OPML dateModified

This commit is contained in:
Sam Ruby 2007-05-29 08:16:21 -04:00
parent c2ff924372
commit cc4a43cf62

View File

@ -5,11 +5,26 @@
<xsl:output indent="yes" method="xml"/>
<xsl:template name="rfc822" xmlns:date="http://exslt.org/dates-and-times">
<xsl:param name="date"/>
<!-- http://www.trachtenberg.com/blog/2005/03/03/xslt-cookbook-generating-an-rfc-822-date/ -->
<xsl:value-of select="concat(date:day-abbreviation($date), ', ',
format-number(date:day-in-month($date), '00'), ' ',
date:month-abbreviation($date), ' ', date:year($date), ' ',
format-number(date:hour-in-day($date), '00'), ':',
format-number(date:minute-in-hour($date), '00'), ':',
format-number(date:second-in-minute($date), '00'), ' GMT')"/>
</xsl:template>
<xsl:template match="atom:feed">
<opml version="1.1">
<head>
<title><xsl:value-of select="atom:title"/></title>
<dateModified><xsl:value-of select="atom:updated/@planet:format"/></dateModified>
<dateModified>
<xsl:call-template name="rfc822">
<xsl:with-param name="date" select="atom:updated"/>
</xsl:call-template>
</dateModified>
<ownerName><xsl:value-of select="atom:author/atom:name"/></ownerName>
<ownerEmail><xsl:value-of select="atom:author/atom:email"/></ownerEmail>
</head>