Date: Thu, 27 Sep 2001 23:50:47 +0100 From: Nik Clayton <nik@freebsd.org> To: Chris Costello <chris@FreeBSD.ORG> Cc: Nik Clayton <nik@FreeBSD.ORG>, "Gary W. Swearingen" <swear@blarg.net>, Jun Kuriyama <kuriyama@imgsrc.co.jp>, doc@FreeBSD.ORG Subject: Re: Branching www/ for XML development Message-ID: <20010927235047.B36549@clan.nothing-going-on.org> In-Reply-To: <20010927160943.A41373@holly.calldei.com>; from chris@FreeBSD.ORG on Thu, Sep 27, 2001 at 04:09:43PM -0500 References: <20010921001517.N1162@clan.nothing-going-on.org> <20010922113521.W1162@clan.nothing-going-on.org> <20010925173240.F31744@clan.nothing-going-on.org> <7m1ykud8oh.wl@waterblue.imgsrc.co.jp> <20010926125652.S31744@clan.nothing-going-on.org> <pp4rppvmm1.rpp@localhost.localdomain> <20010927132714.E31744@clan.nothing-going-on.org> <20010927160943.A41373@holly.calldei.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Thu, Sep 27, 2001 at 04:09:43PM -0500, Chris Costello wrote:
> On Thursday, September 27, 2001, Nik Clayton wrote:
> > This is actually pretty easy to do. We just change the stylesheet, and
> > generate a new set of pages with a different, simpler, stylesheet.
> > Providing a "Print this page" link on each page would be trivial.
>
> In the case of status reports, for example (and probably the only
> example), will the stylesheets need to simply be aware of the
> style of the Web pages, or (more appropriately in my opinion)
> generate XML files in the style of your layout, e.g.
The latter.
Here's the XSL I used to generate
http://people.freebsd.org/~nik/xml-test/news/press.html
Note the bit of code that does the
<sidebar class="related-web">
...
</sidebar>
That's all that was needed to create the list of "Web links" on the
aforementioned press.html page. Note that this .xsl file is a sample
work in progress, and doesn't take in to account some of the things I
brought up in my earlier note.
N
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- $FreeBSD: www/en/news/press.xsl,v 1.1 2001/08/10 10:31:44 nik Exp $ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="../includes.xsl"/>
<xsl:import href="includes.xsl"/>
<xsl:variable name="title" select="'FreeBSD In The Press'"/>
<xsl:variable name="date" select="'$FreeBSD: www/en/news/press.xsl,v 1.1 2001/08/10 10:31:44 nik Exp $'"/>
<xsl:output type="html" encoding="iso-8859-1"/>
<xsl:template match="press">
<page>
<title><xsl:value-of select="$title"/></title>
<section name="press"/>
<body>
<p>If you know of any news stories featuring FreeBSD that we have not
listed here, please send details to
<a href="mailto:doc@freebsd.org">doc@FreeBSD.org</a> so that we can
include them.</p>
<p>You also can visit <a href="{$base}/java/press.html">FreeBSD/Java
Press</a> page for information about FreeBSD Java Project's Press
News</p>
<xsl:apply-templates select="//month"/>
</body>
<sidebar class="related-local">
<links>
<url href="{$base}/java/press.html">FreeBSD Java Press</url>
</links>
</sidebar>
<sidebar class="related-web">
<links>
<xsl:for-each select="//story/self::*[not(site-url = preceding::*/site-url)]">
<xsl:sort select="site-name"/>
<url href="{site-url}"><xsl:value-of select="site-name"/></url>
</xsl:for-each>
</links>
</sidebar>
</page>
</xsl:template>
<!-- Everything that follows are templates for the rest of the content -->
<xsl:template match="month">
<b><xsl:value-of select="name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="ancestor::year/name"/></b>
<ul>
<xsl:apply-templates select="descendant::story"/>
</ul>
</xsl:template>
<xsl:template match="story">
<xsl:variable name="url"><xsl:value-of select="url"/></xsl:variable>
<xsl:variable name="site-url"><xsl:value-of
select="site-url"/></xsl:variable>
<li><p><a>
<xsl:attribute name="name">
<xsl:call-template name="generate-story-anchor"/>
</xsl:attribute>
</a>
<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()"/>
</p>
</li>
</xsl:template>
</xsl:stylesheet>
--
FreeBSD: The Power to Serve http://www.freebsd.org/
FreeBSD Documentation Project http://www.freebsd.org/docproj/
--- 15B8 3FFC DDB4 34B0 AA5F 94B7 93A8 0764 2C37 E375 ---
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org
iEYEARECAAYFAjuzrUcACgkQk6gHZCw343UH2wCfdeyXCTjvZ8xKC1hgGcdQg5Zr
X5YAniIYhdE4fPKuqIedjGxoA3jJiqi3
=U2cm
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010927235047.B36549>
