Move templates in mkindex.xsl into includes.misc.xsl.

This commit is contained in:
Hiroki Sato 2004-01-17 18:58:07 +00:00
parent 8644e2832c
commit 64ef5f2490
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=19700
3 changed files with 98 additions and 47 deletions

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/security/Makefile,v 1.9 2003/11/24 18:26:33 hrs Exp $
# $FreeBSD: www/en/security/Makefile,v 1.10 2004/01/13 22:44:07 hrs Exp $
.if exists(../Makefile.conf)
.include "../Makefile.conf"
@ -20,6 +20,5 @@ security.html: advisories.html.inc
advisories.html.inc: mkindex.xsl ${XML_ADVISORIES} ${XML_INCLUDES}
${XSLTPROC} ${XSLTPROCOPTS} -o ${.TARGET} \
--param "ftpbase" "'ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/'" \
--param "ftpbaseold" "'ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/old/'" \
--param "advisories.xml" "'${XML_ADVISORIES}'" \
${.CURDIR}/mkindex.xsl ${XML_ADVISORIES}

View file

@ -1,63 +1,27 @@
<?xml version="1.0"?>
<!-- $FreeBSD: www/en/security/mkindex.xsl,v 1.2 2003/10/11 07:12:58 hrs Exp $ -->
<!-- $FreeBSD: www/en/security/mkindex.xsl,v 1.3 2004/01/13 22:44:07 hrs Exp $ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="../includes.xsl"/>
<xsl:variable name="base" select="'.'"/>
<xsl:variable name="date" select="'$FreeBSD: www/en/security/mkindex.xsl,v 1.2 2003/10/11 07:12:58 hrs Exp $'"/>
<xsl:variable name="date" select="'$FreeBSD: www/en/security/mkindex.xsl,v 1.3 2004/01/13 22:44:07 hrs Exp $'"/>
<xsl:variable name="title" select="'untitled'"/>
<xsl:param name="ftpbase" select="''" />
<xsl:param name="ftpbaseold" select="''" />
<xsl:output type="xml" encoding="iso-8859-1"
omit-xml-declaration="yes" />
<xsl:template match="/">
<xsl:for-each select="descendant::release">
<xsl:param name="relname" select="string(name)" />
<xsl:param name="items" select="//advisory[$relname = string(following::release/name[1])]" />
<xsl:call-template name="putitems">
<xsl:with-param name="items" select="$items" />
</xsl:call-template>
<p><xsl:value-of select="name" /> released.</p>
</xsl:for-each>
<xsl:call-template name="putitems">
<xsl:with-param name="items" select="//advisory[not(following::release/name[1])]" />
<xsl:call-template name="html-list-advisories">
<xsl:with-param name="advisories.xml" select="$advisories.xml" />
</xsl:call-template>
</xsl:template>
<xsl:template name="putitems">
<xsl:param name="items" select="''" />
<xsl:template name="html-list-advisories-release-label">
<xsl:param name="relname" select="'none'" />
<xsl:if test="$items">
<ul>
<xsl:for-each select="$items">
<li>
<xsl:choose>
<xsl:when test="name/@role='old'">
<a><xsl:attribute name="href">
<xsl:value-of select="concat($ftpbaseold, name, '.asc')" />
</xsl:attribute>
<xsl:value-of select="concat(name, '.asc')" /></a>
</xsl:when>
<xsl:otherwise>
<a><xsl:attribute name="href">
<xsl:value-of select="concat($ftpbase, name, '.asc')" />
</xsl:attribute>
<xsl:value-of select="concat(name, '.asc')" /></a>
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:for-each>
</ul>
</xsl:if>
<p><xsl:value-of select="$relname" /> released.</p>
</xsl:template>
</xsl:stylesheet>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- $FreeBSD: www/share/sgml/includes.misc.xsl,v 1.3 2004/01/06 23:47:08 hrs Exp $ -->
<!-- $FreeBSD: www/share/sgml/includes.misc.xsl,v 1.4 2004/01/12 21:27:00 hrs Exp $ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
@ -12,6 +12,94 @@
<xsl:variable name="jdk" select="'JDK&#8482;'"/>
<xsl:variable name="posix" select="'POSIX&#174;'"/>
<!-- for security advisories -->
<xsl:variable name="ftpbase"
select="'ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/'"/>
<xsl:variable name="ftpbaseold"
select="'ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/old/'"/>
<!--
template name used in
html-list-advisories security/mkindex.xsl
html-list-advisories-putitems security/mkindex.xsl
html-list-advisories-release-label security/mkindex.xsl (for l10n)
html-index-advisories-items index.xsl
html-index-advisories-items-lastmodified index.xsl (for i10n)
html-index-news-project-items index.xsl
html-index-news-project-items-lastmodified index.xsl (for i10n)
html-index-news-press-items index.xsl
html-index-news-press-items-lastmodified index.xsl (for i10n)
html-index-mirrors-options-list index.xsl
-->
<!-- template: "html-list-advisories"
generate a list of all security advisories -->
<xsl:template name="html-list-advisories">
<xsl:param name="advisories.xml" select="'none'" />
<xsl:for-each select="document($advisories.xml)
/descendant::release">
<xsl:param name="relname" select="string(name)" />
<xsl:param name="items" select="document($advisories.xml)
//advisory[$relname = string(following::release/name[1])]" />
<xsl:call-template name="html-list-advisories-putitems">
<xsl:with-param name="items" select="$items" />
</xsl:call-template>
<xsl:call-template name="html-list-advisories-release-label">
<xsl:with-param name="relname" select="name" />
</xsl:call-template>
</xsl:for-each>
<xsl:call-template name="html-list-advisories-putitems">
<xsl:with-param name="items" select="document($advisories.xml)
//advisory[not(following::release/name[1])]" />
</xsl:call-template>
</xsl:template>
<!-- template: "html-list-advisories-putitems"
sub-routine to generate a list -->
<xsl:template name="html-list-advisories-putitems">
<xsl:param name="items" select="''" />
<xsl:if test="$items">
<ul>
<xsl:for-each select="$items">
<li>
<xsl:choose>
<xsl:when test="name/@role='old'">
<a><xsl:attribute name="href">
<xsl:value-of select="concat($ftpbaseold, name, '.asc')" />
</xsl:attribute>
<xsl:value-of select="concat(name, '.asc')" /></a>
</xsl:when>
<xsl:otherwise>
<a><xsl:attribute name="href">
<xsl:value-of select="concat($ftpbase, name, '.asc')" />
</xsl:attribute>
<xsl:value-of select="concat(name, '.asc')" /></a>
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:for-each>
</ul>
</xsl:if>
</xsl:template>
<!-- template: "html-list-advisories-release-label"
put label for release -->
<xsl:template name="html-list-advisories-release-label">
<xsl:param name="relname" select="'none'" />
<p><xsl:value-of select="$relname" /> released.</p>
</xsl:template>
<!-- template: "html-index-advisories-items"
pulls in the 10 most recent security advisories -->