<?xml version="1.0" encoding="utf-8"?>
<!-- Written by Aristotle Pagaltzis -->
<!-- This code is in the public domain -->
<xsl:stylesheet
	version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:date="http://exslt.org/dates-and-times"
	xmlns:html="http://www.w3.org/1999/xhtml"
	xmlns="http://www.w3.org/2005/Atom"
	extension-element-prefixes="date"
	exclude-result-prefixes="date html"
>
<xsl:output method="xml" indent="no" encoding="utf-8" />
<xsl:strip-space elements="*" />

<xsl:template match="node()|@*">
	<xsl:apply-templates select="node()|@*"/>
</xsl:template>


<!-- BEGIN COPY MODE TEMPLATES -->

<xsl:template match="node()|@*" mode="copy">
	<xsl:copy>
		<xsl:apply-templates select="node()|@*" mode="copy" />
	</xsl:copy>
</xsl:template>

<xsl:template match="html:b[ html:a ]" mode="copy">
	<xsl:apply-templates mode="copy" select="node()|@*"/>
</xsl:template>

<xsl:template match="@shape" mode="copy" />

<xsl:template match="@href" mode="copy">
	<xsl:attribute name="href">
		<xsl:if test="starts-with( . , '/' )">http://www.slackware.com</xsl:if>
		<xsl:value-of select="." />
	</xsl:attribute>
</xsl:template>

<!-- END COPY MODE TEMPLATES -->


<xsl:template match="html:center/html:table[@width='100%']">
	<xsl:variable name="date" select="date:date( .//html:td/html:center/html:font[@size='-1']/html:b )" />
	<entry>
		<title><xsl:value-of select=".//html:td/html:b" /></title>
		<link href="http://www.slackware.com/"/>
		<link rel="self" href="http://plasmasturm.org/feeds/slackware-news/"/>
		<id>tag:plasmasturm.org,2005:Slackware-News-<xsl:value-of select="$date" /></id>
		<updated><xsl:value-of select="$date" />T12:00:00Z</updated>
		<content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
			<xsl:apply-templates mode="copy" select=".//html:table[@cellpadding='14']//html:td[@bgcolor]/node()" />
		</div></content>
	</entry>
</xsl:template>

<xsl:variable name="source-url" select="'http://www.slackware.com/'" />

<xsl:template match="/">
	<feed>
		<title>Slackware.com</title>
		<id>urn:uuid:ce386280-61e7-11da-9fcb-dd680b0526e0</id>
		<icon>http://www.slackware.com/favicon.ico</icon>
		<link href="{$source-url}"/>
		<updated><xsl:value-of select="date:date-time()" /></updated>
		<author><name>The Slackware team</name></author>
		<xsl:apply-templates />
	</feed>
</xsl:template>

</xsl:stylesheet>

<!--

/* equivalent CSS that highlights the relevant bits on www.slackware.com */

center > table[width="100%"]
table[cellpadding="14"] td[bgcolor="#FEFEFE"]
{
    background: #cef;
}

center > table[width="100%"]
td > center > font[size="-1"] > b
{
    background: #8f8;
}

center > table[width="100%"]
td > b
{
    background: #f88;
}

-->
