Add a new template: mirrors-lastmodified.

This commit is contained in:
Hiroki Sato 2003-11-24 20:06:38 +00:00
parent 7b4c21c46d
commit 5d2d4e1117
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=18980
2 changed files with 44 additions and 7 deletions
ja_JP.eucJP/share/sgml
share/sgml

View file

@ -13,6 +13,9 @@
<!-- these params should be externally bound. The values
here are not used actually -->
<xsl:param name="proto" select="''" />
<xsl:param name="target" select="''" />
<!-- template: "mirrors-docbook-contact" -->
<xsl:template name="mirrors-docbook-contact">
<xsl:param name="email" value="'someone@somewhere'"/>
@ -21,4 +24,12 @@
<para>問題がある場合は、このドメインのホストマスタ
<email><xsl:value-of select="$email" /></email> 宛にお問い合わせください。</para>
</xsl:template>
<!-- template: "mirrors-lastmodified" -->
<xsl:template name="mirrors-lastmodified">
<xsl:call-template name="mirrors-lastmodified-utc" />
<xsl:text> ¸½ºß</xsl:text>
</xsl:template>
</xsl:stylesheet>

View file

@ -12,25 +12,34 @@
<xsl:param name="proto" select="''" />
<xsl:param name="target" select="''" />
<xsl:param name="mirrors-docbook-country-anchor-id" select="translate($target, '/.', '--')" />
<xsl:variable name="date">
<xsl:value-of xmlns:cvs="http://www.FreeBSD.org/XML/CVS"
select="normalize-space(//cvs:keyword[@name='freebsd'])"/>
</xsl:variable>
<!--
templates available:
* "mirrors-lastmodified"
* "mirrors-docbook-contact"
* "mirrors-docbook-country-index-all"
* "mirrors-docbook-variablelist"
* "mirrors-docbook-itemizedlist"
-->
<xsl:template match="/mirrors">
<xsl:template match="/">
<xsl:choose>
<xsl:when test="$target = 'handbook/mirrors/chapter.sgml'">
<xsl:call-template name="mirrors-docbook-country-index-all" />
<para>(<xsl:call-template name="mirrors-lastmodified" />)</para>
<xsl:call-template name="mirrors-docbook-variablelist" />
</xsl:when>
<xsl:when test="$target = 'handbook/eresources/chapter.sgml'">
<xsl:call-template name="mirrors-docbook-country-index-all" />
<para>(<xsl:call-template name="mirrors-lastmodified" />)</para>
<xsl:call-template name="mirrors-docbook-itemizedlist" />
</xsl:when>
<xsl:otherwise>
@ -48,16 +57,23 @@
<email><xsl:value-of select="$email" /></email> for this domain.</para>
</xsl:template>
<!-- template: "mirrors-lastmodified" -->
<xsl:template name="mirrors-lastmodified">
<xsl:text>as of </xsl:text>
<xsl:call-template name="mirrors-lastmodified-utc" />
</xsl:template>
<!-- template: "mirrors-docbook-country-index-all" -->
<xsl:template name="mirrors-docbook-country-index-all">
<para>
<xsl:for-each select="entry[country/@role = 'primary' and
<xsl:for-each select="mirrors/entry[country/@role = 'primary' and
(url[contains(@proto, $proto)] or host[contains(@proto, $proto)])]">
<xsl:call-template name="mirrors-docbook-country-index" />
</xsl:for-each>
<xsl:for-each select="entry[country/@role != 'primary' and
<xsl:for-each select="mirrors/entry[country/@role != 'primary' and
(url[contains(@proto, $proto)] or host[contains(@proto, $proto)])]">
<xsl:sort select="country" />
@ -83,12 +99,12 @@
<xsl:template name="mirrors-docbook-variablelist">
<variablelist>
<xsl:for-each select="entry[country/@role = 'primary' and
<xsl:for-each select="mirrors/entry[country/@role = 'primary' and
(url[contains(@proto, $proto)] or host[contains(@proto, $proto)])]">
<xsl:call-template name="mirrors-docbook-variablelist-entry" />
</xsl:for-each>
<xsl:for-each select="entry[country/@role != 'primary' and
<xsl:for-each select="mirrors/entry[country/@role != 'primary' and
(url[contains(@proto, $proto)] or host[contains(@proto, $proto)])]">
<xsl:sort select="country" />
@ -141,12 +157,12 @@
<xsl:template name="mirrors-docbook-itemizedlist">
<itemizedlist>
<xsl:for-each select="entry[country/@role = 'primary' and
<xsl:for-each select="mirrors/entry[country/@role = 'primary' and
(url[contains(@proto, $proto)] or host[contains(@proto, $proto)])]">
<xsl:call-template name="mirrors-docbook-itemizedlist-listitem" />
</xsl:for-each>
<xsl:for-each select="entry[country/@role != 'primary' and
<xsl:for-each select="mirrors/entry[country/@role != 'primary' and
(url[contains(@proto, $proto)] or host[contains(@proto, $proto)])]">
<xsl:sort select="country" />
@ -181,4 +197,14 @@
</itemizedlist>
</listitem>
</xsl:template>
<!-- template: "mirrors-lastmodified-utc" -->
<xsl:template name="mirrors-lastmodified-utc">
<xsl:param name="basestr" select="substring-after(substring-after($date, ',v '), ' ')" />
<xsl:param name="datestr" select="substring-before($basestr, ' ')" />
<xsl:param name="timestr" select="substring-before(substring-after($basestr, ' '), ' ')" />
<xsl:value-of select="concat($datestr, ' ', $timestr, ' UTC')" />
</xsl:template>
</xsl:stylesheet>