- Properly copy XHTML fragments by adding namespace

- Allow disabling last modified date by setting the date variable to
  empty text
- Only disable last modified date in old news, press, events pages since
  it makes sense for recent entries

Approved by:	doceng (implicit)
This commit is contained in:
Gabor Kovesdan 2012-08-15 21:50:43 +00:00
parent 06db13014c
commit f77daa56e0
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/projects/sgml2xml/; revision=39383
24 changed files with 84 additions and 45 deletions

View file

@ -6,7 +6,10 @@
basiert auf: r38826
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/libcommon.xsl"/>
<xsl:template name="html-news-list-newsflash-preface">

View file

@ -9,6 +9,7 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdf1="http://my.netscape.com/rdf/simple/0.9/"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="rdf rdf1" version="1.0">
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
@ -49,7 +50,7 @@
<xsl:value-of select="title"/><br/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="p"/><br/>
<xsl:apply-templates select="p" mode="copy.html"/><br/>
</xsl:otherwise>
</xsl:choose>
</a></li>

View file

@ -86,7 +86,7 @@
<xsl:text> </xsl:text>
<xsl:value-of select="ancestor::month/name"/>,
<xsl:value-of select="ancestor::year/name"/>:</b><xsl:text> </xsl:text>
<xsl:copy-of select="p"/>
<xsl:apply-templates select="p" mode="copy.html"/>
</p>
</li>

View file

@ -83,9 +83,8 @@
<xsl:value-of select="ancestor::year/name"/>:</b><xsl:text> </xsl:text>
<xsl:value-of select="title"/>
</p>
<xsl:copy-of select="p"/>
<xsl:apply-templates select="p" mode="copy.html"/>
</li>
</xsl:template>
<xsl:template match="date"/> <!-- Deliberately left blank -->
</xsl:stylesheet>

View file

@ -76,7 +76,7 @@
<xsl:template match="section">
<h1><xsl:value-of select="title"/></h1>
<xsl:copy-of select="p"/>
<xsl:apply-templates select="p" mode="copy.html"/>
</xsl:template>
<!-- A project creates a header, and then process the three components of
@ -129,14 +129,14 @@
<!-- Body is a doddle. Since it contains HTML we just copy in all the
child elements. -->
<xsl:template match="body">
<xsl:copy-of select="child::node()"/>
<xsl:apply-templates select="child::node()" mode="copy.html"/>
</xsl:template>
<xsl:template match="help">
<h3>Open tasks:</h3>
<ol>
<xsl:for-each select="task">
<li><xsl:copy-of select="child::node()"/></li>
<li><xsl:apply-templates select="child::node()" mode="copy.html"/></li>
</xsl:for-each>
</ol>
</xsl:template>

View file

@ -2,8 +2,8 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cvs="http://www.FreeBSD.org/XML/CVS"
exclude-result-prefixes="rdf cvs"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="rdf"
version="1.0">
<xsl:output

View file

@ -2,8 +2,8 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cvs="http://www.FreeBSD.org/XML/CVS"
exclude-result-prefixes="rdf cvs"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="rdf"
version="1.0">
<xsl:output

View file

@ -2,8 +2,8 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cvs="http://www.FreeBSD.org/XML/CVS"
exclude-result-prefixes="rdf cvs"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="rdf"
version="1.0">
<xsl:output

View file

@ -2,8 +2,8 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cvs="http://www.FreeBSD.org/XML/CVS"
exclude-result-prefixes="rdf cvs"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="rdf"
version="1.0">
<xsl:output

View file

@ -3,7 +3,10 @@
"http://www.FreeBSD.org/XML/www/share/sgml/xslt10-freebsd.dtd">
<!-- $FreeBSD$ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/libcommon.xsl"/>
<xsl:template name="html-news-list-newsflash-preface">

View file

@ -261,7 +261,7 @@
<xsl:with-param name="enddate" select="enddate" />
</xsl:call-template>
</em><br/>
<xsl:copy-of select="description/child::node()"/>
<xsl:apply-templates select="description/child::node()" mode="copy.html"/>
</p>
<xsl:if test="link">
<p><xsl:apply-templates select="link"/></p>

View file

@ -19,6 +19,9 @@
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/xhtml.xsl"/>
<!-- Do not add last modified date for old news/press -->
<xsl:variable name="date"/>
<xsl:variable name="title">&title;</xsl:variable>
<xsl:variable name="year">
@ -26,7 +29,7 @@
</xsl:variable>
<xsl:template match="p">
<xsl:copy-of select="." />
<xsl:apply-templates select="." mode="copy.html"/>
</xsl:template>
<xsl:template name="process.sidewrap">
@ -98,7 +101,7 @@
<xsl:value-of select="ancestor::day/name"/>:</b><xsl:text> </xsl:text>
<xsl:for-each select="p">
<xsl:if test="position() &gt; 1"><br /><br /></xsl:if>
<xsl:copy-of select="child::node()" />
<xsl:apply-templates select="child::node()" mode="copy.html"/>
</xsl:for-each>
</p>

View file

@ -19,6 +19,9 @@
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/xhtml.xsl"/>
<!-- Do not add last modified date for old news/press -->
<xsl:variable name="date"/>
<xsl:variable name="title">&title;</xsl:variable>
<xsl:variable name="year">
@ -82,7 +85,7 @@
<a href="{$site-url}"><xsl:value-of
select="site-name"/></a>, <xsl:value-of select="author"/><br/>
<xsl:copy-of select="p/child::node()"/>
<xsl:apply-templates select="p/child::node()" mode="copy.html"/>
</p>
</li>
</xsl:template>

View file

@ -48,6 +48,9 @@
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/xhtml.xsl"/>
<!-- Do not add last modified date for old news/press -->
<xsl:variable name="date"/>
<xsl:param name="pastyears">2008 2007 2006 2005 2004 2003</xsl:param>
<xsl:key name="event-by-month" match="event"
@ -217,7 +220,7 @@
<xsl:with-param name="enddate" select="enddate" />
</xsl:call-template>
</em><br/>
<xsl:copy-of select="description/child::node()"/>
<xsl:apply-templates select="description/child::node()" mode="copy.html"/>
</p>
<xsl:if test="link">
<p><xsl:apply-templates select="link"/></p>

View file

@ -255,7 +255,7 @@
<xsl:with-param name="enddate" select="enddate" />
</xsl:call-template>
</em><br/>
<xsl:copy-of select="description/child::node()"/>
<xsl:apply-templates select="description/child::node()" mode="copy.html"/>
</p>
<xsl:if test="link">
<p><xsl:apply-templates select="link"/></p>

View file

@ -15,6 +15,9 @@
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/xhtml.xsl"/>
<!-- Do not add last modified date for old news/press -->
<xsl:variable name="date"/>
<xsl:variable name="title">&title;</xsl:variable>
<xsl:variable name="year">
@ -22,7 +25,7 @@
</xsl:variable>
<xsl:template match="p">
<xsl:copy-of select="." />
<xsl:apply-templates select="." mode="copy.html"/>
</xsl:template>
<xsl:template name="process.sidewrap">
@ -95,13 +98,10 @@
<xsl:text> Ćü</xsl:text>:</b><xsl:text> </xsl:text>
<xsl:for-each select="p">
<xsl:if test="position() &gt; 1"><br /><br /></xsl:if>
<xsl:copy-of select="child::node()" />
<xsl:apply-templates select="child::node()" mode="copy.html"/>
</xsl:for-each>
</p>
</li>
</xsl:template>
<xsl:template match="date"/> <!-- Deliberately left blank -->
</xsl:stylesheet>

View file

@ -15,6 +15,9 @@
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/xhtml.xsl"/>
<!-- Do not add last modified date for old news/press -->
<xsl:variable name="date"/>
<xsl:variable name="title">&title;</xsl:variable>
<xsl:variable name="year">
@ -82,7 +85,7 @@
<a href="{$site-url}"><xsl:value-of
select="site-name"/></a>, <xsl:value-of select="author"/><br/>
<xsl:copy-of select="p/child::node()"/>
<xsl:apply-templates select="p/child::node()" mode="copy.html"/>
</p>
</li>
</xsl:template>

View file

@ -261,7 +261,7 @@
<xsl:with-param name="enddate" select="enddate" />
</xsl:call-template>
</em><br/>
<xsl:copy-of select="description/child::node()"/>
<xsl:apply-templates select="description/child::node()" mode="copy.html"/>
</p>
<xsl:if test="link">
<p><xsl:apply-templates select="link"/></p>

View file

@ -15,7 +15,7 @@
<xsl:import href="./transtable-common.xsl" />
<xsl:variable name="svnKeyword">
<xsl:value-of select="//cvs:keyword[1]"/>
<xsl:value-of select="normalize-space(//cvs:keyword[1])"/>
</xsl:variable>
<xsl:variable name="date">
@ -36,6 +36,16 @@
<xsl:variable name="curdate.month" select="date:month-in-year()"/>
<xsl:variable name="curdate.day" select="date:day-in-month()"/>
<!--
Used to copy HTML chunks to the output.
-->
<xsl:template match="*" mode="copy.html">
<xsl:element name="{local-name()}" namespace="http://www.w3.org/1999/xhtml">
<xsl:copy-of select="attribute::*"/>
<xsl:apply-templates select="child::node()" mode="copy.html"/>
</xsl:element>
</xsl:template>
<!--
template name used in
@ -203,15 +213,15 @@
[count(.|key('html-usergroups-id-key', string($id)))
= count(key('html-usergroups-id-key', string($id)))]
">
<xsl:copy-of select="
<xsl:apply-templates select="
key('html-usergroups-regions-key', string($continent))
[count(.|key('html-usergroups-id-key', string($id)))
= count(key('html-usergroups-id-key', string($id)))]/description/node()
" />
" mode="copy.html"/>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="document($usergroups.xml)">
<xsl:copy-of select="key('html-usergroups-id-key', string($id))/description/node()" />
<xsl:apply-templates select="key('html-usergroups-id-key', string($id))/description/node()" mode="copy.html"/>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
@ -576,7 +586,7 @@
<xsl:text> </xsl:text>
<xsl:for-each select="p">
<xsl:if test="position() &gt; 1"><br /><br /></xsl:if>
<xsl:copy-of select="child::node()" />
<xsl:apply-templates select="child::node()" mode="copy.html"/>
</xsl:for-each>
</p>
</li>
@ -612,7 +622,7 @@
<xsl:text> </xsl:text>
<xsl:for-each select="p">
<xsl:if test="position() &gt; 1"><br /><br /></xsl:if>
<xsl:copy-of select="child::node()" />
<xsl:apply-templates select="child::node()" mode="copy.html"/>
</xsl:for-each>
</p>
</li>
@ -673,7 +683,7 @@
<a href="{$url}"><b><xsl:value-of select="name"/></b></a><br/>
<a href="{$site-url}"><xsl:value-of select="site-name"/></a>,
<xsl:value-of select="author"/><br/>
<xsl:copy-of select="p/child::node()"/>
<xsl:apply-templates select="p/child::node()" mode="copy.html"/>
</p>
</li>
</xsl:for-each>
@ -694,7 +704,7 @@
<a href="{$url}"><b><xsl:value-of select="name"/></b></a><br/>
<a href="{$site-url}"><xsl:value-of select="site-name"/></a>,
<xsl:value-of select="author"/><br/>
<xsl:copy-of select="p/child::node()"/>
<xsl:apply-templates select="p/child::node()" mode="copy.html"/>
</p>
</li>
</xsl:for-each>

View file

@ -105,7 +105,7 @@
<xsl:value-of select="name"/>
</xsl:element></dt>
<dd><xsl:copy-of select="description/child::node()" /></dd>
<dd><xsl:apply-templates select="description/child::node()" mode="copy.html"/></dd>
</xsl:for-each>
</dl>
</xsl:otherwise>

View file

@ -13,6 +13,9 @@
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/xhtml.xsl"/>
<!-- Do not add last modified date for old news/press -->
<xsl:variable name="date"/>
<xsl:variable name="year">
<xsl:value-of select="descendant::year/name"/>
</xsl:variable>
@ -104,7 +107,7 @@
<xsl:value-of select="ancestor::year/name"/>:</b><xsl:text> </xsl:text>
<xsl:for-each select="p">
<xsl:if test="position() &gt; 1"><br /><br /></xsl:if>
<xsl:copy-of select="child::node()" />
<xsl:apply-templates select="child::node()" mode="copy.html"/>
</xsl:for-each>
</p>

View file

@ -13,6 +13,9 @@
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/xhtml.xsl"/>
<!-- Do not add last modified date for old news/press -->
<xsl:variable name="date"/>
<xsl:variable name="title">&title;</xsl:variable>
<xsl:variable name="year">
@ -78,7 +81,7 @@
<a href="{$site-url}"><xsl:value-of
select="site-name"/></a>, <xsl:value-of select="author"/><br/>
<xsl:copy-of select="p/child::node()"/>
<xsl:apply-templates select="p/child::node()" mode="copy.html"/>
</p>
</li>
</xsl:template>

View file

@ -42,6 +42,9 @@
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/xhtml.xsl"/>
<!-- Do not add last modified date for old news/press -->
<xsl:variable name="date"/>
<xsl:param name="pastyears">2003 2004 2005 2006</xsl:param>
<xsl:key name="event-by-month" match="event"
@ -214,7 +217,7 @@
<xsl:with-param name="enddate" select="enddate" />
</xsl:call-template>
</em><br/>
<xsl:copy-of select="description/child::node()"/>
<xsl:apply-templates select="description/child::node()" mode="copy.html"/>
</p>
<xsl:if test="link">
<p><xsl:apply-templates select="link"/></p>

View file

@ -17,7 +17,7 @@
<xsl:variable name="rsstitle" select="''"/>
<xsl:variable name="svnKeyword">
<xsl:value-of select="//cvs:keyword[1]"/>
<xsl:value-of select="normalize-space(//cvs:keyword[1])"/>
</xsl:variable>
<xsl:variable name="date">
@ -170,6 +170,8 @@ parameters. Changing them will result in rendering errors.
<xsl:template name="process.footer">
&copyright;<br/>
&lastmod; <xsl:value-of select="$date"/>
<xsl:if test="$date != ''">
&lastmod; <xsl:value-of select="$date"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>