Move Java Newsflash items from old SGML system to new XML/XSL based system.
Add RSS 2.0 feed and link to it from the generated newsflash.html page.
This commit is contained in:
parent
ce440e2df3
commit
c89c8cd499
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/www/; revision=31282
4 changed files with 205 additions and 639 deletions
94
en/java/java-rss.xsl
Normal file
94
en/java/java-rss.xsl
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE xsl:stylesheet PUBLIC "-//FreeBSD//DTD FreeBSD XSLT 1.0 DTD//EN"
|
||||
"http://www.FreeBSD.org/XML/www/share/sgml/xslt10-freebsd.dtd" [
|
||||
<!ENTITY base ".">
|
||||
<!ENTITY title "">
|
||||
]>
|
||||
<!-- $FreeBSD$ -->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:cvs="http://www.FreeBSD.org/XML/CVS"
|
||||
exclude-result-prefixes="cvs">
|
||||
|
||||
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
|
||||
|
||||
<xsl:output method="xml" indent="yes"/>
|
||||
|
||||
<xsl:variable name="date">
|
||||
<xsl:value-of select="//cvs:keyword[@name='freebsd']"/>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:template match="/">
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<xsl:call-template name="rss-java-news-title" />
|
||||
<xsl:call-template name="rss-java-news-items" />
|
||||
</channel>
|
||||
</rss>
|
||||
</xsl:template>
|
||||
|
||||
<!-- template: "rss-java-news-title"
|
||||
pulls in the 10 most recent java news items -->
|
||||
|
||||
<xsl:template name="rss-java-news-title"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
|
||||
<xsl:variable name="title">FreeBSD Java Project News</xsl:variable>
|
||||
<xsl:variable name="link">http://www.FreeBSD.org/java/</xsl:variable>
|
||||
|
||||
<title><xsl:value-of select="$title" /></title>
|
||||
<link><xsl:value-of select="$link" /></link>
|
||||
<description>Java newsflash items from the FreeBSD Project</description>
|
||||
<language>en-us</language>
|
||||
<webMaster>freebsd-java@FreeBSD.org (FreeBSD Java Team)</webMaster>
|
||||
<managingEditor>freebsd-java@FreeBSD.org (FreeBSD Java Team)</managingEditor>
|
||||
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
|
||||
<ttl>120</ttl>
|
||||
<image>
|
||||
<url>http://www.FreeBSD.org/logo/logo-full.png</url>
|
||||
<title><xsl:value-of select="$title" /></title>
|
||||
<link><xsl:value-of select="$link" /></link>
|
||||
</image>
|
||||
<atom:link rel="self" type="application/rss+xml">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="$link" /><xsl:text>rss.xml</xsl:text>
|
||||
</xsl:attribute>
|
||||
</atom:link>
|
||||
</xsl:template>
|
||||
|
||||
<!-- template: "rss-java-news-items"
|
||||
pulls in the 10 most recent security advisories -->
|
||||
|
||||
<xsl:template name="rss-java-news-items"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
|
||||
<xsl:for-each select="descendant::event[position() <= 10]">
|
||||
<xsl:variable name="guid"><xsl:call-template name="generate-event-anchor"/></xsl:variable>
|
||||
|
||||
<item>
|
||||
<title>
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(child::title)">
|
||||
<xsl:value-of select="title"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:copy-of select="p"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</title>
|
||||
|
||||
<xsl:if test="count(child::title)">
|
||||
<description>
|
||||
<xsl:apply-templates select="p"/>
|
||||
</description>
|
||||
</xsl:if>
|
||||
|
||||
<link>http://www.FreeBSD.org/java/newsflash.html#<xsl:value-of select="$guid" /></link>
|
||||
<guid>http://www.FreeBSD.org/java/newsflash.html#<xsl:value-of select="$guid" /></guid>
|
||||
</item>
|
||||
|
||||
</xsl:for-each>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
Loading…
Add table
Add a link
Reference in a new issue