W3C home > Mailing lists > Public > spec-prod@w3.org > July to September 2002

Re: Oxford comma in altlocs rendering

From: Norman Walsh <Norman.Walsh@Sun.COM>
Date: Tue, 03 Sep 2002 10:36:54 -0400
To: spec-prod@w3.org
Message-ID: <871y8bf8c9.fsf@nwalsh.com>

/ ht@cogsci.ed.ac.uk (Henry S. Thompson) was heard to say:
| I register a _very_ minor quibble with the way the altlocs list is
| rendered.  I find  "a, b, and c" very odd, particularly when the list
| members are short, as in "XML, Schema, and DTD".  I much prefer "a, b and c",
| i.e. "XML, Schema and DTD".

Like Tim and Michael, I prefer the Oxford style, but never let it be
said I tried to coerce you :-)

Here's a stylesheet layer on top of 1.3 that does it the way you want.
In 1.4, I'll have things refactored so you can override just the
altlocs template. I don't know what I was thinking (yes, I do, I was
thinking "how fast can I make this work" so that the Namespaces WD can
get past pubrules).

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

<xsl:import href="http://www.w3.org/2002/xmlspec/html/1.3/xmlspec.xsl"/>

  <xsl:template match="header">
    <div class="head">
      <xsl:if test="not(/spec/@role='editors-copy')">
          <a href="http://www.w3.org/">
            <img src="http://www.w3.org/Icons/w3c_home"
              alt="W3C" height="48" width="72"/>
        <xsl:call-template name="anchor">
          <xsl:with-param name="node" select="title[1]"/>
          <xsl:with-param name="conditional" select="0"/>
          <xsl:with-param name="default.id" select="'title'"/>

        <xsl:apply-templates select="title"/>
        <xsl:if test="version">
          <xsl:text> </xsl:text>
          <xsl:apply-templates select="version"/>
      <xsl:if test="subtitle">
          <xsl:call-template name="anchor">
            <xsl:with-param name="node" select="subtitle[1]"/>
            <xsl:with-param name="conditional" select="0"/>
            <xsl:with-param name="default.id" select="'subtitle'"/>
          <xsl:apply-templates select="subtitle"/>
        <xsl:call-template name="anchor">
          <xsl:with-param name="node" select="w3c-doctype[1]"/>
          <xsl:with-param name="conditional" select="0"/>
          <xsl:with-param name="default.id" select="'w3c-doctype'"/>

        <xsl:apply-templates select="w3c-doctype"/>
        <xsl:text> </xsl:text>
        <xsl:if test="pubdate/day">
          <xsl:apply-templates select="pubdate/day"/>
          <xsl:text> </xsl:text>
        <xsl:apply-templates select="pubdate/month"/>
        <xsl:text> </xsl:text>
        <xsl:apply-templates select="pubdate/year"/>
        <xsl:apply-templates select="publoc"/>
        <xsl:apply-templates select="latestloc"/>
        <xsl:apply-templates select="prevlocs"/>
        <xsl:apply-templates select="authlist"/>

      <!-- output the altlocs -->
      <xsl:if test="altlocs">
          <xsl:text>This document is also available </xsl:text>
          <xsl:text>in these non-normative formats: </xsl:text>
          <xsl:for-each select="altlocs/loc">
            <xsl:if test="position() &gt; 1">
              <xsl:if test="last() &gt; 2 and position() &lt; last()">,</xsl:if>
              <xsl:if test="last() &gt; 2">&#160;</xsl:if>
              <xsl:if test="last() = 2">&#160;</xsl:if>
            <xsl:if test="position() = last() and position() &gt; 1">and&#160;</xsl:if>
            <a href="{@href}"><xsl:apply-templates/></a>

        <xsl:when test="copyright">
          <xsl:apply-templates select="copyright"/>
          <p class="copyright">
            <a href="http://www.w3.org/Consortium/Legal/ipr-notice-20000612#Copyright">
            <xsl:apply-templates select="pubdate/year"/>
            <a href="http://www.w3.org/">
              <abbr title="World Wide Web Consortium">W3C</abbr>
            <xsl:text> (</xsl:text>
            <a href="http://www.lcs.mit.edu/">
              <abbr title="Massachusetts Institute of Technology">MIT</abbr>
            <xsl:text>, </xsl:text>
            <a href="http://www.inria.fr/">
              <abbr lang="fr"
                    title="Institut National de Recherche en Informatique et Automatique">INRIA</abbr>
            <xsl:text>, </xsl:text>
            <a href="http://www.keio.ac.jp/">Keio</a>
            <xsl:text>), All Rights Reserved. W3C </xsl:text>
            <a href="http://www.w3.org/Consortium/Legal/ipr-notice-20000612#Legal_Disclaimer">liability</a>
            <xsl:text>, </xsl:text>
            <a href="http://www.w3.org/Consortium/Legal/ipr-notice-20000612#W3C_Trademarks">trademark</a>
            <xsl:text>, </xsl:text>
            <a href="http://www.w3.org/Consortium/Legal/copyright-documents-19990405">document use</a>
            <xsl:text>, and </xsl:text>
            <a href="http://www.w3.org/Consortium/Legal/copyright-software-19980720">software licensing</a>
            <xsl:text> rules apply.</xsl:text>
    <xsl:apply-templates select="notice"/>
    <xsl:apply-templates select="abstract"/>
    <xsl:apply-templates select="status"/>

                                        Be seeing you,

Norman.Walsh@Sun.COM    | The fact of having been born is bad augury
XML Standards Architect | for immortality.--Santayana
Sun Microsystems, Inc.  | 
Received on Tuesday, 3 September 2002 10:38:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:55:09 UTC