summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorot <ot@localhost>2005-11-15 05:17:25 +0000
committerot <ot@localhost>2005-11-15 05:17:25 +0000
commit7c241db4d115e7cf97d5dac38f6384c14011e802 (patch)
tree4099e9930d100a12f0d0779dda8fd20084c86a7d
parent3e7727b70983e03172adb25aab2901ee2c29876c (diff)
downloadmarkup-validator-7c241db4d115e7cf97d5dac38f6384c14011e802.zip
markup-validator-7c241db4d115e7cf97d5dac38f6384c14011e802.tar.gz
markup-validator-7c241db4d115e7cf97d5dac38f6384c14011e802.tar.bz2
- Publishing XSLT used for the creation of the atom news feed
(courtesy of Antonio Cavedoni) - sample server config to serve atom feed through W3C xslt service - adding link rel="alternate" for the newsfeed in both whatsnew and index.html
-rwxr-xr-xhtdocs/header.html5
-rwxr-xr-xhtdocs/index.html5
-rw-r--r--htdocs/validator-news.xsl64
-rwxr-xr-xhtdocs/whatsnew.html5
-rw-r--r--httpd/conf/httpd.conf10
5 files changed, 84 insertions, 5 deletions
diff --git a/htdocs/header.html b/htdocs/header.html
index 30e30b9..eb1131c 100755
--- a/htdocs/header.html
+++ b/htdocs/header.html
@@ -12,7 +12,10 @@
<meta name="description" content="W3C's easy-to-use
HTML validation service, based on an SGML parser." />
<meta name="revision" content="<!--#echo var="revision" -->" />
- <!-- SSI Template Version: $Id: header.html,v 1.38 2005-08-18 04:56:47 ot Exp $ -->
+ <!--#if expr="$feeds = 1" -->
+ <link rel="alternate" type="application/atom+xml" href="whatsnew.atom" />
+ <!--#endif -->
+ <!-- SSI Template Version: $Id: header.html,v 1.39 2005-11-15 05:17:25 ot Exp $ -->
</head>
<body>
diff --git a/htdocs/index.html b/htdocs/index.html
index b4c44bd..b2405f1 100755
--- a/htdocs/index.html
+++ b/htdocs/index.html
@@ -1,7 +1,8 @@
-<!--#set var="revision" value="\$Id: index.html,v 1.75 2005-10-20 06:46:50 ot Exp $"
---><!--#set var="date" value="\$Date: 2005-10-20 06:46:50 $"
+<!--#set var="revision" value="\$Id: index.html,v 1.76 2005-11-15 05:17:25 ot Exp $"
+--><!--#set var="date" value="\$Date: 2005-11-15 05:17:25 $"
--><!--#set var="title" value="The W3C Markup Validation Service"
--><!--#set var="relroot" value="./"
+--><!--#set var="feeds" value="1"
--><!--#include virtual="header.html" -->
<div id="head">
diff --git a/htdocs/validator-news.xsl b/htdocs/validator-news.xsl
new file mode 100644
index 0000000..6536dae
--- /dev/null
+++ b/htdocs/validator-news.xsl
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:h="http://www.w3.org/1999/xhtml"
+ xmlns="http://www.w3.org/2005/Atom"
+ exclude-result-prefixes="h">
+
+<xsl:output method="xml" encoding="UTF-8" indent="yes"
+ media-type="application/atom+xml"/>
+
+<xsl:param name="host" select="'validator.w3.org'"/>
+<xsl:param name="self" select="concat('http://', $host, '/whatsnew.atom')"/>
+<xsl:param name="validator"
+ select="concat('http://', $host, '/whatsnew.html')"/>
+<!-- number of entries to be displayed in the feed -->
+<xsl:param name="limit" select="10"/>
+<xsl:param name="author" select="'The W3C Validator Team'"/>
+<!--
+ feedvalidator.org complains about dates like YYYY-MM-DD not
+ being valid ISO datetimes, so we hack around it by setting
+ each item's publish time to 00:00:00 UTC
+-->
+<xsl:param name="faketime" select="'T00:00:00Z'"/>
+
+<xsl:template match="/">
+<feed xml:lang="en">
+ <title><xsl:value-of select="/h:html/h:head/h:title"/></title>
+ <updated>
+ <xsl:value-of
+ select="concat(substring-after(/h:html/h:body/*//h:dt[position()=1]/@id,
+ 't'), $faketime)"/>
+ </updated>
+ <author>
+ <name><xsl:value-of select="$author"/></name>
+ </author>
+ <id><xsl:value-of select="$self"/></id>
+ <link href="{$validator}"/>
+ <link rel="self" href="{$self}"/>
+
+ <!-- entries -->
+ <xsl:apply-templates select="//h:dt[position() &lt; $limit]"/>
+</feed>
+</xsl:template>
+
+<xsl:template match="h:dt">
+<xsl:variable name="updated" select="substring-after(@id, 't')"/>
+ <entry>
+ <id><xsl:value-of
+ select="concat('tag:', $host, ',', $updated, ':', @id)"/></id>
+ <updated><xsl:value-of select="concat($updated, $faketime)"/></updated>
+ <link href="{concat($validator, '#', @id)}"/>
+ <title><xsl:value-of select="substring-before(., ':')"/></title>
+ <content xml:base="{$validator}" type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:copy-of select="following::h:dd[position()=1]/node()"/>
+ </div>
+ </content>
+ </entry>
+</xsl:template>
+
+<xsl:template match="text()">
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/htdocs/whatsnew.html b/htdocs/whatsnew.html
index 4d3c0ed..27f2d5d 100755
--- a/htdocs/whatsnew.html
+++ b/htdocs/whatsnew.html
@@ -1,7 +1,8 @@
-<!--#set var="revision" value="\$Id: whatsnew.html,v 1.53 2005-10-20 06:46:50 ot Exp $"
---><!--#set var="date" value="\$Date: 2005-10-20 06:46:50 $"
+<!--#set var="revision" value="\$Id: whatsnew.html,v 1.54 2005-11-15 05:17:25 ot Exp $"
+--><!--#set var="date" value="\$Date: 2005-11-15 05:17:25 $"
--><!--#set var="title" value="What's New at The W3C Markup Validation Service"
--><!--#set var="relroot" value="./"
+--><!--#set var="feeds" value="1"
--><!--#include virtual="header.html" -->
<div class="doc"><a name="skip" id="skip"></a>
<h2>News for the W3C Markup Validator</h2>
diff --git a/httpd/conf/httpd.conf b/httpd/conf/httpd.conf
index b1e6478..bed9abd 100644
--- a/httpd/conf/httpd.conf
+++ b/httpd/conf/httpd.conf
@@ -33,3 +33,13 @@ Alias /w3c-validator/ /usr/local/validator/htdocs/
Header set Cache-Control "max-age=604800"
</Directory>
</IfModule>
+
+# atom news feed
+ RewriteRule ^/whatsnew.atom$ http://www.w3.org/2005/08/online_xslt/xslt?xslfile=http://www.w3.org/QA/Tools/validator-news.xsl&xmlfile=http://validator.w3.org/whatsnew.html [P,L]
+# will need to change this to point to validator.w3.org/validator-news.xsl when we publish it there.
+
+<Proxy *>
+ Order Deny,Allow
+ Allow from all
+</Proxy>
+