Skip site navigation (1)Skip section navigation (2)
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

--kXdP64Ggrk/fb43R
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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.
>=20
> 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=20

   <sidebar class=3D"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=3D"1.0" encoding=3D"ISO-8859-1" ?>

<!-- $FreeBSD: www/en/news/press.xsl,v 1.1 2001/08/10 10:31:44 nik Exp $ -->

<xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform" version=
=3D"1.0">

  <xsl:import href=3D"../includes.xsl"/>
  <xsl:import href=3D"includes.xsl"/>

  <xsl:variable name=3D"title" select=3D"'FreeBSD In The Press'"/>
  <xsl:variable name=3D"date" select=3D"'$FreeBSD: www/en/news/press.xsl,v =
1.1 2001/08/10 10:31:44 nik Exp $'"/>
 =20
  <xsl:output type=3D"html" encoding=3D"iso-8859-1"/>

  <xsl:template match=3D"press">
    <page>=09
      <title><xsl:value-of select=3D"$title"/></title>

      <section name=3D"press"/>

      <body>
	<p>If you know of any news stories featuring FreeBSD that we have not
	  listed here, please send details to=20
	  <a href=3D"mailto:doc@freebsd.org">doc@FreeBSD.org</a> so that we can
	  include them.</p>

	<p>You also can visit <a href=3D"{$base}/java/press.html">FreeBSD/Java
	    Press</a> page for information about FreeBSD Java Project's Press
	    News</p>
=09
	<xsl:apply-templates select=3D"//month"/>
      </body>

      <sidebar class=3D"related-local">
	<links>
	  <url href=3D"{$base}/java/press.html">FreeBSD Java Press</url>
	</links>
      </sidebar>

      <sidebar class=3D"related-web">
	<links>
	  <xsl:for-each select=3D"//story/self::*[not(site-url =3D preceding::*/si=
te-url)]">
	    <xsl:sort select=3D"site-name"/>
	    <url href=3D"{site-url}"><xsl:value-of select=3D"site-name"/></url>
	  </xsl:for-each>
	</links>
      </sidebar>
    </page>
  </xsl:template>

  <!-- Everything that follows are templates for the rest of the content -->
 =20
  <xsl:template match=3D"month">
    <b><xsl:value-of select=3D"name"/>
      <xsl:text> </xsl:text>
      <xsl:value-of select=3D"ancestor::year/name"/></b>

    <ul>
      <xsl:apply-templates select=3D"descendant::story"/>
    </ul>
  </xsl:template>

  <xsl:template match=3D"story">
    <xsl:variable name=3D"url"><xsl:value-of select=3D"url"/></xsl:variable>
    <xsl:variable name=3D"site-url"><xsl:value-of
    select=3D"site-url"/></xsl:variable>

    <li><p><a>
        <xsl:attribute name=3D"name">
	  <xsl:call-template name=3D"generate-story-anchor"/>
	</xsl:attribute>
      </a>

      <a href=3D"{$url}"><b><xsl:value-of
      select=3D"name"/></b></a><br/>
	 =20
	<a href=3D"{$site-url}"><xsl:value-of
	select=3D"site-name"/></a>, <xsl:value-of select=3D"author"/><br/>
	<xsl:copy-of select=3D"p/child::node()"/>
      </p>
    </li>
  </xsl:template>
</xsl:stylesheet>
--=20
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 ---

--kXdP64Ggrk/fb43R
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjuzrUcACgkQk6gHZCw343UH2wCfdeyXCTjvZ8xKC1hgGcdQg5Zr
X5YAniIYhdE4fPKuqIedjGxoA3jJiqi3
=U2cm
-----END PGP SIGNATURE-----

--kXdP64Ggrk/fb43R--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010927235047.B36549>