Add support for $enbase in news.xml.

PR:		www/76403
Submitted by:	Rudolf Cejka <cejkar@fit.vutbr.cz>
Approved by: 	trhodes (mentor)
This commit is contained in:
Jesus R. Camou 2005-03-24 23:08:47 +00:00
parent 0753b2a8ff
commit 24f6b288fb
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=24164
2 changed files with 11 additions and 8 deletions

View file

@ -9,9 +9,9 @@
Each <event> contains an optional <title>, and then a <p>. <p> elements Each <event> contains an optional <title>, and then a <p>. <p> elements
can contain <a> anchors. Within the "href" attribute of the anchor can contain <a> anchors. Within the "href" attribute of the anchor
$base will be replaced with the base URI necessary to reach the FreeBSD $base or $enbase will be replaced with the base URI necessary to reach
document root, and should always be used to start URLs at www.FreeBSD.org the FreeBSD document root, and should always be used to start URLs at
or one of the mirrors. www.FreeBSD.org or one of the mirrors.
Use the <title> element if the <p> content is lengthy. When generating Use the <title> element if the <p> content is lengthy. When generating
synopses of this information (e.g., for syndication using RDF files), synopses of this information (e.g., for syndication using RDF files),
@ -21,7 +21,7 @@
<news> <news>
<cvs:keywords xmlns:cvs="http://www.FreeBSD.org/XML/CVS" version="1.0"> <cvs:keywords xmlns:cvs="http://www.FreeBSD.org/XML/CVS" version="1.0">
<cvs:keyword name="freebsd"> <cvs:keyword name="freebsd">
$FreeBSD: www/en/news/news.xml,v 1.281 2005/03/18 08:22:15 hrs Exp $ $FreeBSD: www/en/news/news.xml,v 1.282 2005/03/21 15:54:54 hrs Exp $
</cvs:keyword> </cvs:keyword>
</cvs:keywords> </cvs:keywords>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1" ?> <?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- $FreeBSD: www/en/news/newsflash.xsl,v 1.11 2004/04/08 19:11:49 ceri Exp $ --> <!-- $FreeBSD: www/en/news/newsflash.xsl,v 1.12 2004/12/30 17:53:43 hrs Exp $ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:cvs="http://www.FreeBSD.org/XML/CVS"> xmlns:cvs="http://www.FreeBSD.org/XML/CVS">
@ -79,16 +79,19 @@
</html> </html>
</xsl:template> </xsl:template>
<!-- When the href attribute contains a '$base', expand it to the current <!-- When the href attribute contains a '$base' or '$enbase', expand it
value of the $base variable. --> to the current value of the $base or $enbase variable. -->
<!-- All your $base are belong to us. Ho ho ho --> <!-- All your $base or $enbase are belong to us. Ho ho ho -->
<xsl:template match="a"> <xsl:template match="a">
<a><xsl:attribute name="href"> <a><xsl:attribute name="href">
<xsl:choose> <xsl:choose>
<xsl:when test="contains(@href, '$base')"> <xsl:when test="contains(@href, '$base')">
<xsl:value-of select="concat(substring-before(@href, '$base'), $base, substring-after(@href, '$base'))"/> <xsl:value-of select="concat(substring-before(@href, '$base'), $base, substring-after(@href, '$base'))"/>
</xsl:when> </xsl:when>
<xsl:when test="contains(@href, '$enbase')">
<xsl:value-of select="concat(substring-before(@href, '$enbase'), $enbase, substring-after(@href, '$enbase'))"/>
</xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="@href"/> <xsl:value-of select="@href"/>
</xsl:otherwise> </xsl:otherwise>