- Extend xhtml.xsl instead of duplicating common structural parts
Approved by: doceng (implicit)
This commit is contained in:
parent
aa5fd185bc
commit
a77096151d
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/projects/sgml2xml/; revision=39220
8 changed files with 36 additions and 240 deletions
|
@ -12,9 +12,7 @@
|
|||
xmlns:cvs="http://www.FreeBSD.org/XML/CVS"
|
||||
exclude-result-prefixes="cvs">
|
||||
|
||||
<xsl:variable name="date">
|
||||
<xsl:value-of select="//cvs:keyword[@name='freebsd']"/>
|
||||
</xsl:variable>
|
||||
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/xhtml.xsl"/>
|
||||
|
||||
<xsl:param name="basename" select="'none'" />
|
||||
<xsl:param name="sort" select="'none'" />
|
||||
|
@ -22,19 +20,7 @@
|
|||
<xsl:variable name="uc" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
|
||||
<xsl:variable name="lc" select="'abcdefghijklmnopqrstuvwxyz'"/>
|
||||
|
||||
<xsl:output method="xml" encoding="&xml.encoding;"
|
||||
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
|
||||
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
|
||||
|
||||
<xsl:template match="/entries">
|
||||
<html>
|
||||
&header1;
|
||||
<body>
|
||||
<div id="containerwrap">
|
||||
<div id="container">
|
||||
&header2;
|
||||
|
||||
<div id="content">
|
||||
<xsl:template name="process.content">
|
||||
<div id="SIDEWRAP">
|
||||
&nav;
|
||||
</div> <!-- SIDEWRAP -->
|
||||
|
@ -42,25 +28,15 @@
|
|||
<div id="contentwrap">
|
||||
&header3;
|
||||
|
||||
<xsl:for-each select="/entries">
|
||||
<xsl:call-template name="html-commercial-preface" />
|
||||
|
||||
<xsl:call-template name="html-commercial-listing" />
|
||||
</xsl:for-each>
|
||||
|
||||
</div> <!-- contentwrap -->
|
||||
|
||||
<br class="clearboth" />
|
||||
|
||||
</div> <!-- content -->
|
||||
|
||||
<div id="FOOTER">
|
||||
©right;<br />
|
||||
&date;
|
||||
</div> <!-- FOOTER -->
|
||||
|
||||
</div> <!-- container -->
|
||||
</div> <!-- containerwrap -->
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="html-commercial-preface">
|
||||
|
|
|
@ -44,14 +44,7 @@
|
|||
exclude-result-prefixes="cvs">
|
||||
|
||||
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
|
||||
|
||||
<xsl:variable name="date">
|
||||
<xsl:value-of select="//cvs:keyword[@name='freebsd']"/>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:output method="xml" encoding="&xml.encoding;"
|
||||
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
|
||||
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
|
||||
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/xhtml.xsl"/>
|
||||
|
||||
<xsl:param name="startyear">2007</xsl:param>
|
||||
<xsl:param name="pastyears">2003 2004 2005 2006</xsl:param>
|
||||
|
@ -72,8 +65,7 @@
|
|||
|
||||
<xsl:variable name="charturl" select="'http://chart.apis.google.com/chart?cht=t&chs=400x200&chtm=world&chco=ffffff,ffbe38,600000&chf=bg,s,4D89F9'" />
|
||||
|
||||
<!-- Template: events -->
|
||||
<xsl:template match="events">
|
||||
<xsl:template name="process.content">
|
||||
<xsl:variable name="chart-countries">
|
||||
<xsl:for-each select="event[
|
||||
generate-id() =
|
||||
|
@ -95,16 +87,6 @@
|
|||
|
||||
<xsl:variable name="imageurl"><xsl:value-of select="$charturl"/>&chd=t:<xsl:value-of select="$chart-country-counts"/>&chld=<xsl:value-of select="$chart-countries"/></xsl:variable>
|
||||
|
||||
<html>
|
||||
&header1;
|
||||
|
||||
<body>
|
||||
|
||||
<div id="containerwrap">
|
||||
<div id="container">
|
||||
&header2;
|
||||
|
||||
<div id="content">
|
||||
<div id="SIDEWRAP">
|
||||
&nav;
|
||||
<div id="FEEDLINKS">
|
||||
|
@ -131,6 +113,7 @@
|
|||
format-number($curdate.day, '00'))"/>
|
||||
</xsl:comment>
|
||||
|
||||
<xsl:for-each select="/events">
|
||||
<xsl:call-template name="html-events-list-preface" />
|
||||
|
||||
<xsl:call-template name="html-events-map">
|
||||
|
@ -138,8 +121,9 @@
|
|||
</xsl:call-template>
|
||||
|
||||
<xsl:call-template name="html-events-list-upcoming-heading" />
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:for-each select="event[generate-id() =
|
||||
<xsl:for-each select="/events/event[generate-id() =
|
||||
generate-id(key('event-by-month',
|
||||
concat(startdate/year, format-number(startdate/month, '00')))[1])
|
||||
and ((number(enddate/year) > number($curdate.year)) or
|
||||
|
@ -176,9 +160,11 @@
|
|||
</ul>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:for-each select="/events">
|
||||
<xsl:call-template name="html-events-list-past-heading" />
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:for-each select="event[generate-id() =
|
||||
<xsl:for-each select="/events/event[generate-id() =
|
||||
generate-id(key('event-by-month', concat(startdate/year,
|
||||
format-number(startdate/month, '00')))[1])
|
||||
and ((number(enddate/year) >= $startyear)) and
|
||||
|
@ -219,24 +205,16 @@
|
|||
<p>Events from past years:</p>
|
||||
|
||||
<ul id="events-past-years">
|
||||
<xsl:for-each select="/events">
|
||||
<xsl:call-template name="split-string">
|
||||
<xsl:with-param name="seperator" select="' '"/>
|
||||
<xsl:with-param name="text" select="$pastyears"/>
|
||||
</xsl:call-template>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
</div> <!-- contentwrap -->
|
||||
|
||||
<br class="clearboth" />
|
||||
</div> <!-- content -->
|
||||
|
||||
<div id="FOOTER">
|
||||
©right;<br />
|
||||
&date;
|
||||
</div> <!-- FOOTER -->
|
||||
</div> <!-- container -->
|
||||
</div> <!-- containerwrap -->
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Template: event -->
|
||||
|
|
|
@ -14,26 +14,12 @@
|
|||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:cvs="http://www.FreeBSD.org/XML/CVS">
|
||||
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
|
||||
|
||||
<xsl:variable name="date">
|
||||
<xsl:value-of select="//cvs:keyword[@name='freebsd']"/>
|
||||
</xsl:variable>
|
||||
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/xhtml.xsl"/>
|
||||
|
||||
<xsl:param name="news.project.xml-master" select="'none'" />
|
||||
<xsl:param name="news.project.xml" select="'none'" />
|
||||
|
||||
<xsl:output type="html" encoding="&xml.encoding;"/>
|
||||
|
||||
<xsl:template match="news">
|
||||
<html>
|
||||
&header1;
|
||||
<body>
|
||||
|
||||
<div id="CONTAINERWRAP">
|
||||
<div id="CONTAINER">
|
||||
&header2;
|
||||
|
||||
<div id="CONTENT">
|
||||
<xsl:template name="process.content">
|
||||
<div id="SIDEWRAP">
|
||||
&nav;
|
||||
<div id="FEEDLINKS">
|
||||
|
@ -55,6 +41,7 @@
|
|||
<div id="CONTENTWRAP">
|
||||
&header3;
|
||||
|
||||
<xsl:for-each select="/news">
|
||||
<xsl:call-template name="html-news-list-newsflash-preface" />
|
||||
|
||||
<xsl:call-template name="html-news-list-newsflash">
|
||||
|
@ -65,19 +52,9 @@
|
|||
<xsl:call-template name="html-news-make-olditems-list" />
|
||||
|
||||
<xsl:call-template name="html-news-list-newsflash-homelink" />
|
||||
</xsl:for-each>
|
||||
|
||||
</div> <!-- CONTENTWRAP -->
|
||||
<br class="clearboth" />
|
||||
</div> <!-- CONTENT -->
|
||||
|
||||
<div id="FOOTER">
|
||||
©right;<br />
|
||||
&date;
|
||||
</div> <!-- FOOTER -->
|
||||
</div> <!-- CONTAINER -->
|
||||
</div> <!-- CONTAINERWRAP -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
|
|
@ -12,33 +12,17 @@
|
|||
xmlns:cvs="http://www.FreeBSD.org/XML/CVS">
|
||||
|
||||
<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"/>
|
||||
|
||||
<xsl:variable name="year">
|
||||
<xsl:value-of select="descendant::year/name"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="date">
|
||||
<xsl:value-of select="//cvs:keyword[@name='freebsd']"/>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:output type="html" encoding="&xml.encoding;"/>
|
||||
|
||||
<xsl:template match="p">
|
||||
<xsl:copy-of select="." />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="news">
|
||||
<html>
|
||||
|
||||
&header1;
|
||||
|
||||
<body>
|
||||
|
||||
<div id="CONTAINERWRAP">
|
||||
<div id="CONTAINER">
|
||||
|
||||
&header2;
|
||||
|
||||
<div id="CONTENT">
|
||||
<xsl:template name="process.content">
|
||||
<div id="SIDEWRAP">
|
||||
&nav;
|
||||
</div> <!-- SIDEWRAP -->
|
||||
|
@ -82,20 +66,6 @@
|
|||
<a href="&base;/news/news.html">News Home</a>
|
||||
</div> <!-- CONTENTWRAP -->
|
||||
<br class="clearboth" />
|
||||
|
||||
</div> <!-- CONTENT -->
|
||||
|
||||
<div id="FOOTER">
|
||||
©right;<br />
|
||||
&date;
|
||||
|
||||
</div> <!-- FOOTER -->
|
||||
|
||||
</div> <!-- CONTAINER -->
|
||||
</div> <!-- CONTAINERWRAP -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Everything that follows are templates for the rest of the content -->
|
||||
|
|
|
@ -12,30 +12,13 @@
|
|||
xmlns:cvs="http://www.FreeBSD.org/XML/CVS">
|
||||
|
||||
<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"/>
|
||||
|
||||
<xsl:variable name="year">
|
||||
<xsl:value-of select="descendant::year/name"/>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="date">
|
||||
<xsl:value-of select="//cvs:keyword[@name='freebsd']"/>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:output type="html" encoding="&xml.encoding;"/>
|
||||
|
||||
<xsl:template match="press">
|
||||
<html>
|
||||
|
||||
&header1;
|
||||
|
||||
<body>
|
||||
|
||||
<div id="CONTAINERWRAP">
|
||||
<div id="CONTAINER">
|
||||
|
||||
&header2;
|
||||
|
||||
<div id="CONTENT">
|
||||
<xsl:template name="process.content">
|
||||
<div id="SIDEWRAP">
|
||||
&nav;
|
||||
</div> <!-- SIDEWRAP -->
|
||||
|
@ -63,19 +46,6 @@
|
|||
<a href="&base;/news/news.html">News Home</a>
|
||||
</div> <!-- CONTENTWRAP -->
|
||||
<br class="clearboth" />
|
||||
|
||||
</div> <!-- CONTENT -->
|
||||
|
||||
<div id="FOOTER">
|
||||
©right;<br />
|
||||
&date;
|
||||
</div> <!-- FOOTER -->
|
||||
|
||||
</div> <!-- CONTAINER -->
|
||||
</div> <!-- CONTAINERWRAP -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Everything that follows are templates for the rest of the content -->
|
||||
|
|
|
@ -44,14 +44,7 @@
|
|||
exclude-result-prefixes="cvs">
|
||||
|
||||
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
|
||||
|
||||
<xsl:variable name="date">
|
||||
<xsl:value-of select="//cvs:keyword[@name='freebsd']"/>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:output method="xml" encoding="&xml.encoding;"
|
||||
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
|
||||
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
|
||||
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/xhtml.xsl"/>
|
||||
|
||||
<xsl:param name="pastyears">2003 2004 2005 2006</xsl:param>
|
||||
|
||||
|
@ -71,8 +64,8 @@
|
|||
|
||||
<xsl:variable name="charturl" select="'http://chart.apis.google.com/chart?cht=t&chs=400x200&chtm=world&chco=ffffff,ffbe38,600000&chf=bg,s,4D89F9'" />
|
||||
|
||||
<!-- Template: events -->
|
||||
<xsl:template match="events">
|
||||
<xsl:template name="process.content">
|
||||
|
||||
<xsl:variable name="chart-countries">
|
||||
<xsl:for-each select="event[
|
||||
generate-id() =
|
||||
|
@ -94,16 +87,6 @@
|
|||
|
||||
<xsl:variable name="imageurl"><xsl:value-of select="$charturl"/>&chd=t:<xsl:value-of select="$chart-country-counts"/>&chld=<xsl:value-of select="$chart-countries"/></xsl:variable>
|
||||
|
||||
<html>
|
||||
&header1;
|
||||
|
||||
<body>
|
||||
|
||||
<div id="containerwrap">
|
||||
<div id="container">
|
||||
&header2;
|
||||
|
||||
<div id="content">
|
||||
<div id="SIDEWRAP">
|
||||
&nav;
|
||||
<div id="FEEDLINKS">
|
||||
|
@ -130,6 +113,7 @@
|
|||
format-number($curdate.day, '00'))"/>
|
||||
</xsl:comment>
|
||||
|
||||
<xsl:for-each select="/events">
|
||||
<xsl:call-template name="html-events-list-preface" />
|
||||
|
||||
<xsl:call-template name="html-events-map">
|
||||
|
@ -138,8 +122,9 @@
|
|||
|
||||
<!-- with parameter $year here? -->
|
||||
<xsl:call-template name="html-events-list-past-heading" />
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:for-each select="event[generate-id() =
|
||||
<xsl:for-each select="/events/event[generate-id() =
|
||||
generate-id(key('event-by-month', concat(startdate/year,
|
||||
format-number(startdate/month, '00')))[1])
|
||||
and ((number(enddate/year) = $year))]">
|
||||
|
@ -176,25 +161,17 @@
|
|||
<p>Events from past years:</p>
|
||||
|
||||
<ul id="events-past-years">
|
||||
<xsl:for-each select="/events">
|
||||
<xsl:call-template name="split-string">
|
||||
<xsl:with-param name="seperator" select="' '"/>
|
||||
<xsl:with-param name="text" select="$pastyears"/>
|
||||
</xsl:call-template>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
|
||||
</div> <!-- contentwrap -->
|
||||
|
||||
<br class="clearboth" />
|
||||
</div> <!-- content -->
|
||||
|
||||
<div id="FOOTER">
|
||||
©right;<br />
|
||||
&date;
|
||||
</div> <!-- FOOTER -->
|
||||
</div> <!-- container -->
|
||||
</div> <!-- containerwrap -->
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Template: event -->
|
||||
|
|
|
@ -15,27 +15,12 @@
|
|||
xmlns:cvs="http://www.FreeBSD.org/XML/CVS">
|
||||
|
||||
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
|
||||
|
||||
<xsl:variable name="date">
|
||||
<xsl:value-of select="//cvs:keyword[@name='freebsd']"/>
|
||||
</xsl:variable>
|
||||
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/xhtml.xsl"/>
|
||||
|
||||
<xsl:param name="news.press.xml-master" select="'none'" />
|
||||
<xsl:param name="news.press.xml" select="'none'" />
|
||||
|
||||
<xsl:output type="html" encoding="&xml.encoding;"/>
|
||||
|
||||
<xsl:template match="press">
|
||||
<html>
|
||||
&header1;
|
||||
<body>
|
||||
|
||||
<div id="CONTAINERWRAP">
|
||||
<div id="CONTAINER">
|
||||
|
||||
&header2;
|
||||
|
||||
<div id="CONTENT">
|
||||
<xsl:template name="process.content">
|
||||
<div id="SIDEWRAP">
|
||||
&nav;
|
||||
<div id="FEEDLINKS">
|
||||
|
@ -53,6 +38,7 @@
|
|||
|
||||
&header3;
|
||||
|
||||
<xsl:for-each select="/press">
|
||||
<xsl:call-template name="html-news-list-press-preface" />
|
||||
|
||||
<xsl:call-template name="html-news-list-press">
|
||||
|
@ -63,21 +49,9 @@
|
|||
<xsl:call-template name="html-press-make-olditems-list" />
|
||||
|
||||
<xsl:call-template name="html-news-list-newsflash-homelink" />
|
||||
</xsl:for-each>
|
||||
|
||||
</div> <!-- CONTENTWRAP -->
|
||||
<br class="clearboth" />
|
||||
|
||||
</div> <!-- CONTENT -->
|
||||
|
||||
<div id="FOOTER">
|
||||
©right;<br />
|
||||
&date;
|
||||
</div> <!-- FOOTER -->
|
||||
|
||||
</div> <!-- CONTAINER -->
|
||||
</div> <!-- CONTAINERWRAP -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
|
|
@ -12,30 +12,14 @@
|
|||
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" encoding="&xml.encoding;"
|
||||
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
|
||||
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
|
||||
|
||||
<xsl:variable name="date">
|
||||
<xsl:value-of select="//cvs:keyword[@name='freebsd']"/>
|
||||
</xsl:variable>
|
||||
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/xhtml.xsl"/>
|
||||
|
||||
<xsl:key name="usergroup-by-country" match="entry"
|
||||
use="../@code" />
|
||||
|
||||
<xsl:variable name="charturl" select="'http://chart.apis.google.com/chart?cht=t&chs=400x200&chtm=world&chco=ffffff,ffbe38,600000&chf=bg,s,4D89F9'" />
|
||||
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
&header1;
|
||||
|
||||
<body>
|
||||
<div id="CONTAINERWRAP">
|
||||
<div id="CONTAINER">
|
||||
&header2;
|
||||
|
||||
<div id="CONTENT">
|
||||
<xsl:template name="process.content">
|
||||
<div id="SIDEWRAP">
|
||||
&nav;
|
||||
</div> <!-- SIDEWRAP -->
|
||||
|
@ -81,15 +65,5 @@
|
|||
</div> <!-- CONTENTWRAP -->
|
||||
|
||||
<br class="clearboth" />
|
||||
</div> <!-- CONTENT -->
|
||||
|
||||
<div id="FOOTER">
|
||||
©right;<br />
|
||||
&date;
|
||||
</div> <!-- FOOTER -->
|
||||
</div> <!-- CONTAINER -->
|
||||
</div> <!-- CONTAINERWRAP -->
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
|
Loading…
Reference in a new issue