New
authorPhilippe Le Hégaret <plh@w3.org>
Fri, 19 Sep 2008 08:46:38 +0000
changeset 0 45827f7c8f0f
child 1 65446370244d
New
spec/ackcurrent.xml
spec/acknowledgements-current.txt
spec/acknowledgements-old.txt
spec/acknowledgements.xml
spec/ackold.xml
spec/build.xml
spec/changelog.xml
spec/changelog.xsl
spec/diffmk.jar
spec/entities.dtd
spec/entitiesedcopy.dtd
spec/entitieswd.dtd
spec/generate-acknowledgements.xsl
spec/saxon8/saxon8-ant.jar
spec/saxon8/saxon8-dom.jar
spec/saxon8/saxon8-dom4j.jar
spec/saxon8/saxon8-jdom.jar
spec/saxon8/saxon8-sql.jar
spec/saxon8/saxon8-xom.jar
spec/saxon8/saxon8-xpath.jar
spec/saxon8/saxon8-xqj.jar
spec/saxon8/saxon8.jar
spec/status.xml
spec/xmlspec.dtd
spec/xmlspec.xsl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spec/acknowledgements.xml	Fri Sep 19 08:46:38 2008 +0000
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<inform-div1 id="acknowledgments">
+  <head>Acknowledgements</head>
+
+  <p>This document is the work of the <loc
+  href="http://www.w3.org/AudioVideo/TT/">W3C Timed Text Working Group</loc>.</p>
+
+  <p>
+    Members of the Working Group are (at the time of writing, and by
+    alphabetical order):
+      &acknowledgements-current;
+  </p>
+
+  <p>
+    Previous members of the Working Group were:
+      &acknowledgements-old;
+  </p>
+
+  <p>
+    The people who have contributed to <loc
+    href="http://lists.w3.org/Archives/Public/public-tt/">discussions
+    on [email protected]</loc> are also gratefully
+    acknowledged.
+  </p>
+</inform-div1>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spec/build.xml	Fri Sep 19 08:46:38 2008 +0000
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Apache Ant script to build spec.
+     Philippe Le Hegaret, W3C -->
+      
+<project name="TimedText" default="main" basedir=".">
+    <path id="saxon8.classpath">
+        <pathelement location="saxon8/saxon8.jar"/>
+    </path>
+    <property name="htmlOutputDir" value="./"/>
+    <property name="stylesheet" value="xmlspec-tt.xsl"/>
+    <property name="glossary" value="extract-glist.xsl"/>
+	<property name="generateBPlist" value="generateBPlist.xsl"/>
+    <property name="diffformat" value="diffspec.xsl"/>
+    <property name="last-public-draft" value="20070706"/>
+
+    <target name="clean">
+        <delete quiet="true" file="tt.html"/>
+    </target>
+
+    <target name="validate-xsl" description="Validates all XML files.">
+        <xmlvalidate lenient="true">
+            <fileset dir="." includes="*.xsl"/>
+        </xmlvalidate>
+    </target>
+
+    <target name="validate-svg" description="Validates all SVG files.">
+        <xmlvalidate lenient="false" warn="yes">
+            <fileset dir="." includes="*.svg"/>
+        </xmlvalidate>
+    </target>
+
+    <target name="validate-tt-specs" description="Validates all Timed Text spec files.">
+        <xmlvalidate lenient="false" warn="yes" file="tt.xml"/>
+    </target>
+
+    <target name="validate" depends="validate-xsl,validate-svg,validate-tt-specs"/>
+
+    <target name="updateAcks"
+        description="Update acknowledgements. Before running this, 
+	update ackcurrent.xml via  and ackold.xml
+	via http://www.w3.org/2000/09/dbwg/details?group=34314&amp;former=1&amp;public=1 .">
+        <get src="http://www.w3.org/2000/09/dbwg/details?group=34314&amp;public=1" dest="ackcurrent.xml"/>
+        <get src="http://www.w3.org/2000/09/dbwg/details?group=34314&amp;former=1&amp;public=1" dest="ackold.xml"/>
+        <java fork="true" classname="net.sf.saxon.Transform">
+            <classpath refid="saxon8.classpath"/>
+            <arg value="-o"/>
+            <arg value="acknowledgements-current.txt"/>
+            <arg value="ackcurrent.xml"/>
+            <arg value="generate-acknowledgements.xsl"/>
+            <arg value="participating=1"/>
+        </java>
+        <java fork="true" classname="net.sf.saxon.Transform">
+            <classpath refid="saxon8.classpath"/>
+            <arg value="-o"/>
+            <arg value="acknowledgements-old.txt"/>
+            <arg value="ackold.xml"/>
+            <arg value="generate-acknowledgements.xsl"/>
+            <arg value="participating=0"/>
+        </java>
+    </target>
+
+    <target name="html" description="Transforms xml into html.">
+        <echo>Generating tt.html</echo>
+        <java fork="true" classname="net.sf.saxon.Transform">
+            <classpath refid="saxon8.classpath"/>
+            <arg value="-o"/>
+            <arg value="${htmlOutputDir}tt.html"/>
+            <arg value="tt.xml"/>
+            <arg value="${stylesheet}"/>
+            <arg value="showAssertions=true"/>
+        </java>    
+    </target>
+
+    <path id="diffmk.classpath">
+        <pathelement location="${basedir}/diffmk.jar"/>
+        <pathelement location="${basedir}/DiffMk.properties"/>
+    </path>
+    <target name="generateXMLdiff">
+  <java classname="com.sun.xtc.diffmk.DiffMk" fork="true">
+            <arg value="-doctype"/>
+            <arg value="xmlspec"/>
+            <arg value="-diff"/>
+            <arg value="both"/>
+            <arg value="-words"/>
+            <arg value="tt-tr${last-public-draft}.xml"/>
+            <arg value="tt.xml"/>
+            <arg value="tt-diff${last-public-draft}.xml"/>
+            <classpath path="diffmk.jar:DiffMk.properties"> </classpath>
+        </java>
+    </target>
+    <target name="generateHTMLdiff">
+        <java fork="true" classname="net.sf.saxon.Transform">
+            <classpath refid="saxon8.classpath"/>
+            <arg value="-o"/>
+            <arg value="${htmlOutputDir}tt-diff${last-public-draft}.html"/>
+            <arg value="tt-diff${last-public-draft}.xml"/>
+            <arg value="diffspec.xsl"/>
+        </java>
+    </target>
+
+    <target name="postprocess-diff">
+      <java fork="true" classname="net.sf.saxon.Transform">
+            <classpath refid="saxon8.classpath"/>
+            <arg value="-o"/>
+            <arg value="temp-tt-diff${last-public-draft}.xml"/>
+            <arg value="tt-diff${last-public-draft}.xml"/>
+            <arg value="diff-postprocess.xsl"/>
+        </java>
+        <copy tofile="tt-diff${last-public-draft}.xml"
+            file="temp-tt-diff${last-public-draft}.xml" overwrite="true"/>
+        <delete file="temp-tt-diff${last-public-draft}.xml"/>
+    </target>
+
+    <target name="diff" depends="generateXMLdiff, postprocess-diff, generateHTMLdiff"/>
+
+    <target name="changelog" description="Update the CVS change log to be added into the specification">
+      <!--        <cvschangelog destfile="changelog.xml"/> -->
+      <get src="http://www.w3.org/2000/06/webdata/xslt?xslfile=http%3A%2F%2Fwww.w3.org%2F2008%2F05%2Fcvswebrss.xsl&amp;xmlfile=http%3A%2F%2Fcgi.w3.org%2Fcgi-bin%2Ftidy%3FdocAddr%3Dhttp%253A%252F%252Fdev.w3.org%252Fcvsweb%252F2008%252Fws%252Ftt%252Ftt.xml%26forceXML%3Don" dest="changelog.xml"/>
+    </target>
+
+    <target name="generate" description="Generate the specification without updating changelog and acknowledgments sections"
+	    depends="validate-tt-specs,html">
+      <echo>WARNING: changelog.xml and acknowledgments.xml MAY be out of date. Use "main" target if necessary.</echo>
+    </target>
+    
+    <target name="main" description="Generate the specification for a CVS commit"
+	    depends="changelog,validate-tt-specs,html">
+<!--	    depends="updateAcks,changelog,validate-tt-specs,html"> -->
+      <echo>tt.html is ready for CVS commit</echo>
+      <echo>Use target "generate" to avoid regenerating changelog.xml and acknowledgments.xml</echo>
+    </target>
+
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spec/changelog.xml	Fri Sep 19 08:46:38 2008 +0000
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns:h="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/2005/Atom">
+   <id>http://dev.w3.org</id>
+   <updated>-01-TZ</updated>
+   <title> CVS log</title>
+   <author>
+      <name>World Wide Web Consortium</name>
+      <uri>http://dev.w3.org</uri>
+   </author>
+   <link rel="alternate" type="text/html" href="http://dev.w3.org"/>
+   <link rel="self" href="http://dev.w3.org"/>
+   <rights>World Wide Web Consortium</rights>
+</feed>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spec/changelog.xsl	Fri Sep 19 08:46:38 2008 +0000
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+		xmlns:h="http://www.w3.org/1999/xhtml"
+		xmlns="http://www.w3.org/1999/xhtml"
+		xmlns:a="http://www.w3.org/2005/Atom">
+    <xsl:template match="a:entry">
+        <xsl:if test="a:author/a:name!='@@[email protected]@'">
+	  <tr>
+	    <td>
+	      <xsl:value-of select="substring-before(a:published, 'T')"/>
+	    </td>
+	    <td>
+	      <xsl:value-of select="a:author/a:name"/>
+	    </td>
+	    <td>
+	      <xsl:value-of select="a:content/h:div/h:pre"/>
+	    </td>
+	  </tr>
+	</xsl:if>
+    </xsl:template>
+    <xsl:template match="a:feed">
+        <table border="1">
+            <tr>
+                <th>Date</th>
+                <th>Editor</th>
+                <th>Description</th>
+            </tr>
+            <xsl:apply-templates select="a:entry">
+                <xsl:sort select="a:published" order="descending"/>
+            </xsl:apply-templates>
+        </table>
+    </xsl:template>
+</xsl:stylesheet>
Binary file spec/diffmk.jar has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spec/entities.dtd	Fri Sep 19 08:46:38 2008 +0000
@@ -0,0 +1,34 @@
+<!--
+ comment this entity for publication 
+-->
+<!ENTITY % sub.entities SYSTEM "entitiesedcopy.dtd" >
+
+<!--
+ uncomment the following entity for publication, and change the date
+ in entitieswd.dtd
+ 
+<!ENTITY % sub.entities SYSTEM "entitieswd.dtd" >
+-->
+%sub.entities;
+
+<!-- Titles -->
+<!ENTITY title "Timed Text (TT) Authoring Format 1.0 – Distribution Format Exchange Profile (DFXP)">
+
+<!-- XML Namespaces used in the drafts -->
+<!ENTITY nsuri "http://www.w3.org/2006/10/ttaf1" >
+
+<!--
+<!ENTITY schema "http://www.w3.org/2008/02/tt.xsd" >
+-->
+
+<!-- Acknowledgements -->
+
+<!ENTITY acknowledgements SYSTEM "acknowledgements.xml" >
+<!ENTITY acknowledgements-current SYSTEM "acknowledgements-current.txt" >
+<!ENTITY acknowledgements-old SYSTEM "acknowledgements-old.txt" >
+
+<!-- Misc entities. Feel free to add more -->
+
+<!ENTITY EII "<emph>element information item</emph>">
+<!ENTITY AII "<emph>attribute information item</emph>">
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spec/entitiesedcopy.dtd	Fri Sep 19 08:46:38 2008 +0000
@@ -0,0 +1,36 @@
+<?xml version='1.0' encoding='ISO-8859-1' ?>
+
+<!--
+  Date parameters
+  ** DO NOT CHANGE **
+  for publication, change them in entitieswd.dtd
+  -->
+<!ENTITY draft.year "@@@@">
+<!ENTITY draft.month "@@@@">
+<!ENTITY draft.mm "@@">
+<!ENTITY draft.day "@@">
+<!ENTITY draft.dd "@@">
+
+<!-- Don't touch after this line -->
+
+<!ENTITY draft.date "&draft.year;&draft.mm;&draft.dd;">
+
+<!ENTITY prefix "ttaf1-dfxp">
+
+<!ENTITY w3c-designation
+  "&prefix;.html">
+
+
+<!ENTITY w3c.tr.latest  "http://dev.w3.org/cvsweb/~checkout~/2008/tt/spec">
+
+<!-- Latest version links. don't touch -->
+<!ENTITY latest "&w3c.tr.latest;/&w3c-designation;?content-type=text/html; charset=utf-8">
+
+<!ENTITY w3c.tr  "">	
+
+<!ENTITY document.role "editors-copy">
+
+<!ENTITY doctype "wd">
+
+<!ENTITY status "<status><p></p></status>">
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spec/entitieswd.dtd	Fri Sep 19 08:46:38 2008 +0000
@@ -0,0 +1,31 @@
+<?xml version='1.0' encoding='ISO-8859-1' ?>
+
+<!--
+  Date parameters
+  -->
+<!ENTITY draft.year "2008">
+<!ENTITY draft.month "September">
+<!ENTITY draft.mm "09">
+<!ENTITY draft.day "23">
+<!ENTITY draft.dd "23">
+
+<!ENTITY draft.date "&draft.year;&draft.mm;&draft.dd;">
+
+<!ENTITY prefix "ttaf1-dfxp">
+
+<!ENTITY w3c.tr.latest  "http://www.w3.org/TR">	
+
+<!-- Latest version links. don't touch -->
+<!ENTITY latest "&w3c.tr.latest;/&prefix;">
+
+<!ENTITY w3c.tr  "&w3c.tr.latest;/&draft.year;">	
+
+<!ENTITY document.role "public">
+
+<!-- The following is used for document .-->
+<!ENTITY document.status "W3C Working Draft">
+<!ENTITY w3c.status "WD">
+<!ENTITY doctype "wd">
+
+<!ENTITY w3c-designation
+  "&w3c.tr.latest;/&draft.year;/&w3c.status;-&prefix;-&draft.date;">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spec/generate-acknowledgements.xsl	Fri Sep 19 08:46:38 2008 +0000
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:html="http://www.w3.org/1999/xhtml"
+  exclude-result-prefixes="html"
+  version="1.0">
+
+  <xsl:output
+    method="text"
+    indent="yes"
+    encoding="utf-8"
+    />
+
+  <xsl:param name="participating" />
+
+  <xsl:template match="/">
+    <xsl:call-template name="list-participants">
+      <xsl:with-param name="participating" select="$participating"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="html:tr">
+      <xsl:value-of select="html:th[@class='name']/html:a"/>
+      <xsl:text> (</xsl:text>
+      <xsl:value-of select="html:td[@class='orgname']"/>
+      <xsl:text>)</xsl:text>
+  </xsl:template>
+
+  <xsl:template name="list-participants">
+    <xsl:param name="participating"/>
+    <xsl:variable name="status">
+      <xsl:choose>
+	<xsl:when test="$participating = 1">
+	  <xsl:text>good standing</xsl:text>
+	</xsl:when>
+	<xsl:otherwise>
+	  <xsl:text>no longer participating</xsl:text>	  
+	</xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:for-each select="//html:dl[contains(@class, 'group-member')
+			  and contains(normalize-space(html:dd[@class='status']), $status)]">
+      <xsl:value-of select="html:dt[@class='foaf-name']"/>
+      <xsl:if test="$participating = 1"><xsl:text> (</xsl:text>
+      <xsl:value-of select="html:dd[@class='orgname']"/>
+      <xsl:text>)</xsl:text></xsl:if>
+      <xsl:if test="position()!=last()">
+	<xsl:text>, </xsl:text>
+      </xsl:if>
+      <xsl:if test="position()=last()">
+	<xsl:text>.</xsl:text>
+      </xsl:if>
+    </xsl:for-each>
+  </xsl:template>
+
+</xsl:stylesheet>
Binary file spec/saxon8/saxon8-ant.jar has changed
Binary file spec/saxon8/saxon8-dom.jar has changed
Binary file spec/saxon8/saxon8-dom4j.jar has changed
Binary file spec/saxon8/saxon8-jdom.jar has changed
Binary file spec/saxon8/saxon8-sql.jar has changed
Binary file spec/saxon8/saxon8-xom.jar has changed
Binary file spec/saxon8/saxon8-xpath.jar has changed
Binary file spec/saxon8/saxon8-xqj.jar has changed
Binary file spec/saxon8/saxon8.jar has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spec/status.xml	Fri Sep 19 08:46:38 2008 +0000
@@ -0,0 +1,54 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<status id='Status'>
+
+  <p><emph>This section describes the status of this document at the
+  time of its publication. Other documents may supersede this
+  document. A list of current W3C publications and the latest revision
+  of this technical report can be found in the <loc
+  href="http://www.w3.org/TR/">W3C technical reports index</loc> at
+  http://www.w3.org/TR/.</emph></p>
+
+  <p>This is the <loc
+  href="http://www.w3.org/2005/10/Process-20051014/tr.html#wd">Working
+  Draft</loc> of the &title; specification. It has been produced by
+  the <loc href="http://www.w3.org/AudioVideo/TT/">Timed Text
+  Working Group</loc>, which is part of the <loc
+  href="http://www.w3.org/WebVideo">W3C Video in the Web
+  Activity</loc>.</p>
+
+<!--
+    <p>A <loc
+  href="soapjms-diff20080706.html">diff-marked version
+  against the previous version of this document</loc> is
+  available.</p>
+    -->    
+    
+  <p>Please send comments about this document to <loc
+  href="mailto:[email protected]">[email protected]</loc>
+  mailing list (<loc
+  href="http://lists.w3.org/Archives/Public/public-tt/">public
+  archive</loc>).</p>
+
+  <p>
+    Publication as a Working Draft does not imply endorsement by the
+    W3C Membership. This is a draft document and may be updated,
+    replaced or obsoleted by other documents at any time. It is
+    inappropriate to cite this document as other than work in
+    progress.
+  </p>
+
+  <p>This document was produced by a group operating under the <loc
+  href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5
+  February 2004 W3C Patent Policy</loc>. W3C maintains a <loc
+  href="http://www.w3.org/2004/01/pp-impl/34314/status">public list of
+  any patent disclosures</loc> made in connection with the
+  deliverables of the group; that page also includes instructions for
+  disclosing a patent. An individual who has actual knowledge of a
+  patent which the individual believes contains <loc
+  href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">
+  Essential Claim(s)</loc> must disclose the information in accordance
+  with <loc
+  href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">
+  section 6 of the W3C Patent Policy</loc>.</p>
+
+</status>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spec/xmlspec.dtd	Fri Sep 19 08:46:38 2008 +0000
@@ -0,0 +1,2795 @@
+<!-- ............................................................... -->
+<!-- XML specification DTD ......................................... -->
+<!-- ............................................................... -->
+
+<!-- $Id$ -->
+
+<!--
+TYPICAL INVOCATION:
+#  <!DOCTYPE spec PUBLIC
+#       "-//W3C//DTD Specification V2.10//EN"
+#       "http://www.w3.org/2002/xmlspec/dtd/2.10/xmlspec.dtd">
+
+PURPOSE:
+  This XML DTD is for W3C specifications and other technical reports.
+  It is based in part on the TEI Lite and Sweb DTDs.
+
+COPYRIGHT:
+
+  Copyright (C) 2000, 2001, 2002, 2003 Sun Microsystems, Inc. All Rights Reserved.
+  This document is governed by the W3C Software License[3] as
+  described in the FAQ[4].
+
+    [1] http://www.w3.org/TR/xslt
+    [2] http://www.w3.org/XML/1998/06/xmlspec-report-v21.htm
+    [3] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+    [4] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+
+DEPENDENCIES:
+  None.
+
+CHANGE HISTORY:
+  The list of historical changes is at the end of the DTD. For recent changes,
+  see the CVS log.
+
+  For all details, see the design report at:
+
+  <http://www.w3.org/XML/1998/06/xmlspec-report-v21.htm>
+
+  This report is now out-of-date, but no more recent report has been prepared.
+
+#2003-06-25: nwalsh: Added translationloc, preverrataloc, rfc2119
+
+#2003-05-28: nwalsh: Added errataloc, fixed IE bug. Added @num to prod.
+
+             Published V2.4
+
+#2003-03-12: nwalsh: Added local.* PEs to a number of additional
+             places to make customization layers easier.
+
+             Published V2.3
+
+#2002-09-04: nwalsh: Added 'phrase' to title, subtitle, version,
+             w3c-designation, w3c-doctype, day, month, year, name,
+             affiliation, email, language, role, lhs, rhs, com,
+             typename, date, loc, nt, sub, sup, term, termref,
+             titleref, xnt, xspecref, xtermref
+
+             This is *solely* to support automated diffing. Users
+             are explicitly forbidden from using this as an escape
+             hatch to get extra markup in these contexts.
+
+#2001-10-08: nwalsh: Added local.arg.att and local.proto.att
+
+#2002-08-14: nwalsh: Published V2.2
+
+  Added marked sections around element and attlist declarations and
+  added the altlocs element
+
+MAINTAINERS:
+  Norman Walsh
+  Sun Microsystems, Inc.
+  [email protected]
+  voice: +1 413 256 6985
+  fax:   +1 413 256 6985
+
+  Eve Maler
+  Sun Microsystems, Inc.
+  [email protected]
+  voice: +1 781 442 3190
+  fax:   +1 781 442 1437
+-->
+
+<!-- ............................................................... -->
+<!-- Entities for characters and symbols ........................... -->
+<!-- ............................................................... -->
+
+<!--
+#1998-03-10: maler: Added &ldquo; and &rdquo;.
+#                   Used 8879:1986-compatible decimal character
+#                   references.
+#                   Merged charent.mod file back into main file.
+#1998-05-14: maler: Fixed ldquo and rdquo.  Gave mdash a real number.
+#1998-12-03: maler: Escaped the leading ampersands.
+-->
+
+<!ENTITY lt     "&#38;#60;">
+<!ENTITY gt     "&#62;">
+<!ENTITY amp    "&#38;#38;">
+<!ENTITY apos   "&#39;">
+<!ENTITY quot   "&#34;">
+<!ENTITY nbsp   "&#160;">
+<!ENTITY mdash  "&#38;#x2014;">
+<!ENTITY ldquo  "&#38;#x201C;">
+<!ENTITY rdquo  "&#38;#x201D;">
+
+<!-- ............................................................... -->
+<!-- Entities for classes of standalone elements ................... -->
+<!-- ............................................................... -->
+
+<!--
+#1997-10-16: maler: Added table to %illus.class;.
+#1997-11-28: maler: Added htable to %illus.class;.
+#1997-12-29: maler: IGNOREd table.
+#1998-03-10: maler: Removed SGML Open-specific %illus.class;.
+#                   Added "local" entities for customization.
+#1998-05-14: maler: Added issue to %note.class;.
+#                   Removed %[local.]statusp.class;.
+#1998-05-21: maler: Added constraintnote to %note.class;.
+#1998-08-22: maler: Changed htable to table in %illus.class;.
+#                   Added definitions to %illus.class;.
+#2000-03-07: maler: Added proto and example to %illus.class;.
+-->
+
+<!ENTITY % local.p.class        " ">
+<!ENTITY % p.class              "p
+                                %local.p.class;">
+
+<!ENTITY % local.list.class     " ">
+<!ENTITY % list.class           "ulist|olist|slist|glist
+                                %local.list.class;">
+
+<!ENTITY % local.speclist.class " ">
+<!ENTITY % speclist.class       "orglist|blist
+                                %local.speclist.class;">
+
+<!ENTITY % local.note.class     " ">
+<!ENTITY % note.class           "note|issue|wfcnote|vcnote
+                                |constraintnote %local.note.class;">
+
+<!ENTITY % local.illus.class    " ">
+<!ENTITY % illus.class          "eg|graphic|scrap|table|definitions
+                                |proto|example
+                                %local.illus.class;">
+
+<!-- ............................................................... -->
+<!-- Entities for classes of phrase-level elements ................. -->
+<!-- ............................................................... -->
+
+<!--
+#1997-12-29: maler: Added xspecref to %ref.class;.
+#1998-03-10: maler: Added %ednote.class;.
+#                   Added "local" entities for customization.
+#2000-03-07: maler: Added function, var, el, att, and attval to
+#                   %tech.class;.
+#                   Added sub, sup, and phrase to %emph.class;.
+-->
+
+<!ENTITY % local.annot.class    " ">
+<!ENTITY % annot.class          "footnote
+                                %local.annot.class;">
+
+<!ENTITY % local.termdef.class  " ">
+<!ENTITY % termdef.class        "termdef|term
+                                %local.termdef.class;">
+
+<!ENTITY % local.emph.class     " ">
+<!ENTITY % emph.class           "emph|phrase|rfc2119|quote|sub|sup
+                                %local.emph.class;">
+
+<!ENTITY % local.ref.class      " ">
+<!ENTITY % ref.class            "bibref|specref|termref|titleref
+                                |xspecref|xtermref
+                                %local.ref.class;">
+
+<!ENTITY % local.loc.class      " ">
+<!ENTITY % loc.class            "loc
+                                %local.loc.class;">
+
+<!ENTITY % local.tech.class     " ">
+<!ENTITY % tech.class           "kw|nt|xnt|code|function|var
+                                |el|att|attval
+                                %local.tech.class;">
+
+<!ENTITY % local.ednote.class   " ">
+<!ENTITY % ednote.class         "ednote
+                                %local.ednote.class;">
+
+
+<!ENTITY % local.assert.class   " ">
+<!ENTITY % assert.class         "assert
+                                %local.assert.class;">
+<!ENTITY % local.assert-summary.class   " ">
+<!ENTITY % assert-summary.class         "assert-summary
+                                %local.assert-summary.class;">
+<!-- ............................................................... -->
+<!-- Entities for mixtures of standalone elements .................. -->
+<!-- ............................................................... -->
+
+<!--
+#1997-09-30: maler: Created %p.mix; to eliminate p from self.
+#1997-09-30: maler: Added %speclist.class; to %obj.mix; and %p.mix;.
+#1997-09-30: maler: Added %note.class; to %obj.mix; and %p.mix;.
+#1997-10-16: maler: Created %entry.mix;.  Note that some elements
+#                   left out here are still allowed in termdef,
+#                   which entry can contain through %p.pcd.mix;.
+#1997-11-28: maler: Added %p.class; to %statusobj.mix;.
+#1998-03-10: maler: Added %ednote.class; to all mixtures, except
+#                   %p.mix; and %statusobj.mix;, because paragraphs
+#                   and status paragraphs will contain ednote
+#                   through %p.pcd.mix;.
+#1998-03-23: maler: Added %termdef.mix; (broken out from
+#                    %termdef.pcd.mix;).
+#1998-05-14: maler: Removed %statusobj.mix; and all mentions of
+#                   %statusp.mix;.
+-->
+
+<!ENTITY % local.div.mix " "> <!-- compensate for IE bug; suggested by ht -->
+<!ENTITY % div.mix
+        "%p.class;|%list.class;|%speclist.class;|%note.class;
+        |%illus.class;|%ednote.class;%local.div.mix;">
+
+<!ENTITY % local.obj.mix " "> <!-- compensate for IE bug; suggested by ht -->
+<!ENTITY % obj.mix
+        "%p.class;|%list.class;|%speclist.class;|%note.class;
+        |%illus.class;|%ednote.class;%local.obj.mix;">
+
+<!ENTITY % local.p.mix " "> <!-- compensate for IE bug; suggested by ht -->
+<!ENTITY % p.mix
+        "%list.class;|%speclist.class;|%note.class;|%illus.class;%local.p.mix;">
+
+<!ENTITY % local.entry.mix " "> <!-- compensate for IE bug; suggested by ht -->
+<!ENTITY % entry.mix
+        "%list.class;|note|eg|graphic|%ednote.class;%local.entry.mix;">
+
+<!ENTITY % local.hdr.mix " "> <!-- compensate for IE bug; suggested by ht -->
+<!ENTITY % hdr.mix
+        "%p.class;|%list.class;|%ednote.class;%local.hdr.mix;">
+
+<!ENTITY % local.termdef.mix " "> <!-- compensate for IE bug; suggested by ht -->
+<!ENTITY % termdef.mix
+        "%note.class;|%illus.class;%local.termdef.mix;">
+
+<!-- ............................................................... -->
+<!-- Entities for mixtures of #PCDATA and phrase-level elements .... -->
+<!-- ............................................................... -->
+
+<!--    Note that %termdef.pcd.mix contains %note.class;
+        and %illus.class;, considered standalone elements. -->
+
+<!--
+#1997-09-30: maler: Added scrap and %note.class; to %termdef.pcd.mix;.
+#1997-11-28: maler: Added %loc.class; to %p.pcd.mix;.
+#1998-03-10: maler: Added %ednote.class; to all mixtures.
+#1998-03-23: maler: Moved some %termdef.pcd.mix; stuff out to
+#                   %termdef.mix;.
+#1998-05-14: maler: Removed %statusp.pcd.mix;.
+#1998-05-21: maler: Added constraint element to %eg.pcd.mix;.
+#1999-07-02: maler: Added %loc.class; to %head.pcd.mix;,
+#                   %label.pcd.mix;, %eg.pcd.mix;, %termdef.pcd.mix;,
+#                   %tech.pcd.mix; (net: all PCD mixes have it).
+#                   Removed unused %loc.pcd.mix;.
+-->
+
+<!ENTITY % local.p.pcd.mix " "> <!-- compensate for IE bug; suggested by ht -->
+<!ENTITY % p.pcd.mix
+        "#PCDATA|%annot.class;|%termdef.class;|%emph.class;
+        |%ref.class;|%tech.class;|%loc.class;|%ednote.class;%local.p.pcd.mix;|%assert.class;%local.p.pcd.mix;|%assert-summary.class;">
+
+<!ENTITY % local.head.pcd.mix " "> <!-- compensate for IE bug; suggested by ht -->
+<!ENTITY % head.pcd.mix
+        "#PCDATA|%annot.class;|%emph.class;|%tech.class;
+        |%loc.class;|%ednote.class;%local.head.pcd.mix;">
+
+<!ENTITY % local.label.pcd.mix " "> <!-- compensate for IE bug; suggested by ht -->
+<!ENTITY % label.pcd.mix
+        "#PCDATA|%annot.class;|%termdef.class;|%emph.class;
+        |%tech.class;|%loc.class;|%ednote.class;%local.label.pcd.mix;">
+
+<!ENTITY % local.eg.pcd.mix " "> <!-- compensate for IE bug; suggested by ht -->
+<!ENTITY % eg.pcd.mix
+        "#PCDATA|%annot.class;|%emph.class;|%loc.class;
+        |%ednote.class;|constraint %local.eg.pcd.mix;">
+
+<!ENTITY % local.termdef.pcd.mix " "> <!-- compensate for IE bug; suggested by ht -->
+<!ENTITY % termdef.pcd.mix
+        "#PCDATA|term|%emph.class;|%ref.class;|%tech.class;
+        |%loc.class;|%ednote.class;%local.termdef.pcd.mix;|%assert.class;%local.termdef.pcd.mix;">
+
+<!ENTITY % local.bibl.pcd.mix " "> <!-- compensate for IE bug; suggested by ht -->
+<!ENTITY % bibl.pcd.mix
+        "#PCDATA|%emph.class;|%ref.class;|%loc.class;|%ednote.class;%local.bibl.pcd.mix;">
+
+<!ENTITY % local.tech.pcd.mix " "> <!-- compensate for IE bug; suggested by ht -->
+<!ENTITY % tech.pcd.mix
+        "#PCDATA|%loc.class;|%ednote.class;|phrase|rfc2119 %local.tech.pcd.mix;">
+
+<!-- ............................................................... -->
+<!-- Entities for customizable content models ...................... -->
+<!-- ............................................................... -->
+
+<!--
+#1998-03-10: maler: Added customization entities.
+#1998-05-14: maler: Allowed prevlocs and latestloc in either order.
+#1999-07-02: maler: Made version optional; added copyright element.
+#2000-03-07: maler: Allowed status and abstract in opposite order.
+-->
+
+<!ENTITY % spec.mdl
+        "header, front?, body, back?">
+
+<!ENTITY % header.mdl
+        "title, subtitle?, version?, w3c-designation, w3c-doctype,
+        pubdate, notice*, publoc, altlocs?, ((prevlocs, latestloc?) |
+        (latestloc, prevlocs?))?, authlist, errataloc?, preverrataloc?,
+        translationloc?, copyright?,
+        ((status, abstract) | (abstract, status)), pubstmt?,
+        sourcedesc?, langusage, revisiondesc">
+
+<!ENTITY % pubdate.mdl
+        "day?, month, year">
+
+<!-- ............................................................... -->
+<!-- Entities for common attributes ................................ -->
+<!-- ............................................................... -->
+
+<!--
+#2000-03-07: maler: Added %argtypes;.
+-->
+
+<!--    argtypes:
+        Values for function prototype argument datatypes. -->
+<!ENTITY % argtypes
+        '(boolean
+         |expression
+         |location-set
+         |node-set
+         |number
+         |object
+         |point
+         |range
+         |string)'>
+
+<!--    key attribute:
+        Optionally provides a sorting or indexing key, for cases when
+        the element content is inappropriate for this purpose. -->
+<!ENTITY % key.att
+        'key                    CDATA           #IMPLIED'>
+
+<!--    def attribute:
+        Points to the element where the relevant definition can be
+        found, using the IDREF mechanism.  %def.att; is for optional
+        def attributes, and %def-req.att; is for required def
+        attributes. -->
+<!ENTITY % def.att
+        'def                    IDREF           #IMPLIED'>
+<!ENTITY % def-req.att
+        'def                    IDREF           #REQUIRED'>
+
+<!--    ref attribute:
+        Points to the element where more information can be found,
+        using the IDREF mechanism.  %ref.att; is for optional
+        ref attributes, and %ref-req.att; is for required ref
+        attributes. -->
+<!ENTITY % ref.att
+        'ref                    IDREF           #IMPLIED'>
+<!ENTITY % ref-req.att
+        'ref                    IDREF           #REQUIRED'>
+
+<!--
+#1998-03-23: maler: Added show and actuate attributes to href.
+#                   Added semi-common xml:space attribute.
+#1998-08-22: maler: Used new xlink:form and #IMPLIED features.
+#1999-07-02: maler: Reorganized XLink-related entities completely;
+#                   added xmlns:xlink attribute to the mix.
+#2000-03-07: maler: Updated XLink usage to February 2000 draft,
+#                   except that href still has no namespace prefix.
+-->
+
+<!--    xmlns:xlink and xlink:type attributes:
+        xmlns:xlink declares the association of the xlink prefix
+        with the namespace created by the XLink specification.
+        xlink:type identifies an element as an XLink "simple" linking
+        element. -->
+<!ENTITY % simple-xlink.att
+        'xmlns:xlink            CDATA   #FIXED
+                                        "http://www.w3.org/1999/xlink"
+        xlink:type              CDATA   #FIXED "simple" '>
+
+<!--    href attributes:
+        The href attribute locates the remote-resource half of a
+        simple link; the element on which the href appears is the
+        local-resource half.  Some elements are usable links only if
+        the author chooses to supply a functional href.  The attribute
+        name should really be xlink:href, but is kept without the
+        prefix for now in order to be backwards-compatible. -->
+
+<!ENTITY % href.att
+        'href                   CDATA           #IMPLIED '>
+<!ENTITY % href-req.att
+        'href                   CDATA           #REQUIRED '>
+
+<!--    xlink:show and xlink:actuate attributes:
+        These attributes offer instructions to the display engine
+        about how to handle traversal to resource indicated by an
+        href locator. -->
+<!ENTITY % auto-embed.att
+        'xlink:show             CDATA           #FIXED "embed"
+        xlink:actuate           CDATA           #FIXED "onLoad" '>
+<!ENTITY % user-replace.att
+        'xlink:show             CDATA           #FIXED "replace"
+        xlink:actuate           CDATA           #FIXED "onRequest" '>
+<!ENTITY % user-new.att
+        'xlink:show             CDATA           #FIXED "new"
+        xlink:actuate           CDATA           #FIXED "onRequest" '>
+
+<!--    xml:space attribute:
+        Indicates that the element contains whitespace that the
+        formatter or other application should retain, as appropriate
+        to its function. -->
+<!ENTITY % xmlspace.att
+        'xml:space              (default
+                                |preserve)      #FIXED "preserve" '>
+
+<!--
+#2000-03-07: maler: Added common diff attribute.  Made %role.att;.
+-->
+
+<!--    diff attribute:
+        Indicates in what way the element has changed.  When a value
+        is not provided, that subelement should inherit a value from
+        its parent.  If the root element has no value supplied,
+        assume "off". -->
+<!ENTITY % diff.att
+        'diff                   (chg
+                                |add
+                                |del
+                                |off)           #IMPLIED'>
+
+<!--    role attribute:
+        Extends the useful life of the DTD by allowing authors to
+        make a subtype of any element.  No default. -->
+<!ENTITY % role.att
+        'role                   NMTOKEN         #IMPLIED'>
+
+<!--    Common attributes:
+        Every element has an ID attribute for links, a role
+        attribute, and a diff attribute. %common.att; is for
+        common attributes where the ID is optional, and
+        %common-idreq.att; is for common attributes where the
+        ID is required. -->
+
+<!ENTITY % local.common.att " ">
+<!ENTITY % common.att
+        'id                     ID              #IMPLIED
+        %role.att;
+        %diff.att;
+        %local.common.att;'>
+
+<!ENTITY % local.common-idreq.att " ">
+<!ENTITY % common-idreq.att
+        'id                     ID              #REQUIRED
+        %role.att;
+        %diff.att;
+        %local.common-idreq.att;'>
+
+<!-- ............................................................... -->
+<!-- Common elements ............................................... -->
+<!-- ............................................................... -->
+
+<!--    head: Title on divisions, productions, and the like -->
+<!ENTITY % head.element "INCLUDE">
+<![%head.element;[
+<!ELEMENT head (%head.pcd.mix;)*>
+]]>
+<!ENTITY % head.attlist "INCLUDE">
+<![%head.attlist;[
+<!ATTLIST head %common.att;>
+]]>
+
+<!-- ............................................................... -->
+<!-- Major specification structure ................................. -->
+<!-- ............................................................... -->
+
+<!--
+#1998-03-10: maler: Made spec content model easily customizable.
+#1999-07-02: maler: Added doctype atts and status att.
+#2000-03-07: maler: Added cr, issues, and dispcmts to w3c-doctype.
+-->
+
+<!ENTITY % spec.element "INCLUDE">
+<![%spec.element;[
+<!ELEMENT spec (%spec.mdl;)>
+]]>
+<!--    w3c-doctype attributes:
+        Indicates the type of document, so that the appropriate
+        stylesheet or workflow routing can be applied.  Should
+        *not* generate any text (such as the "REC-" or "NOTE-"
+        prefix on the W3C designation content).  No default.  If
+        w3c-doctype is "other", other-doctype should be filled in.
+
+        status attribute:
+        Indicates the stage of review of the document.  May affect
+        the stylesheet's treatment of ednotes (e.g., whether to
+        output them).  No default. -->
+
+<!ENTITY % local.spec.att " ">
+<!ENTITY % spec.attlist "INCLUDE">
+<![%spec.attlist;[
+<!ATTLIST spec
+        %common.att;
+        %local.spec.att;
+        w3c-doctype     (cr
+                        |dispcmts
+                        |issues
+                        |wgnote
+                        |memsub
+                        |teamsub
+                        |note
+                        |other
+                        |pr
+                        |per
+                        |rec
+                        |wd
+                        |review)                #IMPLIED
+        other-doctype   CDATA                   #IMPLIED
+        status          (int-review
+                        |ext-review
+                        |final)                 #IMPLIED
+>
+]]>
+
+<!ENTITY % front.element "INCLUDE">
+<![%front.element;[
+<!ELEMENT front (div1+)>
+]]>
+<!ENTITY % front.attlist "INCLUDE">
+<![%front.attlist;[
+<!ATTLIST front %common.att;>
+]]>
+
+<!ENTITY % body.element "INCLUDE">
+<![%body.element;[
+<!ELEMENT body (div1+)>
+]]>
+<!ENTITY % body.attlist "INCLUDE">
+<![%body.attlist;[
+<!ATTLIST body %common.att;>
+]]>
+
+<!--
+#1997-09-30: maler: Added inform-div1 to back content.
+-->
+
+<!ENTITY % back.element "INCLUDE">
+<![%back.element;[
+<!ELEMENT back ((div1+, inform-div1*) | inform-div1+)>
+]]>
+<!ENTITY % back.attlist "INCLUDE">
+<![%back.attlist;[
+<!ATTLIST back %common.att;>
+]]>
+
+<!ENTITY % div1.element "INCLUDE">
+<![%div1.element;[
+<!ELEMENT div1 (head, (%div.mix;)*, div2*)>
+]]>
+<!ENTITY % div1.attlist "INCLUDE">
+<![%div1.attlist;[
+<!ATTLIST div1 %common.att;>
+]]>
+
+<!--
+#1997-09-30: maler: Added inform-div1 declarations.
+#2000-03-07: maler: Added div5 level.
+-->
+
+<!--    inform-div1: Non-normative division in back matter -->
+<!ENTITY % inform-div1.element "INCLUDE">
+<![%inform-div1.element;[
+<!ELEMENT inform-div1 (head, (%div.mix;)*, div2*)>
+]]>
+<!ENTITY % inform-div1.attlist "INCLUDE">
+<![%inform-div1.attlist;[
+<!ATTLIST inform-div1 %common.att;>
+]]>
+
+<!ENTITY % div2.element "INCLUDE">
+<![%div2.element;[
+<!ELEMENT div2 (head, (%div.mix;)*, div3*)>
+]]>
+<!ENTITY % div2.attlist "INCLUDE">
+<![%div2.attlist;[
+<!ATTLIST div2 %common.att;>
+]]>
+
+<!ENTITY % div3.element "INCLUDE">
+<![%div3.element;[
+<!ELEMENT div3 (head, (%div.mix;)*, div4*)>
+]]>
+<!ENTITY % div3.attlist "INCLUDE">
+<![%div3.attlist;[
+<!ATTLIST div3 %common.att;>
+]]>
+
+<!ENTITY % div4.element "INCLUDE">
+<![%div4.element;[
+<!ELEMENT div4 (head, (%div.mix;)*, div5*)>
+]]>
+<!ENTITY % div4.attlist "INCLUDE">
+<![%div4.attlist;[
+<!ATTLIST div4 %common.att;>
+]]>
+
+<!ENTITY % div5.element "INCLUDE">
+<![%div5.element;[
+<!ELEMENT div5 (head, (%div.mix;)*)>
+]]>
+<!ENTITY % div5.attlist "INCLUDE">
+<![%div5.attlist;[
+<!ATTLIST div5 %common.att;>
+]]>
+
+<!-- ............................................................... -->
+<!-- Specification header .......................................... -->
+<!-- ............................................................... -->
+
+<!--
+#1998-03-10: maler: Made header content model easily customizable.
+-->
+
+<!ENTITY % header.element "INCLUDE">
+<![%header.element;[
+<!ELEMENT header (%header.mdl;)>
+]]>
+<!ENTITY % header.attlist "INCLUDE">
+<![%header.attlist;[
+<!ATTLIST header %common.att;>
+]]>
+
+<!--    Example of title: "Extensible Cheese Language (XCL)" -->
+<!ENTITY % title.element "INCLUDE">
+<![%title.element;[
+<!ELEMENT title (#PCDATA|phrase)*>
+]]>
+<!ENTITY % title.attlist "INCLUDE">
+<![%title.attlist;[
+<!ATTLIST title %common.att;>
+]]>
+
+<!--    Example of subtitle: "A Cheesy Specification" -->
+<!ENTITY % subtitle.element "INCLUDE">
+<![%subtitle.element;[
+<!ELEMENT subtitle (#PCDATA|phrase)*>
+]]>
+<!ENTITY % subtitle.attlist "INCLUDE">
+<![%subtitle.attlist;[
+<!ATTLIST subtitle %common.att;>
+]]>
+
+<!--    Example of version: "Version 666.0" -->
+<!ENTITY % version.element "INCLUDE">
+<![%version.element;[
+<!ELEMENT version (#PCDATA|phrase)*>
+]]>
+<!ENTITY % version.attlist "INCLUDE">
+<![%version.attlist;[
+<!ATTLIST version %common.att;>
+]]>
+
+<!--    Example of w3c-designation: "WD-xcl-19991231" -->
+<!ENTITY % w3c-designation.element "INCLUDE">
+<![%w3c-designation.element;[
+<!ELEMENT w3c-designation (#PCDATA|phrase)*>
+]]>
+<!ENTITY % w3c-designation.attlist "INCLUDE">
+<![%w3c-designation.attlist;[
+<!ATTLIST w3c-designation %common.att;>
+]]>
+
+<!--    Example of w3c-doctype: "W3C Working Draft" -->
+<!ENTITY % w3c-doctype.element "INCLUDE">
+<![%w3c-doctype.element;[
+<!ELEMENT w3c-doctype (#PCDATA|phrase)*>
+]]>
+<!ENTITY % w3c-doctype.attlist "INCLUDE">
+<![%w3c-doctype.attlist;[
+<!ATTLIST w3c-doctype %common.att;>
+]]>
+
+<!--
+#1998-03-10: maler: Made pubdate content model easily customizable.
+-->
+
+<!ENTITY % pubdate.element "INCLUDE">
+<![%pubdate.element;[
+<!ELEMENT pubdate (%pubdate.mdl;)>
+]]>
+<!ENTITY % pubdate.attlist "INCLUDE">
+<![%pubdate.attlist;[
+<!ATTLIST pubdate %common.att;>
+]]>
+
+<!ENTITY % day.element "INCLUDE">
+<![%day.element;[
+<!ELEMENT day (#PCDATA|phrase)*>
+]]>
+<!ENTITY % day.attlist "INCLUDE">
+<![%day.attlist;[
+<!ATTLIST day %common.att;>
+]]>
+
+<!ENTITY % month.element "INCLUDE">
+<![%month.element;[
+<!ELEMENT month (#PCDATA|phrase)*>
+]]>
+<!ENTITY % month.attlist "INCLUDE">
+<![%month.attlist;[
+<!ATTLIST month %common.att;>
+]]>
+
+<!ENTITY % year.element "INCLUDE">
+<![%year.element;[
+<!ELEMENT year (#PCDATA|phrase)*>
+]]>
+<!ENTITY % year.attlist "INCLUDE">
+<![%year.attlist;[
+<!ATTLIST year %common.att;>
+]]>
+
+<!--
+#1999-07-02: maler: Declared copyright element.
+-->
+
+<!ENTITY % copyright.element "INCLUDE">
+<![%copyright.element;[
+<!ELEMENT copyright (%hdr.mix;)+>
+]]>
+<!ENTITY % copyright.attlist "INCLUDE">
+<![%copyright.attlist;[
+<!ATTLIST copyright %common.att;>
+]]>
+
+<!--    Example of notice: "This draft is for public comment..." -->
+<!ENTITY % notice.element "INCLUDE">
+<![%notice.element;[
+<!ELEMENT notice (%hdr.mix;)+>
+]]>
+<!ENTITY % notice.attlist "INCLUDE">
+<![%notice.attlist;[
+<!ATTLIST notice %common.att;>
+]]>
+
+<!--
+#2000-03-07: maler: Broadened models of *loc to %p.pcd.mix;.
+-->
+
+<!ENTITY % publoc.element "INCLUDE">
+<![%publoc.element;[
+<!ELEMENT publoc (%p.pcd.mix;)*>
+]]>
+<!ENTITY % publoc.attlist "INCLUDE">
+<![%publoc.attlist;[
+<!ATTLIST publoc %common.att;>
+]]>
+
+<!--
+#2002-08-15: nwalsh: Added altlocs element.
+  The semantics of the altlocs are equivalent to the Dublin Core relation element
+  with type="hasVersion". Each of the loc elements inside altlocs should identify
+  an alternate version of the resource described by the document, for example
+  HTML, XML, and PDF forms.
+-->
+<!ENTITY % altlocs.element "INCLUDE">
+<![%altlocs.element;[
+<!ELEMENT altlocs (loc+)>
+]]>
+<!ENTITY % altlocs.attlist "INCLUDE">
+<![%altlocs.attlist;[
+<!ATTLIST altlocs %common.att;>
+]]>
+
+<!ENTITY % prevlocs.element "INCLUDE">
+<![%prevlocs.element;[
+<!ELEMENT prevlocs (%p.pcd.mix;)*>
+]]>
+<!ENTITY % prevlocs.attlist "INCLUDE">
+<![%prevlocs.attlist;[
+<!ATTLIST prevlocs %common.att;>
+]]>
+
+<!--
+#2005-10-13: nwalsh: restrict latestloc content model.
+  New pubrules allows for multiple latestlocs. For some reason, this element
+  used to allow PCDATA. Now it allows only loc elements. If this causes
+  trouble, tell Norm.
+-->
+<!ENTITY % latestloc.element "INCLUDE">
+<![%latestloc.element;[
+<!ELEMENT latestloc (loc+)>
+]]>
+<!ENTITY % latestloc.attlist "INCLUDE">
+<![%latestloc.attlist;[
+<!ATTLIST latestloc %common.att;>
+]]>
+
+<!ENTITY % errataloc.element "INCLUDE">
+<![%errataloc.element;[
+<!ELEMENT errataloc EMPTY>
+]]>
+<!ENTITY % errataloc.attlist "INCLUDE">
+<![%errataloc.attlist;[
+<!ATTLIST errataloc
+	%common.att;
+        %simple-xlink.att;
+	%href-req.att;
+>
+]]>
+
+<!ENTITY % preverrataloc.element "INCLUDE">
+<![%preverrataloc.element;[
+<!ELEMENT preverrataloc EMPTY>
+]]>
+<!ENTITY % preverrataloc.attlist "INCLUDE">
+<![%preverrataloc.attlist;[
+<!ATTLIST preverrataloc
+	%common.att;
+        %simple-xlink.att;
+	%href-req.att;
+>
+]]>
+
+<!ENTITY % translationloc.element "INCLUDE">
+<![%translationloc.element;[
+<!ELEMENT translationloc EMPTY>
+]]>
+<!ENTITY % translationloc.attlist "INCLUDE">
+<![%translationloc.attlist;[
+<!ATTLIST translationloc
+	%common.att;
+        %simple-xlink.att;
+	%href-req.att;
+>
+]]>
+
+<!--      loc (defined in "Phrase-level elements" below) -->
+
+<!ENTITY % authlist.element "INCLUDE">
+<![%authlist.element;[
+<!ELEMENT authlist (author+)>
+]]>
+<!ENTITY % authlist.attlist "INCLUDE">
+<![%authlist.attlist;[
+<!ATTLIST authlist %common.att;>
+]]>
+
+<!--
+#1997-09-30: maler: Made affiliation optional.
+#1998-03-10: maler: Made email optional.
+-->
+
+<!ENTITY % author.element "INCLUDE">
+<![%author.element;[
+<!ELEMENT author (name, affiliation?, email?)>
+]]>
+<!ENTITY % author.attlist "INCLUDE">
+<![%author.attlist;[
+<!ATTLIST author %common.att;>
+]]>
+
+<!ENTITY % name.element "INCLUDE">
+<![%name.element;[
+<!ELEMENT name (#PCDATA|phrase)*>
+]]>
+<!ENTITY % name.attlist "INCLUDE">
+<![%name.attlist;[
+<!ATTLIST name
+        %common.att;
+        %key.att;>
+]]>
+
+<!ENTITY % affiliation.element "INCLUDE">
+<![%affiliation.element;[
+<!ELEMENT affiliation (#PCDATA|phrase)*>
+]]>
+<!ENTITY % affiliation.attlist "INCLUDE">
+<![%affiliation.attlist;[
+<!ATTLIST affiliation %common.att;>
+]]>
+
+<!--
+#1999-07-02: maler: Added show/actuate attributes and default values.
+-->
+
+
+<!ENTITY % email.element "INCLUDE">
+<![%email.element;[
+<!ELEMENT email (#PCDATA|phrase)*>
+]]>
+<!--    href attribute:
+        email functions as a hypertext reference through this
+        required attribute.  Typically the reference would use
+        the mailto: scheme.  E.g.:
+
+<email href="mailto:[email protected]">[email protected]</email>
+        -->
+
+<!ENTITY % email.attlist "INCLUDE">
+<![%email.attlist;[
+<!ATTLIST email
+        %common.att;
+        %simple-xlink.att;
+        %href-req.att;
+        %user-new.att;>
+]]>
+
+<!--
+#1998-05-15: maler: Changed status content from %statusobj.mix;
+#                   to plain %obj.mix;.  statusp is obsolete.
+-->
+
+<!ENTITY % status.element "INCLUDE">
+<![%status.element;[
+<!ELEMENT status (%obj.mix;)+>
+]]>
+<!ENTITY % status.attlist "INCLUDE">
+<![%status.attlist;[
+<!ATTLIST status %common.att;>
+]]>
+
+<!ENTITY % abstract.element "INCLUDE">
+<![%abstract.element;[
+<!ELEMENT abstract (%hdr.mix;)*>
+]]>
+<!ENTITY % abstract.attlist "INCLUDE">
+<![%abstract.attlist;[
+<!ATTLIST abstract %common.att;>
+]]>
+
+<!ENTITY % pubstmt.element "INCLUDE">
+<![%pubstmt.element;[
+<!ELEMENT pubstmt (%hdr.mix;)+>
+]]>
+<!ENTITY % pubstmt.attlist "INCLUDE">
+<![%pubstmt.attlist;[
+<!ATTLIST pubstmt %common.att;>
+]]>
+
+<!ENTITY % sourcedesc.element "INCLUDE">
+<![%sourcedesc.element;[
+<!ELEMENT sourcedesc (%hdr.mix;)+>
+]]>
+<!ENTITY % sourcedesc.attlist "INCLUDE">
+<![%sourcedesc.attlist;[
+<!ATTLIST sourcedesc %common.att;>
+]]>
+
+<!ENTITY % langusage.element "INCLUDE">
+<![%langusage.element;[
+<!ELEMENT langusage (language+)>
+]]>
+<!ENTITY % langusage.attlist "INCLUDE">
+<![%langusage.attlist;[
+<!ATTLIST langusage %common.att;>
+]]>
+
+<!ENTITY % language.element "INCLUDE">
+<![%language.element;[
+<!ELEMENT language (#PCDATA|phrase)*>
+]]>
+<!ENTITY % language.attlist "INCLUDE">
+<![%language.attlist;[
+<!ATTLIST language %common.att;>
+]]>
+
+<!ENTITY % revisiondesc.element "INCLUDE">
+<![%revisiondesc.element;[
+<!ELEMENT revisiondesc (%hdr.mix;)+>
+]]>
+<!ENTITY % revisiondesc.attlist "INCLUDE">
+<![%revisiondesc.attlist;[
+<!ATTLIST revisiondesc %common.att;>
+]]>
+
+<!-- ............................................................... -->
+<!-- Paragraph ..................................................... -->
+<!-- ............................................................... -->
+
+<!--
+#1997-09-30: maler: Changed from %obj.mix; to %p.mix;.
+#1997-12-29: maler: Changed order of %p.mix; and %p.pcd.mix;
+#                   references.
+#1997-12-29: maler: Changed order of %statusobj.mix; and
+#                   %statusp.pcd.mix; references.
+#1998-05-14: maler: Removed statusp declarations.
+-->
+
+<!ENTITY % p.element "INCLUDE">
+<![%p.element;[
+<!ELEMENT p (%p.pcd.mix;|%p.mix;)*>
+]]>
+<!ENTITY % p.attlist "INCLUDE">
+<![%p.attlist;[
+<!ATTLIST p %common.att;>
+]]>
+
+<!-- ............................................................... -->
+<!-- Regular lists ................................................. -->
+<!-- ............................................................... -->
+
+<!--    ulist: Unordered list, typically bulleted. -->
+<!ENTITY % ulist.element "INCLUDE">
+<![%ulist.element;[
+<!ELEMENT ulist (item+)>
+]]>
+<!--    spacing attribute:
+        Use "normal" to get normal vertical spacing for items;
+        use "compact" to get less spacing.  The default is dependent
+        on the stylesheet. -->
+<!ENTITY % ulist.attlist "INCLUDE">
+<![%ulist.attlist;[
+<!ATTLIST ulist
+        %common.att;
+        spacing         (normal|compact)        #IMPLIED>
+]]>
+
+<!--    olist: Ordered list, typically numbered. -->
+<!ENTITY % olist.element "INCLUDE">
+<![%olist.element;[
+<!ELEMENT olist (item+)>
+]]>
+<!--    spacing attribute:
+        Use "normal" to get normal vertical spacing for items;
+        use "compact" to get less spacing.  The default is dependent
+        on the stylesheet. -->
+<!ENTITY % olist.attlist "INCLUDE">
+<![%olist.attlist;[
+<!ATTLIST olist
+        %common.att;
+        spacing         (normal|compact)        #IMPLIED>
+]]>
+
+<!ENTITY % item.element "INCLUDE">
+<![%item.element;[
+<!ELEMENT item (%obj.mix;)+>
+]]>
+<!ENTITY % item.attlist "INCLUDE">
+<![%item.attlist;[
+<!ATTLIST item %common.att;>
+]]>
+
+<!--    slist: Simple list, typically with no mark. -->
+<!ENTITY % slist.element "INCLUDE">
+<![%slist.element;[
+<!ELEMENT slist (sitem+)>
+]]>
+<!ENTITY % slist.attlist "INCLUDE">
+<![%slist.attlist;[
+<!ATTLIST slist %common.att;>
+]]>
+
+<!ENTITY % sitem.element "INCLUDE">
+<![%sitem.element;[
+<!ELEMENT sitem (%p.pcd.mix;)*>
+]]>
+<!ENTITY % sitem.attlist "INCLUDE">
+<![%sitem.attlist;[
+<!ATTLIST sitem %common.att;>
+]]>
+
+<!--    glist: Glossary list, typically two-column. -->
+<!ENTITY % glist.element "INCLUDE">
+<![%glist.element;[
+<!ELEMENT glist (gitem+)>
+]]>
+<!ENTITY % glist.attlist "INCLUDE">
+<![%glist.attlist;[
+<!ATTLIST glist %common.att;>
+]]>
+
+<!ENTITY % gitem.element "INCLUDE">
+<![%gitem.element;[
+<!ELEMENT gitem (label, def)>
+]]>
+<!ENTITY % gitem.attlist "INCLUDE">
+<![%gitem.attlist;[
+<!ATTLIST gitem %common.att;>
+]]>
+
+<!ENTITY % label.element "INCLUDE">
+<![%label.element;[
+<!ELEMENT label (%label.pcd.mix;)*>
+]]>
+<!ENTITY % label.attlist "INCLUDE">
+<![%label.attlist;[
+<!ATTLIST label %common.att;>
+]]>
+
+<!ENTITY % def.element "INCLUDE">
+<![%def.element;[
+<!ELEMENT def (%obj.mix;)*>
+]]>
+<!ENTITY % def.attlist "INCLUDE">
+<![%def.attlist;[
+<!ATTLIST def %common.att;>
+]]>
+
+<!-- ............................................................... -->
+<!-- Special lists ................................................. -->
+<!-- ............................................................... -->
+
+<!--    blist: Bibliography list. -->
+<!ENTITY % blist.element "INCLUDE">
+<![%blist.element;[
+<!ELEMENT blist (bibl+)>
+]]>
+<!ENTITY % blist.attlist "INCLUDE">
+<![%blist.attlist;[
+<!ATTLIST blist %common.att;>
+]]>
+
+<!--
+#1999-07-02: maler: Added show/actuate attributes and default values.
+-->
+
+<!ENTITY % bibl.element "INCLUDE">
+<![%bibl.element;[
+<!ELEMENT bibl (%bibl.pcd.mix;)*>
+]]>
+<!--    href attribute:
+        bibl optionally functions as a hypertext reference to the
+        referred-to resource through this attribute.  E.g.:
+
+        <bibl href="http://www.my.com/doc.htm">My Document</bibl>
+        -->
+<!ENTITY % bibl.attlist "INCLUDE">
+<![%bibl.attlist;[
+<!ATTLIST bibl
+        %common.att;
+        %simple-xlink.att;
+        %href.att;
+        %user-replace.att;
+        %key.att;>
+]]>
+
+<!--    orglist: Organization member list. -->
+<!ENTITY % orglist.element "INCLUDE">
+<![%orglist.element;[
+<!ELEMENT orglist (member+)>
+]]>
+<!ENTITY % orglist.attlist "INCLUDE">
+<![%orglist.attlist;[
+<!ATTLIST orglist %common.att;>
+]]>
+
+<!--
+#1997-09-30: maler: Added optional affiliation.
+-->
+
+<!ENTITY % member.element "INCLUDE">
+<![%member.element;[
+<!ELEMENT member (name, affiliation?, role?)>
+]]>
+<!ENTITY % member.attlist "INCLUDE">
+<![%member.attlist;[
+<!ATTLIST member %common.att;>
+]]>
+
+<!--      name (defined in "Specification header" above) -->
+<!--      affiliation (defined in "Specification header" above) -->
+
+<!ENTITY % role.element "INCLUDE">
+<![%role.element;[
+<!ELEMENT role (#PCDATA|phrase)*>
+]]>
+<!ENTITY % role.attlist "INCLUDE">
+<![%role.attlist;[
+<!ATTLIST role %common.att;>
+]]>
+
+<!-- ............................................................... -->
+<!-- Notes ......................................................... -->
+<!-- ............................................................... -->
+
+<!ENTITY % note.element "INCLUDE">
+<![%note.element;[
+<!ELEMENT note (%obj.mix;)+>
+]]>
+<!ENTITY % note.attlist "INCLUDE">
+<![%note.attlist;[
+<!ATTLIST note %common.att;>
+]]>
+
+<!--
+#1998-05-14: maler: Declared issue element.
+#2000-03-07: maler: Added head, source, resolution, and status.
+-->
+
+<!ENTITY % issue.element "INCLUDE">
+<![%issue.element;[
+<!ELEMENT issue (head?, source*, (%obj.mix;)+, resolution?)>
+]]>
+<!--    status attribute:
+        Indicates whether the issue is open or closed.  Note that
+        the lack of a resolution element does not necessarily mean
+        that the issue is still open. -->
+<!ENTITY % issue.attlist "INCLUDE">
+<![%issue.attlist;[
+<!ATTLIST issue
+        id              ID              #REQUIRED
+        %role.att;
+        %diff.att;
+        status          (open
+                        |closed)        "open"
+>
+]]>
+
+<!ENTITY % source.element "INCLUDE">
+<![%source.element;[
+<!ELEMENT source (%p.pcd.mix;)*>
+]]>
+<!ENTITY % source.attlist "INCLUDE">
+<![%source.attlist;[
+<!ATTLIST source
+        %common.att;>
+]]>
+
+<!ENTITY % resolution.element "INCLUDE">
+<![%resolution.element;[
+<!ELEMENT resolution (%obj.mix;)+>
+]]>
+<!ENTITY % resolution.attlist "INCLUDE">
+<![%resolution.attlist;[
+<!ATTLIST resolution %common.att;>
+]]>
+
+<!--    wfcnote: Well-formedness constraint note. -->
+<!ENTITY % wfcnote.element "INCLUDE">
+<![%wfcnote.element;[
+<!ELEMENT wfcnote (head, (%obj.mix;)+)>
+]]>
+<!--    ID attribute:
+        wfcnote must have an ID so that it can be pointed to
+        from a wfc element in a production. -->
+<!ENTITY % wfcnote.attlist "INCLUDE">
+<![%wfcnote.attlist;[
+<!ATTLIST wfcnote
+        %common-idreq.att;>
+]]>
+
+<!--    vcnote: Validity constraint note. -->
+<!ENTITY % vcnote.element "INCLUDE">
+<![%vcnote.element;[
+<!ELEMENT vcnote (head, (%obj.mix;)+)>
+]]>
+<!--    ID attribute:
+        vcnote must have an ID so that it can be pointed to
+        from a vc element in a production. -->
+<!ENTITY % vcnote.attlist "INCLUDE">
+<![%vcnote.attlist;[
+<!ATTLIST vcnote
+        %common-idreq.att;>
+]]>
+
+<!--
+#1998-05-21: maler: Declared generic constraintnote element.
+-->
+
+<!--    constraintnote: Generic constraint note. -->
+<!ENTITY % constraintnote.element "INCLUDE">
+<![%constraintnote.element;[
+<!ELEMENT constraintnote (head, (%obj.mix;)+)>
+]]>
+<!--    ID attribute:
+        constraintnote must have an ID so that it can be
+        pointed to from a constraint element in a production. -->
+<!--    type attribute:
+        constraintnote must have a type value keyword so that
+        it can be correctly characterized in the specification. -->
+<!ENTITY % constraintnote.attlist "INCLUDE">
+<![%constraintnote.attlist;[
+<!ATTLIST constraintnote
+        %common-idreq.att;
+        type            NMTOKEN         #REQUIRED>
+]]>
+
+<!-- ............................................................... -->
+<!-- Basic display elements ........................................ -->
+<!-- ............................................................... -->
+
+<!--
+#1998-03-23: maler: Added xml:space attribute.
+-->
+
+<!--    eg: Example element, with whitespace respected. -->
+<!ENTITY % eg.element "INCLUDE">
+<![%eg.element;[
+<!ELEMENT eg (%eg.pcd.mix;)*>
+]]>
+<!ENTITY % eg.attlist "INCLUDE">
+<![%eg.attlist;[
+<!ATTLIST eg
+        %common.att;
+        %xmlspace.att;>
+]]>
+
+<!--
+#2000-03-07: maler: Removed the xml:attributes attribute.
+#                   Added %local.graphic.att;.
+-->
+
+<!--    graphic: Displayed graphic.  Graphic data should be
+        displayed at the point where it is referenced.  Not
+        actually conforming to XLink right now. -->
+<!ENTITY % graphic.element "INCLUDE">
+<![%graphic.element;[
+<!ELEMENT graphic EMPTY>
+]]>
+<!--    source attribute:
+        The graphic data must reside at the location pointed to. -->
+<!ENTITY % local.graphic.att " ">
+<!ENTITY % graphic.attlist "INCLUDE">
+<![%graphic.attlist;[
+<!ATTLIST graphic
+        %common.att;
+        %simple-xlink.att;
+        source                  CDATA           #REQUIRED
+        %auto-embed.att;
+        alt                     CDATA           #IMPLIED
+        %local.graphic.att;>
+]]>
+
+<!--
+#2000-03-07: maler: Added proto element structure.
+-->
+
+<!--    proto: Function prototype, in the XPath/XPointer style. -->
+<!ENTITY % proto.element "INCLUDE">
+<![%proto.element;[
+<!ELEMENT proto (arg*)>
+]]>
+
+<!ENTITY % local.proto.att " ">
+<!ENTITY % proto.attlist "INCLUDE">
+<![%proto.attlist;[
+<!ATTLIST proto
+        %common.att;
+	%local.proto.att;
+        name            NMTOKEN         #REQUIRED
+        return-type     %argtypes;      #REQUIRED
+>
+]]>
+
+<!ENTITY % local.arg.att " ">
+<!ENTITY % arg.element "INCLUDE">
+<![%arg.element;[
+<!ELEMENT arg EMPTY>
+]]>
+<!ENTITY % arg.attlist "INCLUDE">
+<![%arg.attlist;[
+<!ATTLIST arg
+        %common.att;
+	%local.arg.att;
+        type            %argtypes;      #REQUIRED
+        occur           (opt|req)       #IMPLIED
+>
+]]>
+
+<!--
+#2000-03-07: maler: Added example element.
+-->
+
+<!ENTITY % example.element "INCLUDE">
+<![%example.element;[
+<!ELEMENT example (head?, (%obj.mix;)+)>
+]]>
+<!ENTITY % example.attlist "INCLUDE">
+<![%example.attlist;[
+<!ATTLIST example %common.att;>
+]]>
+
+<!-- ............................................................... -->
+<!-- EBNF .......................................................... -->
+<!-- ............................................................... -->
+
+<!--
+#1997-11-28: maler: Added prodgroup to scrap and defined it.
+#1998-05-21: maler: Added constraint to prod.
+#1999-07-02: maler: Added prodrecap to scrap; broadened scrap model.
+#                   Added headstyle attribute to scrap.
+-->
+
+<!--    scrap: Collection of EBNF language productions. -->
+<!ENTITY % scrap.element "INCLUDE">
+<![%scrap.element;[
+<!ELEMENT scrap (head, (prodgroup | prod | bnf | prodrecap)+)>
+]]>
+<!--    lang attribute:
+        The scrap can link to a description of the language used,
+        found in a language element in the header.
+        headstyle attribute:
+        Allows a scrap title to be suppressed from output.  To be
+        used only when a scrap title directly next to a section
+        title is distracting or repetetive. -->
+<!ENTITY % scrap.attlist "INCLUDE">
+<![%scrap.attlist;[
+<!ATTLIST scrap
+        %common.att;
+        lang            IDREF           #IMPLIED
+        headstyle       (show|suppress) "show"
+>
+]]>
+
+<!--    prodgroup: Sub-collection of productions, needed for
+        formatting reasons. -->
+<!ENTITY % prodgroup.element "INCLUDE">
+<![%prodgroup.element;[
+<!ELEMENT prodgroup (prod+)>
+]]>
+<!--    pcw<n> attributes:
+        Presentational attributes to control the width
+        of the "pseudo-table" columns used to output
+        groups of productions. -->
+<!ENTITY % prodgroup.attlist "INCLUDE">
+<![%prodgroup.attlist;[
+<!ATTLIST prodgroup
+        %common.att;
+        pcw1            CDATA           #IMPLIED
+        pcw2            CDATA           #IMPLIED
+        pcw3            CDATA           #IMPLIED
+        pcw4            CDATA           #IMPLIED
+        pcw5            CDATA           #IMPLIED
+>
+]]>
+
+<!--    prod: EBNF language production. -->
+<!ENTITY % prod.element "INCLUDE">
+<![%prod.element;[
+<!ELEMENT prod (lhs, (rhs, (com|wfc|vc|constraint)*)+)>
+]]>
+<!--    ID attribute:
+        The production must have an ID so that cross-references
+        (specref) and mentions of nonterminals (nt) can link to
+        it. -->
+<!ENTITY % prod.attlist "INCLUDE">
+<![%prod.attlist;[
+<!ATTLIST prod
+        %common-idreq.att;
+	num	CDATA	#IMPLIED>
+]]>
+
+<!--    lhs: Left-hand side of production. -->
+<!ENTITY % lhs.element "INCLUDE">
+<![%lhs.element;[
+<!ELEMENT lhs (#PCDATA|phrase)*>
+]]>
+<!ENTITY % lhs.attlist "INCLUDE">
+<![%lhs.attlist;[
+<!ATTLIST lhs %common.att;>
+]]>
+
+<!--    rhs: Right-hand side of production; may have many
+        "right-hand sides," one to a line. -->
+<!ENTITY % rhs.element "INCLUDE">
+<![%rhs.element;[
+<!ELEMENT rhs (#PCDATA|phrase|nt|xnt|com)*>
+]]>
+<!ENTITY % rhs.attlist "INCLUDE">
+<![%rhs.attlist;[
+<!ATTLIST rhs %common.att;>
+]]>
+
+<!--      nt and xnt (defined in "Phrase-level elements" below) -->
+
+<!--
+#1997-11-28: maler: Added loc and bibref to com content.
+-->
+
+<!--    com: Production comment. -->
+<!ENTITY % com.element "INCLUDE">
+<![%com.element;[
+<!ELEMENT com (#PCDATA|phrase|loc|bibref)*>
+]]>
+<!ENTITY % com.attlist "INCLUDE">
+<![%com.attlist;[
+<!ATTLIST com %common.att;>
+]]>
+
+<!--    wfc: Reference to a well-formedness constraint; should
+        generate the head of the wfcnote pointed to. -->
+<!ENTITY % wfc.element "INCLUDE">
+<![%wfc.element;[
+<!ELEMENT wfc EMPTY>
+]]>
+<!--    def attribute:
+        Each well formedness tagline in a production must link to the
+        wfcnote that defines it. -->
+<!ENTITY % wfc.attlist "INCLUDE">
+<![%wfc.attlist;[
+<!ATTLIST wfc
+        %def-req.att;
+        %common.att;>
+]]>
+
+<!--    vc: Reference to a validity constraint; should generate
+        the head of the vcnote pointed to. -->
+<!ENTITY % vc.element "INCLUDE">
+<![%vc.element;[
+<!ELEMENT vc EMPTY>
+]]>
+<!--    def attribute:
+        Each validity tagline in a production must link to the vcnote
+        that defines it. -->
+<!ENTITY % vc.attlist "INCLUDE">
+<![%vc.attlist;[
+<!ATTLIST vc
+        %def-req.att;
+        %common.att;>
+]]>
+
+<!--
+#1998-05-21: maler: Declared generic constraint element.
+-->
+
+<!--    constraint: Reference to a generic constraint; should
+        generate the head of the constraintnote pointed to. -->
+<!ENTITY % constraint.element "INCLUDE">
+<![%constraint.element;[
+<!ELEMENT constraint EMPTY>
+]]>
+<!--    def attribute:
+        Each constraint tagline in a production must link to the
+        constraint note that defines it. -->
+<!ENTITY % constraint.attlist "INCLUDE">
+<![%constraint.attlist;[
+<!ATTLIST constraint
+        %def-req.att;
+        %common.att;>
+]]>
+
+<!--
+#1998-03-23: maler: Added xml:space attribute.
+-->
+
+<!--    bnf: Un-marked-up EBNF production, with whitespace
+        respected. -->
+<!ENTITY % bnf.element "INCLUDE">
+<![%bnf.element;[
+<!ELEMENT bnf (%eg.pcd.mix;)*>
+]]>
+<!ENTITY % bnf.attlist "INCLUDE">
+<![%bnf.attlist;[
+<!ATTLIST bnf
+        %common.att;
+        %xmlspace.att;>
+]]>
+
+<!--
+#1999-07-02: maler: Declared prodrecap.
+-->
+
+<!--    prodrecap: Reference to production or bnf that appears
+        in its "normative" form elsewhere in the spec; should
+        generate a copy of the original production, without
+        a production number next to it. -->
+<!ENTITY % prodrecap.element "INCLUDE">
+<![%prodrecap.element;[
+<!ELEMENT prodrecap EMPTY>
+]]>
+<!ENTITY % prodrecap.attlist "INCLUDE">
+<![%prodrecap.attlist;[
+<!ATTLIST prodrecap
+        %common.att;
+        %ref-req.att;>
+]]>
+
+<!-- ............................................................... -->
+<!-- Table ......................................................... -->
+<!-- ............................................................... -->
+
+<!--
+#1997-10-16: maler: Added table mechanism.
+#1997-11-28: maler: Added non-null system ID to entity declaration.
+#                   Added HTML table module.
+#1997-12-29: maler: IGNOREd SGML Open table model.
+#1998-03-10: maler: Removed SGML Open table model.
+#                   Merged html-tbl.mod file into main file.
+#                   Added %common.att; to all HTML table elements.
+#1998-05-14: maler: Replaced table model with full HTML 4.0 model.
+#                   Removed htable in favor of table.
+#                   Removed htbody in favor of tbody.
+-->
+
+<!ENTITY % cellhalign.att
+        'align          (left|center
+                        |right|justify
+                        |char)          #IMPLIED
+        char            CDATA           #IMPLIED
+        charoff         CDATA           #IMPLIED'>
+
+<!ENTITY % cellvalign.att
+        'valign         (top|middle
+                        |bottom
+                        |baseline)      #IMPLIED'>
+
+<!ENTITY % thtd.att
+        'abbr           CDATA           #IMPLIED
+        axis            CDATA           #IMPLIED
+        headers         IDREFS          #IMPLIED
+        scope           (row
+                        |col
+                        |rowgroup
+                        |colgroup)      #IMPLIED
+        rowspan         NMTOKEN         "1"
+        colspan         NMTOKEN         "1"'>
+
+<!ENTITY % width.att
+        'width          CDATA           #IMPLIED'>
+
+<!ENTITY % span.att
+        'span           NMTOKEN         "1"'>
+
+<!--    table: HTML-based geometric table model. -->
+<!ENTITY % table.element "INCLUDE">
+<![%table.element;[
+<!ELEMENT table
+        (caption?, (col*|colgroup*), thead?, tfoot?, tbody+)>
+]]>
+<!ENTITY % table.attlist "INCLUDE">
+<![%table.attlist;[
+<!ATTLIST table
+        %common.att;
+        %width.att;
+        summary         CDATA           #IMPLIED
+        border          CDATA           #IMPLIED
+        frame           (void|above
+                        |below|hsides
+                        |lhs|rhs
+                        |vsides|box
+                        |border)        #IMPLIED
+        rules           (none|groups
+                        |rows|cols
+                        |all)           #IMPLIED
+        cellspacing     CDATA           #IMPLIED
+        cellpadding     CDATA           #IMPLIED>
+]]>
+
+<!ENTITY % caption.element "INCLUDE">
+<![%caption.element;[
+<!ELEMENT caption (%p.pcd.mix;)*>
+]]>
+<!ENTITY % caption.attlist "INCLUDE">
+<![%caption.attlist;[
+<!ATTLIST caption %common.att;>
+]]>
+
+<!ENTITY % col.element "INCLUDE">
+<![%col.element;[
+<!ELEMENT col EMPTY>
+]]>
+<!ENTITY % col.attlist "INCLUDE">
+<![%col.attlist;[
+<!ATTLIST col
+        %common.att;
+        %span.att;
+        %width.att;
+        %cellhalign.att;
+        %cellvalign.att;>
+]]>
+
+<!ENTITY % colgroup.element "INCLUDE">
+<![%colgroup.element;[
+<!ELEMENT colgroup (col)*>
+]]>
+<!ENTITY % colgroup.attlist "INCLUDE">
+<![%colgroup.attlist;[
+<!ATTLIST colgroup
+        %common.att;
+        %span.att;
+        %width.att;
+        %cellhalign.att;
+        %cellvalign.att;>
+]]>
+
+<!ENTITY % thead.element "INCLUDE">
+<![%thead.element;[
+<!ELEMENT thead (tr)+>
+]]>
+<!ENTITY % thead.attlist "INCLUDE">
+<![%thead.attlist;[
+<!ATTLIST thead
+        %common.att;
+        %cellhalign.att;
+        %cellvalign.att;>
+]]>
+
+<!ENTITY % tfoot.element "INCLUDE">
+<![%tfoot.element;[
+<!ELEMENT tfoot (tr)+>
+]]>
+<!ENTITY % tfoot.attlist "INCLUDE">
+<![%tfoot.attlist;[
+<!ATTLIST tfoot
+        %common.att;
+        %cellhalign.att;
+        %cellvalign.att;>
+]]>
+
+<!ENTITY % tbody.element "INCLUDE">
+<![%tbody.element;[
+<!ELEMENT tbody (tr)+>
+]]>
+<!ENTITY % tbody.attlist "INCLUDE">
+<![%tbody.attlist;[
+<!ATTLIST tbody
+        %common.att;
+        %cellhalign.att;
+        %cellvalign.att;>
+]]>
+
+<!ENTITY % tr.element "INCLUDE">
+<![%tr.element;[
+<!ELEMENT tr (th|td)+>
+]]>
+<!ENTITY % tr.attlist "INCLUDE">
+<![%tr.attlist;[
+<!ATTLIST tr
+        %common.att;
+        %cellhalign.att;
+        %cellvalign.att;>
+]]>
+
+<!ENTITY % th.element "INCLUDE">
+<![%th.element;[
+<!ELEMENT th (%p.pcd.mix;|%p.mix;)*>
+]]>
+<!ENTITY % th.attlist "INCLUDE">
+<![%th.attlist;[
+<!ATTLIST th
+        %common.att;
+        %thtd.att;
+        %cellhalign.att;
+        %cellvalign.att;>
+]]>
+
+<!ENTITY % td.element "INCLUDE">
+<![%td.element;[
+<!ELEMENT td (%p.pcd.mix;|%p.mix;)*>
+]]>
+<!ENTITY % td.attlist "INCLUDE">
+<![%td.attlist;[
+<!ATTLIST td
+        %common.att;
+        %thtd.att;
+        %cellhalign.att;
+        %cellvalign.att;>
+]]>
+
+<!-- ............................................................... -->
+<!-- IDL structures for DOM specifications ......................... -->
+<!-- ............................................................... -->
+
+<!-- ............................................................... -->
+<!-- Specialized entities for classes .............................. -->
+
+<!ENTITY % idl-desc.class
+        "p|note">
+
+<!ENTITY % idl-tdef.class
+        "typedef|constant|exception|reference|group">
+
+<!ENTITY % idl-mod.class
+        "module|interface">
+
+<!ENTITY % idl-struct.class
+        "struct|enum|sequence|union|typename">
+
+<!ENTITY % idl-meth.class
+        "method|attribute">
+
+<!-- ............................................................... -->
+<!-- Specialized entities for mixtures ............................. -->
+
+<!--    Quick reference to content model mixtures:
+
+                        desc tdef mod struct meth
+group                     x    x   x    x      x
+definitions, module       x    x   x
+interface                 x    x               x
+typedef, case, component                x
+-->
+
+<!ENTITY % idl-grp.mix
+        "%idl-desc.class;|%idl-tdef.class;|%idl-mod.class;
+        |%idl-struct.class;|%idl-meth.class;">
+
+<!ENTITY % idl-defn.mix
+        "%idl-desc.class;|%idl-tdef.class;|%idl-mod.class;">
+
+<!ENTITY % idl-intfc.mix
+        "%idl-desc.class;|%idl-tdef.class;|%idl-meth.class;">
+
+<!ENTITY % idl-type.mix
+        "%idl-struct.class;">
+
+<!-- ............................................................... -->
+<!-- Specialized entities for common attributes .................... -->
+
+<!--    name attribute:
+        Provides a name.  Required. -->
+<!ENTITY % idl-name.att
+        'name                   CDATA           #REQUIRED'>
+
+<!--    type attribute:
+        Provides a type.  Required. -->
+<!ENTITY % idl-type.att
+        'type                   CDATA           #REQUIRED'>
+
+<!-- ............................................................... -->
+<!-- Common IDL element ............................................ -->
+
+<!ENTITY % descr.element "INCLUDE">
+<![%descr.element;[
+<!ELEMENT descr ((%obj.mix;)*)>
+]]>
+<!ENTITY % descr.attlist "INCLUDE">
+<![%descr.attlist;[
+<!ATTLIST descr %common.att;>
+]]>
+
+<!-- ............................................................... -->
+<!-- IDL definition elements ....................................... -->
+
+<!--    definitions: Top-level element for definitions. -->
+<!ENTITY % definitions.element "INCLUDE">
+<![%definitions.element;[
+<!ELEMENT definitions (%idl-defn.mix;)+>
+]]>
+<!ENTITY % definitions.attlist "INCLUDE">
+<![%definitions.attlist;[
+<!ATTLIST definitions %common.att;>
+]]>
+
+<!--    group: Element used to group a set of definitions. -->
+
+<!ENTITY % group.element "INCLUDE">
+<![%group.element;[
+<!ELEMENT group (descr, (%idl-grp.mix;)*)>
+]]>
+<!ENTITY % group.attlist "INCLUDE">
+<![%group.attlist;[
+<!ATTLIST group
+        %common.att;
+        %idl-name.att;>
+]]>
+
+<!--    interface: Definition of an interface. -->
+<!ENTITY % interface.element "INCLUDE">
+<![%interface.element;[
+<!ELEMENT interface (descr, (%idl-intfc.mix;)*)>
+]]>
+<!ENTITY % interface.attlist "INCLUDE">
+<![%interface.attlist;[
+<!ATTLIST interface
+        %common.att;
+        %idl-name.att;
+        inherits        CDATA           #IMPLIED>
+]]>
+
+<!--    module: Definition of a module. -->
+<!ENTITY % module.element "INCLUDE">
+<![%module.element;[
+<!ELEMENT module (descr, (%idl-defn.mix;)*)>
+]]>
+<!ENTITY % module.attlist "INCLUDE">
+<![%module.attlist;[
+<!ATTLIST module
+        %common.att;
+        %idl-name.att;>
+]]>
+
+<!--    reference: Reference to some other declaration. -->
+<!ENTITY % reference.element "INCLUDE">
+<![%reference.element;[
+<!ELEMENT reference EMPTY>
+]]>
+<!ENTITY % reference.attlist "INCLUDE">
+<![%reference.attlist;[
+<!ATTLIST reference
+        %common.att;
+        declaration     IDREF           #REQUIRED>
+]]>
+
+<!--    typedef: Definition of a named type. -->
+<!ENTITY % typedef.element "INCLUDE">
+<![%typedef.element;[
+<!ELEMENT typedef (descr, (%idl-type.mix;))>
+]]>
+<!ENTITY % typedef.attlist "INCLUDE">
+<![%typedef.attlist;[
+<!ATTLIST typedef
+        %common.att;
+        %idl-name.att;
+        array.size      NMTOKEN         #IMPLIED>
+]]>
+
+<!--    struct: Declaration of a struct type. -->
+<!ENTITY % struct.element "INCLUDE">
+<![%struct.element;[
+<!ELEMENT struct (descr, component+)>
+]]>
+<!ENTITY % struct.attlist "INCLUDE">
+<![%struct.attlist;[
+<!ATTLIST struct
+        %common.att;
+        %idl-name.att;>
+]]>
+
+<!--    component: Declaration of a structural member. -->
+<!ENTITY % component.element "INCLUDE">
+<![%component.element;[
+<!ELEMENT component (%idl-type.mix;)>
+]]>
+<!ENTITY % component.attlist "INCLUDE">
+<![%component.attlist;[
+<!ATTLIST component
+        %common.att;
+        %idl-name.att;>
+]]>
+
+<!--    union: Declaration of a union type. -->
+<!ENTITY % union.element "INCLUDE">
+<![%union.element;[
+<!ELEMENT union (descr, case+)>
+]]>
+<!ENTITY % union.attlist "INCLUDE">
+<![%union.attlist;[
+<!ATTLIST union
+        %common.att;
+        %idl-name.att;
+        switch.type     CDATA           #REQUIRED>
+]]>
+
+<!ENTITY % case.element "INCLUDE">
+<![%case.element;[
+<!ELEMENT case (descr, (%idl-type.mix;))>
+]]>
+<!ENTITY % case.attlist "INCLUDE">
+<![%case.attlist;[
+<!ATTLIST case
+        %common.att;
+        labels          CDATA           #REQUIRED>
+]]>
+
+<!--    enum: Declaration of an enum type. -->
+<!ENTITY % enum.element "INCLUDE">
+<![%enum.element;[
+<!ELEMENT enum (descr, enumerator+)>
+]]>
+<!ENTITY % enum.attlist "INCLUDE">
+<![%enum.attlist;[
+<!ATTLIST enum
+        %common.att;
+        %idl-name.att;>
+]]>
+
+<!ENTITY % enumerator.element "INCLUDE">
+<![%enumerator.element;[
+<!ELEMENT enumerator (descr)>
+]]>
+<!ENTITY % enumerator.attlist "INCLUDE">
+<![%enumerator.attlist;[
+<!ATTLIST enumerator
+        %common.att;
+        %idl-name.att;>
+]]>
+
+<!--    sequence: Declaration of a sequence type (not named). -->
+<!ENTITY % sequence.element "INCLUDE">
+<![%sequence.element;[
+<!ELEMENT sequence (sequence*)>
+]]>
+<!ENTITY % sequence.attlist "INCLUDE">
+<![%sequence.attlist;[
+<!ATTLIST sequence
+        %common.att;
+        %idl-type.att;
+        size            NMTOKEN         #IMPLIED>
+]]>
+
+<!--    constant: Declaration of a named constant. -->
+<!ENTITY % constant.element "INCLUDE">
+<![%constant.element;[
+<!ELEMENT constant (descr)>
+]]>
+<!ENTITY % constant.attlist "INCLUDE">
+<![%constant.attlist;[
+<!ATTLIST constant
+        %common.att;
+        %idl-name.att;
+        %idl-type.att;
+        value           CDATA           #REQUIRED>
+]]>
+
+<!--    exception: Declaration of an exception. -->
+<!ENTITY % exception.element "INCLUDE">
+<![%exception.element;[
+<!ELEMENT exception (descr, component*)>
+]]>
+<!ENTITY % exception.attlist "INCLUDE">
+<![%exception.attlist;[
+<!ATTLIST exception
+        %common.att;
+        %idl-name.att;>
+]]>
+<!-- component (defined under struct, above)-->
+
+<!--    attribute: Declaration of an attribute (data member). -->
+<!ENTITY % attribute.element "INCLUDE">
+<![%attribute.element;[
+<!ELEMENT attribute (descr)>
+]]>
+<!ENTITY % attribute.attlist "INCLUDE">
+<![%attribute.attlist;[
+<!ATTLIST attribute
+        %common.att;
+        %idl-name.att;
+        %idl-type.att;
+        readonly        (yes
+                        |no)            "no">
+]]>
+
+<!--    method: Declaration of a method. -->
+<!ENTITY % method.element "INCLUDE">
+<![%method.element;[
+<!ELEMENT method (descr, parameters, returns, raises)>
+]]>
+<!ENTITY % method.attlist "INCLUDE">
+<![%method.attlist;[
+<!ATTLIST method
+        %common.att;
+        %idl-name.att;>
+]]>
+
+<!ENTITY % parameters.element "INCLUDE">
+<![%parameters.element;[
+<!ELEMENT parameters (param*)>
+]]>
+<!ENTITY % parameters.attlist "INCLUDE">
+<![%parameters.attlist;[
+<!ATTLIST parameters %common.att;>
+]]>
+
+<!ENTITY % param.element "INCLUDE">
+<![%param.element;[
+<!ELEMENT param (descr)>
+]]>
+<!ENTITY % param.attlist "INCLUDE">
+<![%param.attlist;[
+<!ATTLIST param
+        %common.att;
+        %idl-name.att;
+        %idl-type.att;
+        attr            (in
+                        |out
+                        |inout)         "inout">
+]]>
+
+<!ENTITY % returns.element "INCLUDE">
+<![%returns.element;[
+<!ELEMENT returns (descr)>
+]]>
+<!ENTITY % returns.attlist "INCLUDE">
+<![%returns.attlist;[
+<!ATTLIST returns
+        %common.att;
+        %idl-type.att;>
+]]>
+
+<!ENTITY % raises.element "INCLUDE">
+<![%raises.element;[
+<!ELEMENT raises (exception*)>
+]]>
+<!-- exception (defined under constant, above)-->
+
+<!ENTITY % typename.element "INCLUDE">
+<![%typename.element;[
+<!ELEMENT typename (#PCDATA|phrase)*>
+]]>
+<!ENTITY % typename.attlist "INCLUDE">
+<![%typename.attlist;[
+<!ATTLIST typename %common.att;>
+]]>
+
+<!-- ............................................................... -->
+<!-- Phrase-level elements ......................................... -->
+<!-- ............................................................... -->
+
+<!--
+#2000-03-07: maler: Added att and attval elements.
+-->
+
+<!--    att: Attribute name. -->
+<!ENTITY % att.element "INCLUDE">
+<![%att.element;[
+<!ELEMENT att (%tech.pcd.mix;)*>
+]]>
+<!ENTITY % att.attlist "INCLUDE">
+<![%att.attlist;[
+<!ATTLIST att %common.att;>
+]]>
+
+<!--    attval: Attribute value. -->
+<!ENTITY % attval.element "INCLUDE">
+<![%attval.element;[
+<!ELEMENT attval (%tech.pcd.mix;)*>
+]]>
+<!ENTITY % attval.attlist "INCLUDE">
+<![%attval.attlist;[
+<!ATTLIST attval %common.att;>
+]]>
+
+<!--    bibref: Reference to a bibliography list entry; should
+        generate, in square brackets, "key" on bibl. -->
+<!ENTITY % bibref.element "INCLUDE">
+<![%bibref.element;[
+<!ELEMENT bibref EMPTY>
+]]>
+<!--    ref attribute:
+        A bibliography reference must link to the bibl element that
+        describes the resource. -->
+<!ENTITY % bibref.attlist "INCLUDE">
+<![%bibref.attlist;[
+<!ATTLIST bibref
+        %common.att;
+        %ref-req.att;>
+]]>
+
+<!ENTITY % code.element "INCLUDE">
+<![%code.element;[
+<!ELEMENT code (%tech.pcd.mix;)*>
+]]>
+<!ENTITY % code.attlist "INCLUDE">
+<![%code.attlist;[
+<!ATTLIST code %common.att;>
+]]>
+
+<!--
+#1998-03-10: maler: Declared ednote and related elements.
+#1999-07-02: maler: Changed edtext content from #PCDATA to %p.pcd.mix;.
+-->
+
+<!--    ednote: Editorial note for communication among editors. -->
+<!ENTITY % ednote.element "INCLUDE">
+<![%ednote.element;[
+<!ELEMENT ednote (name?, date?, edtext)>
+]]>
+<!ENTITY % ednote.attlist "INCLUDE">
+<![%ednote.attlist;[
+<!ATTLIST ednote %common.att;>
+]]>
+
+<!ENTITY % date.element "INCLUDE">
+<![%date.element;[
+<!ELEMENT date (#PCDATA|phrase)*>
+]]>
+<!ENTITY % date.attlist "INCLUDE">
+<![%date.attlist;[
+<!ATTLIST date %common.att;>
+]]>
+
+<!ENTITY % edtext.element "INCLUDE">
+<![%edtext.element;[
+<!ELEMENT edtext (%p.pcd.mix;)*>
+]]>
+<!ENTITY % edtext.attlist "INCLUDE">
+<![%edtext.attlist;[
+<!ATTLIST edtext %common.att;>
+]]>
+
+<!--
+#2000-03-07: maler: Added el element.
+-->
+
+<!ELEMENT assert (%p.pcd.mix;)*>
+<!ATTLIST assert class (component | document | exchange | message) #REQUIRED>
+<!ATTLIST assert id ID #REQUIRED>
+<!ATTLIST assert cr-id CDATA #REQUIRED>
+<!ATTLIST assert preamble CDATA #IMPLIED>
+<!ATTLIST assert required (false | true) "true">
+
+<!ELEMENT assert-summary (%p.pcd.mix;)*>
+<!ATTLIST assert-summary ref IDREF #REQUIRED>
+
+<!--    el: Element type name (GI). -->
+<!ENTITY % el.element "INCLUDE">
+<![%el.element;[
+<!ELEMENT el (%tech.pcd.mix;)*>
+]]>
+<!ENTITY % el.attlist "INCLUDE">
+<![%el.attlist;[
+<!ATTLIST el %common.att;>
+]]>
+
+<!--
+#2000-03-07: maler: Expanded emph to %p.pcd.mix;.
+-->
+
+<!ENTITY % emph.element "INCLUDE">
+<![%emph.element;[
+<!ELEMENT emph (%p.pcd.mix;)*>
+]]>
+<!ENTITY % emph.attlist "INCLUDE">
+<![%emph.attlist;[
+<!ATTLIST emph %common.att;>
+]]>
+
+<!--    footnote: Both footnote content and call to footnote. -->
+<!ENTITY % footnote.element "INCLUDE">
+<![%footnote.element;[
+<!ELEMENT footnote (%obj.mix;)+>
+]]>
+<!ENTITY % footnote.attlist "INCLUDE">
+<![%footnote.attlist;[
+<!ATTLIST footnote %common.att;>
+]]>
+
+<!--
+#2000-03-07: maler: Added function and gave it content of
+#                   %tech.pcd.mix; instead of XPath's #PCDATA.
+-->
+
+<!ENTITY % function.element "INCLUDE">
+<![%function.element;[
+<!ELEMENT function (%tech.pcd.mix;)*>
+]]>
+<!ENTITY % function.attlist "INCLUDE">
+<![%function.attlist;[
+<!ATTLIST function %common.att;>
+]]>
+
+<!ENTITY % kw.element "INCLUDE">
+<![%kw.element;[
+<!ELEMENT kw (%tech.pcd.mix;)*>
+]]>
+<!ENTITY % kw.attlist "INCLUDE">
+<![%kw.attlist;[
+<!ATTLIST kw %common.att;>
+]]>
+
+<!--
+#1999-07-02: maler: Added show/actuate attributes and default values.
+-->
+
+<!--    loc: Generic link to a Web resource, similar to HTML's A. -->
+<!ENTITY % loc.element "INCLUDE">
+<![%loc.element;[
+<!ELEMENT loc (#PCDATA|phrase)*>
+]]>
+<!--    href attribute:
+        The purpose of a loc element is to function as a A-like
+        hypertext link to a resource.  (Ideally, the content of loc
+        will also mention the URI of the resource, so that readers of
+        the printed version will be able to locate the resource.) E.g.:
+
+<loc href="http://www.my.com/doc.htm">http://www.my.com/doc.htm</loc>
+        -->
+<!ENTITY % loc.attlist "INCLUDE">
+<![%loc.attlist;[
+<!ATTLIST loc
+        %common.att;
+        %simple-xlink.att;
+        %href-req.att;
+        %user-replace.att;>
+]]>
+
+<!--    nt: Mention of a nonterminal in text, along with a link to
+        the production in the current document that defines it. -->
+<!ENTITY % nt.element "INCLUDE">
+<![%nt.element;[
+<!ELEMENT nt (#PCDATA|phrase)*>
+]]>
+<!--    def attribute:
+        The nonterminal must link to the production that defines
+        it. -->
+<!ENTITY % nt.attlist "INCLUDE">
+<![%nt.attlist;[
+<!ATTLIST nt
+        %common.att;
+        %def-req.att;>
+]]>
+
+<!--
+#2000-03-07: maler: Declared phrase.
+-->
+
+<!--    phrase: "Attribute hanger" for small bits of (e.g.) differenced
+        text in a paragraph or similar, when another element isn't handy.
+        Beware that its content model may allow more nested elements than
+        would normally be allowed in some contexts. -->
+<!ENTITY % phrase.element "INCLUDE">
+<![%phrase.element;[
+<!ELEMENT phrase (%p.pcd.mix;)*>
+]]>
+<!ENTITY % phrase.attlist "INCLUDE">
+<![%phrase.attlist;[
+<!ATTLIST phrase %common.att;>
+]]>
+
+<!--
+#2003-06-25: nwalsh: RFC2119 elements
+-->
+
+<!ENTITY % rfc2119.element "INCLUDE">
+<![%rfc2119.element;[
+<!ELEMENT rfc2119 (#PCDATA|phrase)*>
+]]>
+<!ENTITY % rfc2119.attlist "INCLUDE">
+<![%rfc2119.attlist;[
+<!ATTLIST rfc2119 %common.att;>
+]]>
+
+<!--
+#1998-03-10: maler: Declared quote.
+-->
+
+<!--    quote: Scare quotes and other purely presentational quotes. -->
+<!ENTITY % quote.element "INCLUDE">
+<![%quote.element;[
+<!ELEMENT quote (%p.pcd.mix;)*>
+]]>
+<!ENTITY % quote.attlist "INCLUDE">
+<![%quote.attlist;[
+<!ATTLIST quote %common.att;>
+]]>
+
+<!--    specref: Reference to a div, olist item, prod, or issue
+        in the current document; should generate italic "[n.n],
+        Section Title" for div, "n" for numbered item, "[n]" for
+        production, or "Issue id" for issue. -->
+<!ENTITY % specref.element "INCLUDE">
+<![%specref.element;[
+<!ELEMENT specref EMPTY>
+]]>
+<!--    ref attribute:
+        The purpose of a specref element is to link to a div, item
+        in an olist, or production in the current spec. -->
+<!ENTITY % specref.attlist "INCLUDE">
+<![%specref.attlist;[
+<!ATTLIST specref
+        %common.att;
+        %ref-req.att;>
+]]>
+
+<!--
+#2000-03-07: maler: Added sub and sup.
+-->
+
+<!--    sub: Subscript. -->
+<!ENTITY % sub.element "INCLUDE">
+<![%sub.element;[
+<!ELEMENT sub (#PCDATA|phrase)*>
+]]>
+<!ENTITY % sub.attlist "INCLUDE">
+<![%sub.attlist;[
+<!ATTLIST sub %common.att;>
+]]>
+
+<!--    sup: Superscript. -->
+<!ENTITY % sup.element "INCLUDE">
+<![%sup.element;[
+<!ELEMENT sup (#PCDATA|phrase)*>
+]]>
+<!ENTITY % sup.attlist "INCLUDE">
+<![%sup.attlist;[
+<!ATTLIST sup %common.att;>
+]]>
+
+<!--    term: The term in text that is being defined in text. -->
+<!ENTITY % term.element "INCLUDE">
+<![%term.element;[
+<!ELEMENT term (#PCDATA|phrase)*>
+]]>
+<!ENTITY % term.attlist "INCLUDE">
+<![%term.attlist;[
+<!ATTLIST term %common.att;>
+]]>
+
+<!--    termdef: Definition of a term in text. -->
+<!ENTITY % termdef.element "INCLUDE">
+<![%termdef.element;[
+<!ELEMENT termdef (%termdef.pcd.mix;|%termdef.mix;)*>
+]]>
+<!--    ID attribute:
+        A term definition must have an ID so that it can be linked
+        to from termref elements. -->
+<!--    term attribute:
+        The canonical form of the term or phrase being defined must
+        appear in this attribute, even if the term or phrase also
+        appears in the element content in identical form (e.g., in
+        the term element). -->
+<!ENTITY % termdef.attlist "INCLUDE">
+<![%termdef.attlist;[
+<!ATTLIST termdef
+        %common-idreq.att;
+        term            CDATA           #REQUIRED>
+]]>
+
+<!--    termref: Mention of a term, along with a link to the
+        definition in the current document. -->
+<!ENTITY % termref.element "INCLUDE">
+<![%termref.element;[
+<!ELEMENT termref (#PCDATA|phrase)*>
+]]>
+<!--    ref attribute:
+        A term reference must link to the termdef element that
+        defines the term. -->
+<!ENTITY % termref.attlist "INCLUDE">
+<![%termref.attlist;[
+<!ATTLIST termref
+        %common.att;
+        %def-req.att;>
+]]>
+
+<!--
+#1999-07-02: maler: Added show/actuate attributes and default values.
+-->
+
+<!--    titleref: Citation of another document, which can also
+        link to that document if it is a Web resource. -->
+<!ENTITY % titleref.element "INCLUDE">
+<![%titleref.element;[
+<!ELEMENT titleref (#PCDATA|phrase)*>
+]]>
+<!--    href attribute:
+        A title reference can optionally function as a hypertext
+        link to the resource with this title.  E.g.:
+
+<loc href="http://www.my.com/doc.htm">http://www.my.com/doc.htm</loc>
+        -->
+
+<!ENTITY % titleref.attlist "INCLUDE">
+<![%titleref.attlist;[
+<!ATTLIST titleref
+        %common.att;
+        %simple-xlink.att;
+        %href.att;
+        %user-new.att;>
+]]>
+
+<!--
+#2000-03-07: maler: Added var.
+-->
+
+<!--    var: String standing for a variable value that the user
+        or system will supply.  For example: "For each node
+        <var>x</var> in this node-set..." -->
+<!ENTITY % var.element "INCLUDE">
+<![%var.element;[
+<!ELEMENT var (%tech.pcd.mix;)*>
+]]>
+<!ENTITY % var.attlist "INCLUDE">
+<![%var.attlist;[
+<!ATTLIST var %common.att;>
+]]>
+
+<!--
+#1999-07-02: maler: Added show/actuate attributes and default values.
+-->
+
+<!--    xnt: Mention of a nonterminal in text, along with a link to
+        the production in another document that defines it. -->
+<!ENTITY % xnt.element "INCLUDE">
+<![%xnt.element;[
+<!ELEMENT xnt (#PCDATA|phrase)*>
+]]>
+<!--    href attribute:
+        The nonterminal must hyperlink to a resource that serves
+        to define it (e.g., a production in a related XML
+        specification).  E.g.:
+
+<xnt href="http://www.w3.org/TR/spec.htm#prod3">Name</xnt>
+        -->
+
+<!ENTITY % xnt.attlist "INCLUDE">
+<![%xnt.attlist;[
+<!ATTLIST xnt
+        %common.att;
+        %simple-xlink.att;
+        %href-req.att;
+        %user-new.att;>
+]]>
+
+<!--
+#1997-12-29: maler: Declared xspecref.
+#1999-07-02: maler: Added show/actuate attributes and default values.
+-->
+
+<!--    xspecref: Reference to a div, olist item, prod, or issue
+        in a related specification document; should generate
+        no special text. -->
+<!ENTITY % xspecref.element "INCLUDE">
+<![%xspecref.element;[
+<!ELEMENT xspecref (#PCDATA|phrase)*>
+]]>
+<!--    href attribute:
+        The spec reference must hyperlink to the resource to
+        cross-refer to (e.g., a section in a related XML
+        specification).  E.g.:
+
+<xspecref href="http://www.w3.org/TR/spec.htm#sec2">
+the section on constraints</xspecref>
+        -->
+
+<!ENTITY % xspecref.attlist "INCLUDE">
+<![%xspecref.attlist;[
+<!ATTLIST xspecref
+        %common.att;
+        %simple-xlink.att;
+        %href-req.att;
+        %user-new.att;>
+]]>
+
+<!--
+#1999-07-02: maler: Added show/actuate attributes and default values.
+-->
+
+<!--    termref: Mention of a term, along with a link to the
+        definition in a related document. -->
+<!ENTITY % xtermref.element "INCLUDE">
+<![%xtermref.element;[
+<!ELEMENT xtermref (#PCDATA|phrase)*>
+]]>
+<!--    href attribute:
+        The term reference must hyperlink to the resource that
+        serves to define the term (e.g., a term definition in
+        a related XML specification).  E.g.:
+
+<xtermref href="http://www.w3.org/TR/spec.htm#term5">
+entity
+</xtermref>
+        -->
+
+<!ENTITY % xtermref.attlist "INCLUDE">
+<![%xtermref.attlist;[
+<!ATTLIST xtermref
+        %common.att;
+        %simple-xlink.att;
+        %href-req.att;
+        %user-new.att;>
+]]>
+
+<!-- ............................................................... -->
+<!-- Unused elements for ADEPT ..................................... -->
+<!-- ............................................................... -->
+
+<!--
+#1997-09-30: maler: Added unusued elements.
+#1997-10-14: maler: Fixed div to move nested div to the mixture.
+#1998-05-14: maler: Added key-term, htable, and htbody.
+#1998-11-30: maler: Added para, listitem, itemizedlist, and orderedlist.
+-->
+
+<!--    The following elements are purposely declared but never
+        referenced.  Declaring them allows them to be pasted from
+        an HTML document, an earlier version of an XMLspec document,
+        or a DocBook document into a document using this DTD in ADEPT.
+        The ATD Context Transformation mechanism will try to convert
+        them to the appropriate element for this DTD.  While this
+        conversion will not work for all fragments, it does allow many
+        cases to work reasonably well. -->
+
+<!ENTITY % div.element "INCLUDE">
+<![%div.element;[
+<!ELEMENT div
+        (head?, (%div.mix;|ul|ol|h1|h2|h3|h4|h5|h6|div)*)>
+]]>
+<!ENTITY % h1.element "INCLUDE">
+<![%h1.element;[
+<!ELEMENT h1 (%head.pcd.mix;|em|a)*>
+]]>
+<!ENTITY % h2.element "INCLUDE">
+<![%h2.element;[
+<!ELEMENT h2 (%head.pcd.mix;|em|a)*>
+]]>
+<!ENTITY % h3.element "INCLUDE">
+<![%h3.element;[
+<!ELEMENT h3 (%head.pcd.mix;|em|a)*>
+]]>
+<!ENTITY % h4.element "INCLUDE">
+<![%h4.element;[
+<!ELEMENT h4 (%head.pcd.mix;|em|a)*>
+]]>
+<!ENTITY % h5.element "INCLUDE">
+<![%h5.element;[
+<!ELEMENT h5 (%head.pcd.mix;|em|a)*>
+]]>
+<!ENTITY % h6.element "INCLUDE">
+<![%h6.element;[
+<!ELEMENT h6 (%head.pcd.mix;|em|a)*>
+]]>
+<!ENTITY % pre.element "INCLUDE">
+<![%pre.element;[
+<!ELEMENT pre (%eg.pcd.mix;|em)*>
+]]>
+<!ENTITY % ul.element "INCLUDE">
+<![%ul.element;[
+<!ELEMENT ul (item|li)*>
+]]>
+<!ENTITY % ol.element "INCLUDE">
+<![%ol.element;[
+<!ELEMENT ol (item|li)*>
+]]>
+<!ENTITY % li.element "INCLUDE">
+<![%li.element;[
+<!ELEMENT li (#PCDATA|%obj.mix;)*>
+]]>
+<!ENTITY % em.element "INCLUDE">
+<![%em.element;[
+<!ELEMENT em (#PCDATA)*>
+]]>
+<!ENTITY % a.element "INCLUDE">
+<![%a.element;[
+<!ELEMENT a (#PCDATA)*>
+]]>
+
+<!ENTITY % key-term.element "INCLUDE">
+<![%key-term.element;[
+<!ELEMENT key-term (#PCDATA)*>
+]]>
+<!ENTITY % htable.element "INCLUDE">
+<![%htable.element;[
+<!ELEMENT htable
+        (caption?, (col*|colgroup*), thead?, tfoot?, tbody+)>
+]]>
+<!ENTITY % htbody.element "INCLUDE">
+<![%htbody.element;[
+<!ELEMENT htbody (tr)+>
+]]>
+<!ENTITY % statusp.element "INCLUDE">
+<![%statusp.element;[
+<!ELEMENT statusp (%p.pcd.mix;|%p.mix;)*>
+]]>
+
+<!ENTITY % itemizedlist.element "INCLUDE">
+<![%itemizedlist.element;[
+<!ELEMENT itemizedlist (listitem*)>
+]]>
+<!ENTITY % orderedlist.element "INCLUDE">
+<![%orderedlist.element;[
+<!ELEMENT orderedlist (listitem*)>
+]]>
+<!ENTITY % listitem.element "INCLUDE">
+<![%listitem.element;[
+<!ELEMENT listitem (para*)>
+]]>
+<!ENTITY % para.element "INCLUDE">
+<![%para.element;[
+<!ELEMENT para (#PCDATA)*>
+]]>
+
+<!-- ............................................................... -->
+<!-- Change history ................................................ -->
+<!-- ............................................................... -->
+
+<!--
+#This revision history is no longer being maintained. See the CVS log
+#for detailed revisions history.
+#####################################################################
+#1997-08-18: maler
+#- Did a major revision.
+#1997-09-10: maler
+#- Updated FPI.
+#- Removed namekey element and put key attribute on name element.
+#- Made statusp element and supporting entities.
+#- Added slist element with sitem+ content.
+#- Required head on scrap and added new bnf subelement.
+#- Added an xnt element and allowed it and nt in regular text and rhs.
+#- Removed the ntref element.
+#- Added back the com element to the content of rhs.
+#- Added a key attribute to bibl.
+#- Removed the ident element.
+#- Added a term element to be used inside termdef.
+#- Added an xtermref element parallel to termref.
+#- Beefed up DTD comments.
+#1997-09-12: maler
+#- Allowed term element in general text.
+#- Changed bibref to EMPTY.
+#- Added ref.class to termdef.pcd.mix.
+#1997-09-14: maler
+#- Changed main attribute of xtermref from def to href.
+#- Added termdef.class to label contents.
+#1997-09-30: maler
+#- Added character entity module and added new entities.
+#- Removed p from appearing directly in self; created %p.mix;.
+#- Added inform-div (non-normative division) element.
+#- Fixed xtermref comment to mention href, not ref.
+#- Extended orglist model to allow optional affiliation.
+#- Modified author to make affiliation optional.
+#- Added %speclist.class; and %note.class; to %obj.mix; and %p.mix;.
+#- Added %note.class; and %illus.class; to %termdef.pcd.mix;.
+#- Added unused HTML elements.
+#- Put empty system ID next to public ID in entity declarations.
+#1997-10-14: maler
+#- Fixed "unused" div content model to move nested div to mixture.
+#1997-10-16: maler
+#- Added SGML Open Exchange tables.
+#1997-11-28: maler
+#- Added support for prodgroup and its attributes.
+#- Added support for HTML tables.
+#- Added loc and bibref to content of com.
+#- Added loc to general p content models.
+#- Allowed p as alternative to statusp in status.
+#- Added non-null system IDs to external parameter entity declarations.
+#- (Modified the SGML Open table module to make it XML-compliant.)
+#- (Modified the character entity module.)
+#1997-12-29: maler
+#- Moved #PCDATA occurrences to come before GIs in content models.
+#- Removed use of the SGML Open table module.
+#- Added xspecref element.
+#- Ensured that all FPIs contain 4-digit year.
+#- (Modified the character entity module.)
+#1998-03-10: maler
+#- Merged the character entity and table modules into the main file.
+#- Added ldquo and rdquo entities.
+#- Added common attributes to prodgroup.
+#- Made the email element in header optional.
+#- Removed reference to the SGML Open table model.
+#- Added ednote element.
+#- Added quote element.
+#- Updated XLink usage to reflect 3 March 1998 WD.
+#- Added "local" entities to the class entities for customization.
+#- Parameterized several content models to allow for customization.
+#1998-03-23: maler
+#- Cleaned up some comments and removed some others.
+#- Added xml:space semi-common attribute to eg and bnf elements.
+#- Added show and embed attributes on all the uses of href.
+#- Added %common.att; to all HTML table elements.
+#- Added a real URI to the "typical invocation" comment.
+#1998-05-14: maler
+#- Fixed mdash, ldquo, and rdquo character entities.
+#- Switched to the full HTML 4.0 table model.
+#- Removed htable/htbody elements and replaced them with table/tbody.
+#- Added issue element to %note.class; and declared it.
+#- Allowed prevlocs and latestloc in either order.
+#- Added key-term, htable, htbody, and statusp as unused elements.
+#- Removed real statusp element in favor of plain p.
+#1998-05-21: maler
+#- Declared generic constraint and constraintnote elements.
+#- Added constraintnote to %note.class;.
+#- Added constraint to %eg.pcd.mix; and prod content model.
+#1998-08-22: maler
+#- Fixed %illus.class; to mention table instead of htable.
+#- Added definitions to %illus.class; for DOM model.
+#- Added DOM definitions element and its substructure.
+#- Updated XLink usage in %href.att; to use xlink:form and #IMPLIED.
+#- Added clarifying comments to href-using elements.
+#1998-11-30: maler
+#- Added new unused elements to support DocBook translation.
+#- Updated maler phone numbers.
+#1998-12-3: maler
+#- Fixed character entities with respect to escaping of ampersands.
+#- Added many more explanatory comments.
+#1999-07-02: maler
+#- Added %loc.class; to all PCD mixes that didn't already have it.
+#- Removed unused %loc.pcd.mix;.
+#- Made version in spec header optional.
+#- Added three new attributes to spec.
+#- Broadened content of edtext.
+#- Added optional copyright element to header.
+#- Reorganized XLink-related parameter entities; added xmlns:xlink.
+#- Changed edtext content from #PCDATA to %p.pcd.mix;.
+#- Added show/actuate atts and default values to all href elements.
+#- Changed versioning scheme from 8-digit dates to version numbers.
+#- Added w3c-doctype, other-doctype, status atts to spec element.
+#- Added prodrecap element inside scrap.
+#- Added headstyle attribute to scrap.
+#2000-03-07: maler
+#- Added proto element, its arg subelement, and the %argtypes; entity.
+#- Added function, var, sub, sup, phrase, el, att, attval elements.
+#- Expanded emph to %p.pcd.mix;.
+#- Allowed status and abstract to appear in the opposite order.
+#- Updated XLink usage to the latest WD, except for href and source.
+#- Removed the xml:attributes attribute from graphic.
+#- Added %local.graphic.att; to graphic.
+#- Added common diff attribute.
+#- Added div5 element.
+#- Broadened content models of publoc, prevlocs, and latestloc.
+#- Added head, source, resolution, and status attribute to issue.
+#- Added cr, issues, and dispcmts to w3c-doctype attribute on spec.
+#- Added example element.
+-->
+
+<!-- ............................................................... -->
+<!-- End of XML specification DTD .................................. -->
+<!-- ............................................................... -->
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spec/xmlspec.xsl	Fri Sep 19 08:46:38 2008 +0000
@@ -0,0 +1,2766 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--This file was created automatically by html2xhtml-->
+<!--from the HTML stylesheets. Do not edit this file.-->
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://icl.com/saxon" exclude-result-prefixes="saxon" version="1.0">
+
+<!-- ====================================================================== -->
+<!-- xmlspec.xsl: An HTML XSL[1] Stylesheet for XML Spec V2.1[2] markup
+
+     Version: $Id$
+
+     URI:     http://dev.w3.org/cvsweb/spec-prod/html/xmlspec.xsl
+
+     Authors: Norman Walsh ([email protected])
+              Chris Maden ([email protected])
+              Ben Trafford ([email protected])
+              Eve Maler ([email protected])
+              Henry S. Thompson ([email protected])
+
+     Date:    Created 07 September 1999
+              Last updated $Date$ by $Author$
+
+     Copyright (C) 2000, 2001, 2002 Sun Microsystems, Inc. All Rights Reserved.
+     This document is governed by the W3C Software License[3] as
+     described in the FAQ[4].
+
+       [1] http://www.w3.org/TR/xslt
+       [2] http://www.w3.org/XML/1998/06/xmlspec-report-v21.htm
+       [3] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+       [4] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+
+     Notes:
+
+     This stylesheet attempts to implement the XML Specification V2.1
+     DTD.  Documents conforming to earlier DTDs may not be correctly
+     transformed.
+
+     ChangeLog: (See also: CVS ChangeLog)
+
+     15 August 2002: Norman Walsh, <[email protected]>
+       - Version 1.3 released at http://www.w3.org/2002/xmlspec/html/1.3/xmlspec.xsl
+         There have never been any "official" releases before, so the version number
+         is arbitrary.
+
+     15 August 2001: Hugo Haas <[email protected]>
+       - Slightly modified the status sentence introducing editors'
+         copies.
+       - Now using role to distinguish editors' copies: e.g.
+         <spec w3c-doctype="wd" role="editors-copy">
+
+     14 August 2001: Hugo Haas <[email protected]>
+       - If w3c-doctype is not a W3C TR, do not use a Note style
+         sheet, use <http://www.w3.org/StyleSheets/TR/base.css>
+         instead.
+       - If the other-doctype is "editors-copy", do not use the W3C
+         logo and mark the document as such in the status section.
+
+     12 Jun 2001: ([email protected])
+       - Support non-tabular examples. If tabular.examples is non-zero,
+         tables will be used for examples, otherwise nested divs and
+         CSS will be used. tabular.examples is *zero* by default.
+
+     06 Jun 2001: ([email protected])
+       - Support copyright element in header; use the content of that
+         element if it is present, otherwise use the auto-generated
+         copyright statement.
+
+     15 May 2001: ([email protected])
+       - Changed copyright link to point to dated IPR statement:
+         http://www.w3.org/Consortium/Legal/ipr-notice-20000612
+
+     25 Sep 2000: ([email protected])
+       - Sync'd with Eve's version:
+         o Concatenated each inline element's output all on one line
+           to avoid spurious spaces in the output. (This is really an
+           IE bug, but...) (15 Sep 2000)
+         o Updated crism's email address in header (7 Sep 2000)
+         o Changed handling of affiliation to use comma instead of
+           parentheses (9 Aug 2000)
+
+     14 Aug 2000: ([email protected])
+
+       - Added additional.title param (for diffspec.xsl to change)
+       - Fixed URI of W3C home icon
+       - Made CSS stylesheet selection depend on the w3c-doctype attribute
+         of spec instead of the w3c-doctype element in the header
+
+     26 Jul 2000: ([email protected])
+
+       - Improved semantics of specref. Added xsl:message for unsupported
+         cases. (I'm by no means confident that I've covered the whole
+         list.)
+       - Support @role on author.
+       - Make lhs/rhs "code" in EBNF.
+       - Fixed bug in ID/IDREF linking.
+       - More effectively disabled special markup for showing @diffed
+         versions
+
+     21 Jul 2000: ([email protected])
+
+       - Added support for @diff change tracking, primarily through
+         the auxiliary stylesheet diffspec.xsl. However, it was
+         impractical to handle some constructions, such as DLs and TABLEs,
+         in a completely out-of-band manner. So there is some inline
+         support for @diff markup.
+
+       - Added $additional.css to allow downstream stylesheets to add
+         new markup to the <style> element.
+
+       - Added required "type" attribute to the <style> element.
+
+       - Fixed pervasive problem with nested <a> elements.
+
+       - Added doctype-public to xsl:output.
+
+       - Added $validity.hacks. If "1", then additional disable-output-escaping
+         markup may be inserted in some places to attempt to get proper,
+         valid HTML. For example, if a <glist> appears inside a <p> in the
+         xmlspec source, this creates a nested <dl> inside a <p> in the
+         HTML, which is not valid. If $validity.hacks is "1", then an
+         extra </p>, <p> pair is inserted around the <dl>.
+
+   5 June 2001, Henry S. Thompson ([email protected])
+
+       - Fixed a link in copyright boilerplate to be dated
+
+  -->
+<!-- ====================================================================== -->
+
+  <xsl:preserve-space elements="*"/>
+
+  <xsl:strip-space elements="    abstract arg attribute authlist author back bibref blist body case col    colgroup component constant constraint constraintnote copyright def    definitions descr div div1 div2 div3 div4 div5 ednote enum enumerator    example exception footnote front gitem glist graphic group header    htable htbody inform-div1 interface issue item itemizedlist langusage    listitem member method module note notice ol olist orderedlist orglist    param parameters prod prodgroup prodrecap proto pubdate pubstmt raises    reference resolution returns revisiondesc scrap sequence slist    sourcedesc spec specref status struct table tbody tfoot thead tr    typedef ul ulist union vc vcnote wfc wfcnote"/>
+
+  <xsl:param name="validity.hacks" select="1"/>
+  <xsl:param name="show.diff.markup" select="0"/>
+  <xsl:param name="additional.css"/>
+  <xsl:param name="additional.title"/>
+  <xsl:param name="called.by.diffspec" select="0"/>
+  <xsl:param name="show.ednotes" select="1"/>
+  <xsl:param name="tabular.examples" select="0"/>
+  <xsl:param name="toc.level" select="5"/>
+
+  <xsl:key name="ids" match="*[@id]" use="@id"/>
+  <xsl:key name="specrefs" match="specref" use="@ref"/>
+
+  <xsl:output method="xml" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" indent="no" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
+
+  <!-- not handled:
+    attribute:   unhandled IDL stuff
+    case:        unhandled IDL stuff
+    component:   unhandled IDL stuff
+    constant:    unhandled IDL stuff
+    copyright:   boilerplate notice always used instead
+    definitions: unhandled IDL stuff
+    descr:       unhandled IDL stuff
+    enum:        unhandled IDL stuff
+    enumerator:  unhandled IDL stuff
+    exception:   unhandled IDL stuff
+    group:       unhandled IDL stuff
+    interface:   unhandled IDL stuff
+    method:      unhandled IDL stuff
+    module:      unhandled IDL stuff
+    param:       unhandled IDL stuff
+    parameters:  unhandled IDL stuff
+    raises:      unhandled IDL stuff
+    reference:   unhandled IDL stuff
+    returns:     unhandled IDL stuff
+    sequence:    unhandled IDL stuff
+    struct:      unhandled IDL stuff
+    typedef:     unhandled IDL stuff
+    typename:    unhandled IDL stuff
+    union:       unhandled IDL stuff
+
+    Warning!
+    Only handles statuses of NOTE, WD, and REC.
+    -->
+
+  <!-- Output a warning for unhandled elements! -->
+  <xsl:template match="*">
+    <xsl:message>
+      <xsl:text>No template matches </xsl:text>
+      <xsl:value-of select="name(.)"/>
+      <xsl:text>.</xsl:text>
+    </xsl:message>
+
+    <font xmlns="http://www.w3.org/1999/xhtml" color="red">
+      <xsl:text>&lt;</xsl:text>
+      <xsl:value-of select="name(.)"/>
+      <xsl:text>&gt;</xsl:text>
+      <xsl:apply-templates/>
+      <xsl:text>&lt;/</xsl:text>
+      <xsl:value-of select="name(.)"/>
+      <xsl:text>&gt;</xsl:text>
+    </font>
+  </xsl:template>
+
+  <!-- Template for the root node.  Creation of <html> element could
+       go here, but that doesn't feel right. -->
+  <xsl:template match="/">
+    <xsl:if test="//prod[@num] and //prod[not(@num)]">
+      <xsl:message terminate="yes">
+        <xsl:text>Manually and automatically numbered productions </xsl:text>
+        <xsl:text>cannot coexist.</xsl:text>
+      </xsl:message>
+    </xsl:if>
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- abstract: appears only in header -->
+  <!-- format as a second-level div -->
+  <!-- called in enforced order from header's template -->
+  <xsl:template match="abstract">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:text>
+</xsl:text>
+      <h2>
+        <xsl:call-template name="anchor">
+          <xsl:with-param name="conditional" select="0"/>
+          <xsl:with-param name="default.id" select="'abstract'"/>
+        </xsl:call-template>
+        <xsl:text>Abstract</xsl:text>
+      </h2>
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <!-- affiliation: follows a name in author and member -->
+  <!-- put it in parens with a leading space -->
+  <xsl:template match="affiliation">
+    <xsl:text>, </xsl:text>
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- arg: appears only in proto -->
+  <!-- argument in function prototype -->
+  <!-- output argument type, italicized as placeholder; separate the
+       list with commas and spaces -->
+  <xsl:template match="arg">
+    <xsl:if test="preceding-sibling::arg">
+      <xsl:text>, </xsl:text>
+    </xsl:if>
+    <var xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:value-of select="@type"/>
+    </var>
+    <xsl:if test="@occur = 'opt'">
+      <xsl:text>?</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- att: attribute name -->
+  <!-- used lots of places -->
+  <!-- format as monospaced code -->
+  <xsl:template match="att">
+    <code xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates/></code>
+  </xsl:template>
+
+  <!-- attribute: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- attval: attribute name -->
+  <!-- used lots of places -->
+  <!-- format as quoted string -->
+  <xsl:template match="attval">
+    <xsl:text>"</xsl:text>
+    <xsl:apply-templates/>
+    <xsl:text>"</xsl:text>
+  </xsl:template>
+
+  <!-- authlist: list of authors (editors, really) -->
+  <!-- called in enforced order from header's template, in <dl>
+       context -->
+  <xsl:template match="authlist">
+    <dt xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:text>Editor</xsl:text>
+      <xsl:if test="count(author) &gt; 1">
+        <xsl:text>s</xsl:text>
+      </xsl:if>
+      <xsl:text>:</xsl:text>
+    </dt>
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- author: an editor of a spec -->
+  <!-- only appears in authlist -->
+  <!-- called in <dl> context -->
+  <xsl:template match="author">
+    <dd xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+      <xsl:if test="@role = '2e'">
+        <xsl:text> - Second Edition</xsl:text>
+      </xsl:if>
+    </dd>
+  </xsl:template>
+
+  <!-- back: back matter for the spec -->
+  <!-- make a <div> for neatness -->
+  <!-- affects numbering of div1 children -->
+  <xsl:template match="back">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="back">
+      <xsl:apply-templates/>
+      <xsl:call-template name="autogenerated-appendices"/>
+    </div>
+  </xsl:template>
+
+  <!-- bibl: bibliographic entry -->
+  <!-- only appears in blist -->
+  <!-- called with <dl> context -->
+  <!-- if there's a key, use it in the <dt>, otherwise use the ID -->
+  <!-- if there's an href, add a ref in parens at the end of the text -->
+  <xsl:template match="bibl">
+    <dt xmlns="http://www.w3.org/1999/xhtml" class="label">
+      <xsl:if test="@id">
+        <a name="{@id}" id="{@id}"/>
+      </xsl:if>
+      <xsl:choose>
+        <xsl:when test="@key">
+          <xsl:value-of select="@key"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="@id"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </dt>
+    <dd xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+      <xsl:if test="@href">
+        <xsl:text>  (See </xsl:text>
+        <xsl:value-of select="@href"/>
+        <xsl:text>.)</xsl:text>
+      </xsl:if>
+    </dd>
+  </xsl:template>
+
+  <!-- bibref: reference to a bibliographic entry -->
+  <!-- make a link to the bibl -->
+  <!-- if the bibl has a key, put it in square brackets; otherwise use
+       the bibl's ID -->
+  <xsl:template match="bibref">
+    <a xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:attribute name="href">
+        <xsl:call-template name="href.target">
+          <xsl:with-param name="target" select="key('ids', @ref)"/>
+        </xsl:call-template>
+      </xsl:attribute>
+      <xsl:text>[</xsl:text>
+      <xsl:choose>
+        <xsl:when test="key('ids', @ref)/@key">
+          <xsl:value-of select="key('ids', @ref)/@key"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="@ref"/>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:text>]</xsl:text>
+    </a>
+  </xsl:template>
+
+  <!-- blist: list of bibliographic entries -->
+  <!-- set up the list and process children -->
+  <xsl:template match="blist">
+    <dl xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </dl>
+  </xsl:template>
+
+  <!-- bnf: un-marked-up BNF productions -->
+  <!-- preformatted within a table cell -->
+  <!-- scrap provides <table> context -->
+  <xsl:template match="bnf">
+    <tbody xmlns="http://www.w3.org/1999/xhtml">
+      <tr>
+        <td>
+          <xsl:if test="@diff and $show.diff.markup != 0">
+            <xsl:attribute name="class">
+              <xsl:text>diff-</xsl:text>
+              <xsl:value-of select="@diff"/>
+            </xsl:attribute>
+          </xsl:if>
+          <pre>
+            <xsl:apply-templates/>
+          </pre>
+        </td>
+      </tr>
+    </tbody>
+  </xsl:template>
+
+  <!-- body: the meat of the spec -->
+  <!-- create a TOC and then go to work -->
+  <!-- (don't forget the TOC for the back matter and a pointer to end
+       notes) -->
+  <xsl:template match="body">
+    <xsl:if test="$toc.level &gt; 0">
+      <div xmlns="http://www.w3.org/1999/xhtml" class="toc">
+        <xsl:text>
+</xsl:text>
+        <h2>
+          <xsl:call-template name="anchor">
+            <xsl:with-param name="conditional" select="0"/>
+            <xsl:with-param name="default.id" select="'contents'"/>
+          </xsl:call-template>
+          <xsl:text>Table of Contents</xsl:text>
+        </h2>
+        <p class="toc">
+          <xsl:apply-templates select="div1" mode="toc"/>
+        </p>
+        <xsl:if test="../back">
+          <xsl:text>
+</xsl:text>
+          <h3>
+            <xsl:call-template name="anchor">
+              <xsl:with-param name="conditional" select="0"/>
+              <xsl:with-param name="default.id" select="'appendices'"/>
+            </xsl:call-template>
+
+            <xsl:text>Appendi</xsl:text>
+            <xsl:choose>
+              <xsl:when test="count(../back/div1 | ../back/inform-div1) &gt; 1">
+                <xsl:text>ces</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>x</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </h3>
+          <p class="toc">
+            <xsl:apply-templates mode="toc" select="../back/div1 | ../back/inform-div1"/>
+            <xsl:call-template name="autogenerated-appendices-toc"/>
+          </p>
+        </xsl:if>
+        <xsl:if test="//footnote[not(ancestor::table)]">
+          <p class="toc">
+            <a href="#endnotes">
+              <xsl:text>End Notes</xsl:text>
+            </a>
+          </p>
+        </xsl:if>
+      </div>
+      <hr xmlns="http://www.w3.org/1999/xhtml"/>
+    </xsl:if>
+    <div xmlns="http://www.w3.org/1999/xhtml" class="body">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <xsl:template name="autogenerated-appendices">
+    <!-- there are none by default -->
+  </xsl:template>
+
+  <xsl:template name="autogenerated-appendices-toc">
+    <!-- there are none by default -->
+  </xsl:template>
+
+  <!-- caption: see table -->
+
+  <!-- case: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- code: generic computer code -->
+  <!-- output as HTML <code> for monospaced formatting -->
+  <xsl:template match="code">
+    <code xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates/></code>
+  </xsl:template>
+
+  <!-- col: see table -->
+
+  <!-- colgroup: see table -->
+
+  <!-- com: formal production comment -->
+  <!-- can appear in prod or rhs -->
+  <xsl:template match="com">
+    <xsl:choose>
+      <xsl:when test="preceding-sibling::*[1][name()='rhs']">
+        <td xmlns="http://www.w3.org/1999/xhtml">
+          <xsl:if test="ancestor-or-self::*/@diff and $show.diff.markup != 0">
+            <xsl:attribute name="class">
+              <xsl:text>diff-</xsl:text>
+              <xsl:value-of select="ancestor-or-self::*/@diff"/>
+            </xsl:attribute>
+          </xsl:if>
+          <i>
+            <xsl:text>/* </xsl:text>
+            <xsl:apply-templates/>
+            <xsl:text> */</xsl:text>
+          </i>
+        </td>
+      </xsl:when>
+      <xsl:otherwise>
+        <tr xmlns="http://www.w3.org/1999/xhtml" valign="baseline">
+          <td/><td/><td/><td/>
+          <td>
+            <xsl:if test="ancestor-or-self::*/@diff and $show.diff.markup != 0">
+              <xsl:attribute name="class">
+                <xsl:text>diff-</xsl:text>
+                <xsl:value-of select="ancestor-or-self::*/@diff"/>
+              </xsl:attribute>
+            </xsl:if>
+            <i>
+              <xsl:text>/* </xsl:text>
+              <xsl:apply-templates/>
+              <xsl:text> */</xsl:text>
+            </i>
+          </td>
+        </tr>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- this could probably be handled better, but given that rhs can
+       have arbitrary text and com mixed in, I don't feel like
+       spending enough time to figure out how -->
+  <xsl:template match="rhs/com">
+    <i xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:text>/* </xsl:text>
+      <xsl:apply-templates/>
+      <xsl:text> */</xsl:text>
+    </i>
+  </xsl:template>
+
+  <!-- component: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- constant: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- constraint: a note in a formal production -->
+  <!-- refers to a constraint note -->
+  <xsl:template match="constraint">
+    <xsl:choose>
+      <xsl:when test="preceding-sibling::*[1][name()='rhs']">
+        <td xmlns="http://www.w3.org/1999/xhtml">
+          <xsl:if test="@diff and $show.diff.markup != 0">
+            <xsl:attribute name="class">
+              <xsl:text>diff-</xsl:text>
+              <xsl:value-of select="@diff"/>
+            </xsl:attribute>
+          </xsl:if>
+          <a>
+            <xsl:attribute name="href">
+              <xsl:call-template name="href.target">
+                <xsl:with-param name="target" select="key('ids', @def)"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:text>[Constraint: </xsl:text>
+            <xsl:apply-templates select="key('ids', @def)/head" mode="text"/>
+            <xsl:text>]</xsl:text>
+          </a>
+        </td>
+      </xsl:when>
+      <xsl:otherwise>
+        <tr xmlns="http://www.w3.org/1999/xhtml" valign="baseline">
+          <td/><td/><td/><td/>
+          <td>
+            <xsl:if test="@diff and $show.diff.markup != 0">
+              <xsl:attribute name="class">
+                <xsl:text>diff-</xsl:text>
+                <xsl:value-of select="@diff"/>
+              </xsl:attribute>
+            </xsl:if>
+            <a>
+              <xsl:attribute name="href">
+                <xsl:call-template name="href.target">
+                  <xsl:with-param name="target" select="key('ids', @def)"/>
+                </xsl:call-template>
+              </xsl:attribute>
+              <xsl:text>[Constraint: </xsl:text>
+              <xsl:apply-templates select="key('ids', @def)/head" mode="text"/>
+              <xsl:text>]</xsl:text>
+            </a>
+          </td>
+        </tr>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- constraintnote: note constraining a formal production -->
+  <!-- see also constraintnote/head -->
+  <xsl:template match="constraintnote">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="constraint">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <!-- copyright: notice for this document-->
+  <!-- right now, a boilerplate copyright notice is inserted by the
+       template for header; this may need to be changed -->
+
+  <!-- day: day of month of spec -->
+  <!-- only used in pudate; called directly from header template -->
+  <xsl:template match="day">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- def: glossary definition -->
+  <!-- already in <dl> context from glist -->
+  <xsl:template match="def">
+    <dd xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </dd>
+  </xsl:template>
+
+  <!-- definitions: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- descr: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- div[n]: structural divisions -->
+  <!-- make an HTML div -->
+  <!-- see also div[n]/head -->
+  <xsl:template match="div1">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="div1">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="div2">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="div2">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="div3">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="div3">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="div4">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="div4">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="div5">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="div5">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <!-- ednote: editors' note -->
+  <xsl:template match="ednote">
+    <xsl:if test="$show.ednotes != 0">
+      <table xmlns="http://www.w3.org/1999/xhtml" border="1">
+        <xsl:attribute name="summary">
+          <xsl:text>Editorial note</xsl:text>
+          <xsl:if test="name">
+            <xsl:text>: </xsl:text>
+            <xsl:value-of select="name"/>
+          </xsl:if>
+        </xsl:attribute>
+        <tr>
+          <td align="left" valign="top" width="50%">
+            <b>
+              <xsl:text>Editorial note</xsl:text>
+              <xsl:if test="name">
+                <xsl:text>: </xsl:text>
+                <xsl:apply-templates select="name"/>
+              </xsl:if>
+            </b>
+          </td>
+          <td align="right" valign="top" width="50%">
+            <xsl:choose>
+              <xsl:when test="date">
+                <xsl:apply-templates select="date"/>
+              </xsl:when>
+              <xsl:otherwise> </xsl:otherwise>
+            </xsl:choose>
+          </td>
+        </tr>
+        <tr>
+          <td colspan="2" align="left" valign="top">
+            <xsl:apply-templates select="edtext"/>
+          </td>
+        </tr>
+      </table>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="date">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="edtext">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- edtext: text of an editors' note -->
+  <!-- ednote is currently hidden -->
+
+  <!-- el: an XML element -->
+  <!-- present as preformatted text, no markup -->
+  <!-- Chris's personal preference is to put pointy-brackets around
+       this, but he seems to be in the minority -->
+  <xsl:template match="el">
+    <code xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates/></code>
+  </xsl:template>
+
+  <!-- email: an email address for an editor -->
+  <!-- only occurs in author -->
+  <xsl:template match="email">
+    <xsl:text> </xsl:text>
+    <a xmlns="http://www.w3.org/1999/xhtml" href="{@href}">
+      <xsl:text>&lt;</xsl:text>
+      <xsl:apply-templates/>
+      <xsl:text>&gt;</xsl:text>
+    </a>
+  </xsl:template>
+
+  <!-- emph: in-line emphasis -->
+  <!-- equates to HTML <em> -->
+  <!-- the role attribute could be used for multiple kinds of
+       emphasis, but that would not be kind -->
+  <xsl:template match="emph">
+    <em xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates/></em>
+  </xsl:template>
+
+  <!-- rfc2119: identifies RFC 2119 keywords -->
+  <xsl:template match="rfc2119">
+    <strong xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates/></strong>
+  </xsl:template>
+
+  <!-- enum: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- enumerator: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- example: what it seems -->
+  <!-- block-level with title -->
+  <!-- see also example/head -->
+  <xsl:template match="example">
+    <xsl:variable name="class">
+      <xsl:choose>
+        <xsl:when test="$tabular.examples = 0">exampleOuter</xsl:when>
+        <xsl:otherwise>example</xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <div xmlns="http://www.w3.org/1999/xhtml" class="{$class}">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="example/head">
+    <xsl:text>
+</xsl:text>
+    <xsl:choose>
+      <xsl:when test="$tabular.examples = 0">
+        <div xmlns="http://www.w3.org/1999/xhtml" class="exampleHeader">
+          <xsl:call-template name="anchor">
+            <xsl:with-param name="node" select=".."/>
+            <xsl:with-param name="conditional" select="0"/>
+          </xsl:call-template>
+          <xsl:text>Example: </xsl:text>
+          <xsl:apply-templates/>
+        </div>
+      </xsl:when>
+      <xsl:otherwise>
+        <h5 xmlns="http://www.w3.org/1999/xhtml">
+          <xsl:call-template name="anchor">
+            <xsl:with-param name="node" select=".."/>
+            <xsl:with-param name="conditional" select="0"/>
+          </xsl:call-template>
+
+          <xsl:text>Example: </xsl:text>
+          <xsl:apply-templates/>
+        </h5>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- eg: a literal example -->
+  <!-- present as preformatted text -->
+  <xsl:template match="eg">
+    <xsl:variable name="content">
+      <xsl:call-template name="anchor"/>
+      <pre xmlns="http://www.w3.org/1999/xhtml">
+        <xsl:if test="@diff and $show.diff.markup != 0">
+          <xsl:attribute name="class">
+            <xsl:text>diff-</xsl:text>
+            <xsl:value-of select="@diff"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates/>
+      </pre>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$tabular.examples = 0">
+        <div xmlns="http://www.w3.org/1999/xhtml" class="exampleInner">
+          <xsl:copy-of select="$content"/>
+        </div>
+      </xsl:when>
+      <xsl:otherwise>
+        <table xmlns="http://www.w3.org/1999/xhtml" class="eg" cellpadding="5" border="1" bgcolor="#99ffff" width="100%" summary="Example">
+          <tr>
+            <td>
+              <xsl:copy-of select="$content"/>
+            </td>
+          </tr>
+        </table>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- exception: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- footnote: format as endnote, actually -->
+  <xsl:template match="footnote">
+    <xsl:variable name="this-note-id">
+      <xsl:choose>
+        <xsl:when test="@id">
+          <xsl:value-of select="@id"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="generate-id(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <sup xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:text>[</xsl:text>
+      <a name="FN-ANCH-{$this-note-id}" id="FN-ANCH-{$this-note-id}" href="#{$this-note-id}">
+        <xsl:apply-templates select="." mode="number-simple"/>
+      </a>
+      <xsl:text>]</xsl:text>
+    </sup>
+  </xsl:template>
+
+  <!-- front: front matter for the spec -->
+  <!-- make a div for cleanliness -->
+  <xsl:template match="front">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="front">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <!-- function: name of a function -->
+  <!-- format as HTML <code> for monospaced presentation -->
+  <xsl:template match="function">
+    <code xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates/></code>
+  </xsl:template>
+
+  <!-- gitem: glossary list entry -->
+  <!-- just pass children through for <dd>/<dt> formatting -->
+  <xsl:template match="gitem">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- glist: glossary list -->
+  <!-- create <dl> and handle children -->
+  <xsl:template match="glist">
+    <xsl:if test="$validity.hacks = 1 and local-name(..) = 'p'">
+      <xsl:text disable-output-escaping="yes">&lt;/p&gt;</xsl:text>
+    </xsl:if>
+    <dl xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </dl>
+    <xsl:if test="$validity.hacks = 1 and local-name(..) = 'p'">
+      <xsl:text disable-output-escaping="yes">&lt;p&gt;</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- graphic: external illustration -->
+  <!-- reference external graphic file with alt text -->
+  <xsl:template match="graphic">
+    <img xmlns="http://www.w3.org/1999/xhtml" src="{@source}">
+      <xsl:if test="@alt">
+        <xsl:attribute name="alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:attribute>
+      </xsl:if>
+    </img>
+  </xsl:template>
+
+  <!-- group: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- head: title for a variety of constructs -->
+
+  <!-- constraintnotes have different types, but they're
+       non-enumerated; nothing is done with them right now -->
+  <xsl:template match="constraintnote/head">
+    <p xmlns="http://www.w3.org/1999/xhtml" class="prefix">
+      <xsl:if test="../@id">
+        <a name="{../@id}" id="{../@id}"/>
+      </xsl:if>
+      <b><xsl:text>Constraint: </xsl:text><xsl:apply-templates/></b>
+    </p>
+  </xsl:template>
+
+  <xsl:template match="div1/head">
+    <xsl:text>
+</xsl:text>
+    <h2 xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:call-template name="anchor">
+        <xsl:with-param name="conditional" select="0"/>
+        <xsl:with-param name="node" select=".."/>
+      </xsl:call-template>
+      <xsl:apply-templates select=".." mode="divnum"/>
+      <xsl:apply-templates/>
+    </h2>
+  </xsl:template>
+
+  <xsl:template match="div2/head">
+    <xsl:text>
+</xsl:text>
+    <h3 xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:call-template name="anchor">
+        <xsl:with-param name="conditional" select="0"/>
+        <xsl:with-param name="node" select=".."/>
+      </xsl:call-template>
+      <xsl:apply-templates select=".." mode="divnum"/>
+      <xsl:apply-templates/>
+    </h3>
+  </xsl:template>
+
+  <xsl:template match="div3/head">
+    <xsl:text>
+</xsl:text>
+    <h4 xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:call-template name="anchor">
+        <xsl:with-param name="conditional" select="0"/>
+        <xsl:with-param name="node" select=".."/>
+      </xsl:call-template>
+      <xsl:apply-templates select=".." mode="divnum"/>
+      <xsl:apply-templates/>
+    </h4>
+  </xsl:template>
+
+  <xsl:template match="div4/head">
+    <xsl:text>
+</xsl:text>
+    <h5 xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:call-template name="anchor">
+        <xsl:with-param name="conditional" select="0"/>
+        <xsl:with-param name="node" select=".."/>
+      </xsl:call-template>
+      <xsl:apply-templates select=".." mode="divnum"/>
+      <xsl:apply-templates/>
+    </h5>
+  </xsl:template>
+
+  <xsl:template match="div5/head">
+    <xsl:text>
+</xsl:text>
+    <h6 xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:call-template name="anchor">
+        <xsl:with-param name="conditional" select="0"/>
+        <xsl:with-param name="node" select=".."/>
+      </xsl:call-template>
+      <xsl:apply-templates select=".." mode="divnum"/>
+      <xsl:apply-templates/>
+    </h6>
+  </xsl:template>
+
+  <xsl:template match="inform-div1/head">
+    <xsl:text>
+</xsl:text>
+    <h2 xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:call-template name="anchor">
+        <xsl:with-param name="conditional" select="0"/>
+        <xsl:with-param name="node" select=".."/>
+      </xsl:call-template>
+      <xsl:apply-templates select=".." mode="divnum"/>
+      <xsl:apply-templates/>
+      <xsl:text> (Non-Normative)</xsl:text>
+    </h2>
+  </xsl:template>
+
+  <xsl:template match="issue/head">
+    <p xmlns="http://www.w3.org/1999/xhtml" class="prefix">
+      <b><xsl:apply-templates/></b>
+    </p>
+  </xsl:template>
+
+  <xsl:template match="scrap/head">
+    <xsl:text>
+</xsl:text>
+    <h5 xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:call-template name="anchor">
+        <xsl:with-param name="node" select=".."/>
+        <xsl:with-param name="conditional" select="0"/>
+      </xsl:call-template>
+
+      <xsl:apply-templates/>
+    </h5>
+  </xsl:template>
+
+  <xsl:template match="vcnote/head">
+    <p xmlns="http://www.w3.org/1999/xhtml" class="prefix">
+      <xsl:if test="../@id">
+        <a name="{../@id}" id="{../@id}"/>
+      </xsl:if>
+      <b><xsl:text>Validity constraint: </xsl:text><xsl:apply-templates/></b>
+    </p>
+  </xsl:template>
+
+  <xsl:template match="wfcnote/head">
+    <p xmlns="http://www.w3.org/1999/xhtml" class="prefix">
+      <xsl:if test="../@id">
+        <a name="{../@id}" id="{../@id}"/>
+      </xsl:if>
+      <b><xsl:text>Well-formedness constraint: </xsl:text><xsl:apply-templates/></b>
+    </p>
+  </xsl:template>
+
+  <!-- header: metadata about the spec -->
+  <!-- pull out information into standard W3C layout -->
+  <xsl:template match="header">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="head">
+      <xsl:if test="not(/spec/@role='editors-copy')">
+        <p>
+          <a href="http://www.w3.org/">
+            <img src="http://www.w3.org/Icons/w3c_home" alt="W3C" height="48" width="72"/>
+          </a>
+	  <xsl:choose>
+	    <xsl:when test="/spec/@w3c-doctype='memsub'">
+	      <a href="http://www.w3.org/Submission/">
+		<img alt="Member Submission" src="http://www.w3.org/Icons/member_subm"/>
+	      </a>
+	    </xsl:when>
+	    <xsl:when test="/spec/@w3c-doctype='teamsub'">
+	      <a href="http://www.w3.org/2003/06/TeamSubmission">
+		<img alt="Team Submission" src="http://www.w3.org/Icons/team_subm"/>
+	      </a>
+	    </xsl:when>
+	  </xsl:choose>
+        </p>
+      </xsl:if>
+      <xsl:text>
+</xsl:text>
+      <h1>
+        <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:call-template>
+
+        <xsl:apply-templates select="title"/>
+        <xsl:if test="version">
+          <xsl:text> </xsl:text>
+          <xsl:apply-templates select="version"/>
+        </xsl:if>
+      </h1>
+      <xsl:if test="subtitle">
+        <xsl:text>
+</xsl:text>
+        <h2>
+          <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:call-template>
+          <xsl:apply-templates select="subtitle"/>
+        </h2>
+      </xsl:if>
+      <xsl:text>
+</xsl:text>
+      <h2>
+	<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:call-template>
+
+	<xsl:choose>
+	  <xsl:when test="/spec/@w3c-doctype = 'review'">
+	    <xsl:text>Editor's Draft</xsl:text>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <xsl:value-of select="w3c-doctype[1]"/>
+	  </xsl:otherwise>
+	</xsl:choose>
+	<xsl:text> </xsl:text>
+        <xsl:if test="pubdate/day">
+          <xsl:apply-templates select="pubdate/day"/>
+          <xsl:text> </xsl:text>
+        </xsl:if>
+        <xsl:apply-templates select="pubdate/month"/>
+        <xsl:text> </xsl:text>
+        <xsl:apply-templates select="pubdate/year"/>
+      </h2>
+      <dl>
+        <xsl:apply-templates select="publoc"/>
+        <xsl:apply-templates select="latestloc"/>
+        <xsl:apply-templates select="prevlocs"/>
+        <xsl:apply-templates select="authlist"/>
+      </dl>
+
+      <!-- output the errataloc and altlocs -->
+      <xsl:apply-templates select="errataloc"/>
+      <xsl:apply-templates select="preverrataloc"/>
+      <xsl:apply-templates select="translationloc"/>
+      <xsl:apply-templates select="altlocs"/>
+
+      <xsl:choose>
+        <xsl:when test="copyright">
+          <xsl:apply-templates select="copyright"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <p class="copyright">
+            <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">
+              <xsl:text>Copyright</xsl:text>
+            </a>
+            <xsl:text> © </xsl:text>
+            <xsl:apply-templates select="pubdate/year"/>
+            <xsl:text> </xsl:text>
+            <a href="http://www.w3.org/">
+              <acronym title="World Wide Web Consortium">W3C</acronym>
+            </a>
+            <sup>®</sup>
+            <xsl:text> (</xsl:text>
+            <a href="http://www.csail.mit.edu/">
+              <acronym title="Massachusetts Institute of Technology">MIT</acronym>
+            </a>
+            <xsl:text>, </xsl:text>
+            <a href="http://www.ercim.org/">
+              <acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym>
+            </a>
+            <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#Legal_Disclaimer">liability</a>
+            <xsl:text>, </xsl:text>
+            <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
+            <xsl:text> and </xsl:text>
+            <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a>
+            <xsl:text> rules apply.</xsl:text>
+          </p>
+        </xsl:otherwise>
+      </xsl:choose>
+    </div>
+    <hr xmlns="http://www.w3.org/1999/xhtml"/>
+    <xsl:apply-templates select="notice"/>
+    <xsl:apply-templates select="abstract"/>
+    <xsl:apply-templates select="status"/>
+    <xsl:apply-templates select="revisiondesc"/>
+  </xsl:template>
+
+  <xsl:template match="revisiondesc">
+    <!-- suppressed by default -->
+  </xsl:template>
+
+  <xsl:template match="copyright">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="copyright/p">
+    <p xmlns="http://www.w3.org/1999/xhtml" class="copyright">
+      <xsl:apply-templates/>
+    </p>
+  </xsl:template>
+
+  <!-- inform-div1: non-normative back matter top-level division -->
+  <!-- treat like div1 except add "(Non-Normative)" to title -->
+  <xsl:template match="inform-div1">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="div1">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <!-- interface: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- issue: open issue before the Working Group -->
+  <!-- maintain an ID for linking to it -->
+  <!-- currently generates boilerplate head plus optional head child
+       element; this should probably be cleaned up to only use the
+       head if it's present -->
+  <xsl:template match="issue">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="issue">
+      <p class="prefix">
+        <xsl:if test="@id">
+          <a name="{@id}" id="{@id}"/>
+        </xsl:if>
+        <b>
+          <xsl:text>Issue (</xsl:text>
+          <xsl:value-of select="@id"/>
+          <xsl:text>):</xsl:text>
+        </b>
+      </p>
+      <xsl:apply-templates/>
+
+      <xsl:if test="not(resolution)">
+        <p class="prefix">
+          <b>
+            <xsl:text>Resolution:</xsl:text>
+          </b>
+        </p>
+        <p>None recorded.</p>
+      </xsl:if>
+    </div>
+  </xsl:template>
+
+  <!-- item: generic list item -->
+  <xsl:template match="item">
+    <li xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:if test="@id">
+	<xsl:attribute name="id">
+	  <xsl:value-of select="@id"/>
+	</xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </li>
+  </xsl:template>
+
+  <!-- kw: keyword -->
+  <!-- make it bold -->
+  <xsl:template match="kw">
+    <b xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates/></b>
+  </xsl:template>
+
+  <!-- label: term for defintion in glossary entry -->
+  <!-- already in <dl> context from glist -->
+  <xsl:template match="label">
+    <dt xmlns="http://www.w3.org/1999/xhtml" class="label">
+      <xsl:call-template name="anchor">
+        <xsl:with-param name="node" select=".."/>
+      </xsl:call-template>
+      <xsl:call-template name="anchor"/>
+
+      <xsl:apply-templates/>
+    </dt>
+  </xsl:template>
+
+  <!-- language: -->
+  <!-- langusage: -->
+  <!-- identify language usage within a spec; not actually formatted -->
+
+  <!-- latestloc: latest location for this spec -->
+  <!-- called in a <dl> context from header -->
+
+  <!-- New pubrules will allow more than one, support multiple loc elements -->
+  <!-- DTD actually allows p.pcd.mix (!?) so be careful here... -->
+
+  <xsl:template match="latestloc">
+    <xsl:choose>
+      <xsl:when test="count(loc) &gt; 1">
+	<xsl:for-each select="loc">
+	  <dt xmlns="http://www.w3.org/1999/xhtml">
+	    <xsl:apply-templates select="node()"/>
+	  </dt>
+	  <dd xmlns="http://www.w3.org/1999/xhtml">
+	    <a href="{@href}">
+	      <xsl:value-of select="@href"/>
+	    </a>
+	  </dd>
+	</xsl:for-each>
+      </xsl:when>
+      <xsl:otherwise>
+	<dt xmlns="http://www.w3.org/1999/xhtml">Latest version:</dt>
+	<dd xmlns="http://www.w3.org/1999/xhtml">
+	  <xsl:apply-templates/>
+	</dd>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- lhs: left-hand side of formal productions -->
+  <!-- make a table row with the lhs and the corresponding other
+       pieces in this crazy mixed-up content model -->
+  <xsl:template match="lhs">
+    <tr xmlns="http://www.w3.org/1999/xhtml" valign="baseline">
+      <td>
+        <xsl:if test="ancestor-or-self::*/@diff and $show.diff.markup != 0">
+          <xsl:attribute name="class">
+            <xsl:text>diff-</xsl:text>
+            <xsl:value-of select="ancestor-or-self::*/@diff"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:if test="../@id">
+          <a name="{../@id}" id="{../@id}"/>
+        </xsl:if>
+        <xsl:apply-templates select="ancestor::prod" mode="number"/>
+<!--
+  This could be done right here, but XT goes into deep space when the
+  node to be numbered isn't the current node and level="any":
+          <xsl:number count="prod" level="any" from="spec"
+            format="[1]"/>
+  -->
+        <xsl:text>   </xsl:text>
+      </td>
+      <td>
+        <xsl:if test="ancestor-or-self::*/@diff and $show.diff.markup != 0">
+          <xsl:attribute name="class">
+            <xsl:text>diff-</xsl:text>
+            <xsl:value-of select="ancestor-or-self::*/@diff"/>
+          </xsl:attribute>
+        </xsl:if>
+        <code><xsl:apply-templates/></code>
+      </td>
+      <td>
+        <xsl:if test="ancestor-or-self::*/@diff and $show.diff.markup != 0">
+          <xsl:attribute name="class">
+            <xsl:text>diff-</xsl:text>
+            <xsl:value-of select="ancestor-or-self::*/@diff"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:text>   ::=   </xsl:text>
+      </td>
+      <xsl:apply-templates select="following-sibling::*[1][name()='rhs']"/>
+    </tr>
+  </xsl:template>
+
+  <!-- loc: a Web location -->
+  <!-- outside the header, it's a normal cross-reference -->
+  <xsl:template match="loc">
+    <xsl:if test="starts-with(@href, '#')">
+      <xsl:if test="not(key('ids', substring-after(@href, '#')))">
+        <xsl:message terminate="yes">
+          <xsl:text>Internal loc href to </xsl:text>
+          <xsl:value-of select="@href"/>
+          <xsl:text>, but that ID does not exist in this document.</xsl:text>
+        </xsl:message>
+      </xsl:if>
+    </xsl:if>
+
+    <a xmlns="http://www.w3.org/1999/xhtml" href="{@href}">
+      <xsl:choose>
+        <xsl:when test="count(child::node())=0">
+          <xsl:value-of select="@href"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </a>
+  </xsl:template>
+
+  <!-- member: member of an organization -->
+  <!-- appears only in orglist, which creates <ul> context -->
+  <xsl:template match="member">
+    <li xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </li>
+  </xsl:template>
+
+  <!-- method: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- module: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- month: month of spec -->
+  <!-- only used in pudate; called directly from header template -->
+  <xsl:template match="month">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- name: name of an editor or organization member -->
+  <!-- only appears in author and member -->
+  <!-- just output text -->
+  <xsl:template match="name">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- note: a note about the spec -->
+  <xsl:template match="note">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="note">
+      <p class="prefix">
+        <b>Note:</b>
+      </p>
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <!-- notice: a front-matter advisory about the spec's status -->
+  <!-- make sure people notice it -->
+  <xsl:template match="notice">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="notice">
+      <p class="prefix">
+        <b>NOTICE:</b>
+      </p>
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <!-- nt: production non-terminal -->
+  <!-- make a link to the non-terminal's definition -->
+  <xsl:template match="nt">
+    <a xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:attribute name="href">
+        <xsl:call-template name="href.target">
+          <xsl:with-param name="target" select="key('ids', @def)"/>
+        </xsl:call-template>
+      </xsl:attribute>
+      <xsl:apply-templates/>
+    </a>
+  </xsl:template>
+
+  <!-- ====================================================================== -->
+  <!-- OrderedList Numeration -->
+
+  <xsl:template name="list.numeration">
+    <xsl:variable name="depth" select="count(ancestor::olist)"/>
+    <xsl:choose>
+      <xsl:when test="$depth mod 5 = 0">ar</xsl:when>
+      <xsl:when test="$depth mod 5 = 1">la</xsl:when>
+      <xsl:when test="$depth mod 5 = 2">lr</xsl:when>
+      <xsl:when test="$depth mod 5 = 3">ua</xsl:when>
+      <xsl:when test="$depth mod 5 = 4">ur</xsl:when>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- olist: an ordered list -->
+  <xsl:template match="olist">
+    <xsl:variable name="numeration">
+      <xsl:call-template name="list.numeration"/>
+    </xsl:variable>
+
+    <ol xmlns="http://www.w3.org/1999/xhtml" class="enum{$numeration}">
+      <xsl:apply-templates/>
+    </ol>
+  </xsl:template>
+
+  <!-- orglist: a list of an organization's members -->
+  <xsl:template match="orglist">
+    <ul xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </ul>
+  </xsl:template>
+
+  <!-- p: a standard paragraph -->
+  <xsl:template match="p">
+    <p xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:if test="@id">
+        <xsl:attribute name="id">
+          <xsl:value-of select="@id"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="@role">
+        <xsl:attribute name="class">
+          <xsl:value-of select="@role"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </p>
+  </xsl:template>
+
+  <!-- param: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- parameters: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- phrase: semantically meaningless markup hanger -->
+  <!-- role attributes may be used to request different formatting,
+       which isn't currently handled -->
+  <xsl:template match="phrase">
+    <span xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:if test="@role">
+        <xsl:attribute name="class">
+          <xsl:value-of select="@role"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+
+  <!-- prevlocs: previous locations for this spec -->
+  <!-- called in a <dl> context from header -->
+  <xsl:template match="prevlocs">
+    <dt xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:text>Previous version</xsl:text>
+      <xsl:if test="count(loc) &gt; 1">s</xsl:if>
+      <xsl:text>:</xsl:text>
+    </dt>
+    <dd xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </dd>
+  </xsl:template>
+
+  <!-- prod: a formal grammar production -->
+  <!-- if not in a prodgroup, needs a <tbody> -->
+  <!-- has a weird content model; makes a table but there are no
+       explicit rules; many different things can start a new row -->
+  <!-- process the first child in each row, and it will process the
+       others -->
+  <xsl:template match="prod">
+    <tbody xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates select="lhs |                 rhs[preceding-sibling::*[1][name()!='lhs']] |                 com[preceding-sibling::*[1][name()!='rhs']] |                 constraint[preceding-sibling::*[1][name()!='rhs']] |                 vc[preceding-sibling::*[1][name()!='rhs']] |                 wfc[preceding-sibling::*[1][name()!='rhs']]"/>
+    </tbody>
+  </xsl:template>
+
+  <xsl:template match="prodgroup/prod">
+    <xsl:apply-templates select="lhs |               rhs[preceding-sibling::*[1][name()!='lhs']] |               com[preceding-sibling::*[1][name()!='rhs']] |               constraint[preceding-sibling::*[1][name()!='rhs']] |               vc[preceding-sibling::*[1][name()!='rhs']] |               wfc[preceding-sibling::*[1][name()!='rhs']]"/>
+  </xsl:template>
+
+  <!-- prodgroup: group of formal productions -->
+  <!-- create one <tbody> for each group -->
+  <xsl:template match="prodgroup">
+    <tbody xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </tbody>
+  </xsl:template>
+
+  <!-- prodrecap: reiteration of a prod -->
+  <!-- process the prod in another node that will never generate a
+       <tbody> or a number, plus links the lhs to the original
+       production -->
+  <xsl:template match="prodrecap">
+    <tbody xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates select="key('ids', @ref)" mode="ref"/>
+    </tbody>
+  </xsl:template>
+
+  <xsl:template match="processing-instruction('specprod')">
+    <xsl:if test="contains(., 'production-recap')"/>
+    <table xmlns="http://www.w3.org/1999/xhtml" class="scrap" summary="Scrap">
+      <tbody>
+        <xsl:apply-templates select="//prod" mode="ref"/>
+      </tbody>
+    </table>
+  </xsl:template>
+
+  <!-- proto: function prototype -->
+  <!-- type and name of the function, with arguments in parens -->
+  <xsl:template match="proto">
+    <p xmlns="http://www.w3.org/1999/xhtml">
+      <em><xsl:value-of select="@return-type"/></em>
+      <xsl:text> </xsl:text>
+      <b><xsl:value-of select="@name"/></b>
+      <xsl:text>(</xsl:text>
+      <xsl:apply-templates/>
+      <xsl:text>)</xsl:text>
+    </p>
+  </xsl:template>
+
+  <!-- pubdate: date of spec -->
+  <!-- called directly from header -->
+
+  <!-- publoc: location of current version of spec -->
+  <!-- called from header in <dl> context -->
+  <xsl:template match="publoc">
+    <dt xmlns="http://www.w3.org/1999/xhtml">This version:</dt>
+    <dd xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </dd>
+  </xsl:template>
+
+  <xsl:template match="altlocs">
+    <p xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:text>This document is also available </xsl:text>
+      <xsl:text>in these non-normative formats: </xsl:text>
+      <xsl:for-each select="loc">
+        <xsl:if test="position() &gt; 1">
+          <xsl:if test="last() &gt; 2">
+            <xsl:text>, </xsl:text>
+          </xsl:if>
+          <xsl:if test="last() = 2">
+            <xsl:text> </xsl:text>
+          </xsl:if>
+        </xsl:if>
+        <xsl:if test="position() = last() and position() &gt; 1">and </xsl:if>
+        <xsl:apply-templates select="."/>
+      </xsl:for-each>
+      <xsl:text>.</xsl:text>
+    </p>
+  </xsl:template>
+
+  <xsl:template match="errataloc">
+    <p xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:text>Please refer to the </xsl:text>
+      <a href="{@href}">errata</a>
+      <xsl:text> for this document, which may
+      include normative corrections.</xsl:text>
+    </p>
+  </xsl:template>
+
+  <xsl:template match="preverrataloc">
+    <p xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:text>The </xsl:text>
+      <a href="{@href}">previous errata</a>
+      <xsl:text> for this document, are also available.</xsl:text>
+    </p>
+  </xsl:template>
+
+  <xsl:template match="translationloc">
+    <p xmlns="http://www.w3.org/1999/xhtml">See also <a href="{@href}"><strong>translations</strong></a>.</p>
+  </xsl:template>
+
+  <!-- pubstmt: statement of publication -->
+  <!-- not currently output -->
+
+  <!-- quote: a quoted string or phrase -->
+  <!-- it would be nice to use HTML <q> elements, but browser support
+       is abysmal -->
+  <xsl:template match="quote">
+    <xsl:text>"</xsl:text>
+    <xsl:apply-templates/>
+    <xsl:text>"</xsl:text>
+  </xsl:template>
+
+  <!-- raises: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- reference: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- resolution: resolution of an issue -->
+  <xsl:template match="resolution">
+    <p xmlns="http://www.w3.org/1999/xhtml" class="prefix">
+      <b>
+        <xsl:if test="@role='partial'">Partial </xsl:if>
+        <xsl:text>Resolution:</xsl:text>
+      </b>
+    </p>
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- returns: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- revisiondesc: description of spec revision -->
+  <!-- used for internal tracking; not formatted -->
+
+  <!-- rhs: right-hand side of a formal production -->
+  <!-- make a table cell; if it's not the first after an LHS, make a
+       new row, too -->
+  <xsl:template match="rhs">
+    <xsl:choose>
+      <xsl:when test="preceding-sibling::*[1][name()='lhs']">
+        <td xmlns="http://www.w3.org/1999/xhtml">
+          <xsl:if test="ancestor-or-self::*/@diff and $show.diff.markup != 0">
+            <xsl:attribute name="class">
+              <xsl:text>diff-</xsl:text>
+              <xsl:value-of select="ancestor-or-self::*/@diff"/>
+            </xsl:attribute>
+          </xsl:if>
+          <code><xsl:apply-templates/></code>
+        </td>
+        <xsl:apply-templates select="following-sibling::*[1][name()='com' or                                           name()='constraint' or                                           name()='vc' or                                           name()='wfc']"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <tr xmlns="http://www.w3.org/1999/xhtml" valign="baseline">
+          <td/><td/><td/>
+          <td>
+            <xsl:if test="ancestor-or-self::*/@diff and $show.diff.markup != 0">
+              <xsl:attribute name="class">
+                <xsl:text>diff-</xsl:text>
+                <xsl:value-of select="ancestor-or-self::*/@diff"/>
+              </xsl:attribute>
+            </xsl:if>
+            <code><xsl:apply-templates/></code>
+          </td>
+          <xsl:apply-templates select="following-sibling::*[1][name()='com' or                                             name()='constraint' or                                             name()='vc' or                                             name()='wfc']"/>
+        </tr>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- role: part played by a member of an organization -->
+  <xsl:template match="role">
+    <xsl:text> (</xsl:text>
+    <i xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates/></i>
+    <xsl:text>) </xsl:text>
+  </xsl:template>
+
+  <!-- scrap: series of formal grammar productions -->
+  <!-- set up a <table> and handle children -->
+  <xsl:template match="scrap">
+    <xsl:apply-templates select="head"/>
+    <table xmlns="http://www.w3.org/1999/xhtml" class="scrap" summary="Scrap">
+      <xsl:apply-templates select="bnf | prod | prodgroup"/>
+    </table>
+  </xsl:template>
+
+  <!-- sequence: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- sitem: simple list item -->
+  <!-- just make one paragraph with <br>s between items -->
+  <xsl:template match="sitem">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="sitem[position() &gt; 1]" priority="2">
+    <br xmlns="http://www.w3.org/1999/xhtml"/>
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- slist: simple list -->
+  <!-- using a <blockquote> to indent the list is very wrong, but it works -->
+  <xsl:template match="slist">
+    <blockquote xmlns="http://www.w3.org/1999/xhtml">
+      <p>
+        <xsl:apply-templates/>
+      </p>
+    </blockquote>
+  </xsl:template>
+
+  <!-- source: the source of an issue -->
+  <xsl:template match="source">
+    <p xmlns="http://www.w3.org/1999/xhtml">
+      <b>Source</b>
+      <xsl:text>: </xsl:text>
+      <xsl:apply-templates/>
+    </p>
+  </xsl:template>
+
+  <!-- sourcedesc: description of spec preparation -->
+  <!-- used for tracking the source, but not formatted -->
+
+  <!-- spec: the specification itself -->
+  <xsl:template match="spec">
+    <html xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:if test="header/langusage/language">
+        <xsl:attribute name="lang">
+          <xsl:value-of select="header/langusage/language/@id"/>
+        </xsl:attribute>
+      </xsl:if>
+      <head>
+        <title>
+          <xsl:apply-templates select="header/title"/>
+          <xsl:if test="header/version">
+            <xsl:text> </xsl:text>
+            <xsl:apply-templates select="header/version"/>
+          </xsl:if>
+          <xsl:if test="$additional.title != ''">
+            <xsl:text> -- </xsl:text>
+            <xsl:value-of select="$additional.title"/>
+          </xsl:if>
+        </title>
+        <xsl:call-template name="css"/>
+	<xsl:call-template name="additional-head"/>
+      </head>
+      <body>
+        <xsl:apply-templates/>
+        <xsl:if test="//footnote[not(ancestor::table)]">
+          <hr/>
+          <div class="endnotes">
+            <xsl:text>
+</xsl:text>
+            <h3>
+              <xsl:call-template name="anchor">
+                <xsl:with-param name="conditional" select="0"/>
+                <xsl:with-param name="default.id" select="'endnotes'"/>
+              </xsl:call-template>
+              <xsl:text>End Notes</xsl:text>
+            </h3>
+            <dl>
+              <xsl:apply-templates select="//footnote[not(ancestor::table)]" mode="notes"/>
+            </dl>
+          </div>
+        </xsl:if>
+      </body>
+    </html>
+  </xsl:template>
+
+  <!-- Specref -->
+
+  <!-- specref: reference to another part of teh current specification -->
+  <xsl:template match="specref">
+    <xsl:param name="target" select="key('ids', @ref)[1]"/>
+
+    <xsl:choose>
+      <xsl:when test="not($target)">
+	<xsl:message>
+	  <xsl:text>specref to non-existent ID: </xsl:text>
+	  <xsl:value-of select="@ref"/>
+	</xsl:message>
+      </xsl:when>
+      <xsl:when test="local-name($target)='issue'                       or starts-with(local-name($target), 'div')                       or starts-with(local-name($target), 'inform-div')                       or local-name($target) = 'vcnote'                       or local-name($target) = 'prod'                       or local-name($target) = 'example'                       or local-name($target) = 'label'         or $target/self::item[parent::olist]">
+        <xsl:apply-templates select="$target" mode="specref"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:message>
+          <xsl:text>Unsupported specref to </xsl:text>
+          <xsl:value-of select="local-name($target)"/>
+          <xsl:text> [</xsl:text>
+          <xsl:value-of select="@ref"/>
+          <xsl:text>] </xsl:text>
+          <xsl:text> (Contact stylesheet maintainer).</xsl:text>
+        </xsl:message>
+        <b xmlns="http://www.w3.org/1999/xhtml">
+          <a>
+            <xsl:attribute name="href">
+              <xsl:call-template name="href.target">
+                <xsl:with-param name="target" select="key('ids', @ref)"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:text>???</xsl:text>
+          </a>
+        </b>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="item" mode="specref">
+    <xsl:variable name="items" select="ancestor-or-self::item[parent::olist]"/>
+
+    <a xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:attribute name="href">
+        <xsl:call-template name="href.target"/>
+      </xsl:attribute>
+
+      <!--
+      <xsl:value-of select="count($items)"/>
+      <xsl:text>;</xsl:text>
+      -->
+
+      <xsl:for-each select="$items">
+	<xsl:variable name="number" select="count(preceding-sibling::item)+1"/>
+	<xsl:variable name="numeration">
+	  <!-- this is related to, but not the same as, list.numeration -->
+	  <xsl:choose>
+	    <xsl:when test="count(ancestor::olist) mod 5 = 1">ar</xsl:when>
+	    <xsl:when test="count(ancestor::olist) mod 5 = 2">la</xsl:when>
+	    <xsl:when test="count(ancestor::olist) mod 5 = 3">lr</xsl:when>
+	    <xsl:when test="count(ancestor::olist) mod 5 = 4">ua</xsl:when>
+	    <xsl:when test="count(ancestor::olist) mod 5 = 0">ur</xsl:when>
+	  </xsl:choose>
+	</xsl:variable>
+
+	<xsl:choose>
+	  <xsl:when test="$numeration = 'la'">
+	    <xsl:number value="$number" format="a"/>
+	  </xsl:when>
+	  <xsl:when test="$numeration = 'lr'">
+	    <xsl:number value="$number" format="i"/>
+	  </xsl:when>
+	  <xsl:when test="$numeration = 'ua'">
+	    <xsl:number value="$number" format="A"/>
+	  </xsl:when>
+	  <xsl:when test="$numeration = 'ur'">
+	    <xsl:number value="$number" format="I"/>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <xsl:value-of select="$number"/>
+	  </xsl:otherwise>
+	</xsl:choose>
+	<xsl:text>.</xsl:text>
+
+	<!--
+	<xsl:text>(</xsl:text>
+	<xsl:value-of select="$number"/>
+	<xsl:text>;</xsl:text>
+	<xsl:value-of select="$numeration"/>
+	<xsl:text>)</xsl:text>
+	-->
+
+      </xsl:for-each>
+
+    </a>
+  </xsl:template>
+
+  <xsl:template match="issue" mode="specref">
+    <xsl:text>[</xsl:text>
+    <a xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:attribute name="href">
+        <xsl:call-template name="href.target"/>
+      </xsl:attribute>
+      <b>
+        <xsl:text>Issue </xsl:text>
+        <xsl:apply-templates select="." mode="number"/>
+        <xsl:text>: </xsl:text>
+        <xsl:apply-templates select="head" mode="text"/>
+      </b>
+    </a>
+    <xsl:text>]</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="div1|div2|div3|div4|div5" mode="specref">
+    <a xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:attribute name="href">
+        <xsl:call-template name="href.target"/>
+      </xsl:attribute>
+      <b>
+        <xsl:apply-templates select="." mode="divnum"/>
+        <xsl:apply-templates select="head" mode="text"/>
+      </b>
+    </a>
+  </xsl:template>
+
+  <xsl:template match="inform-div1" mode="specref">
+    <a xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:attribute name="href">
+        <xsl:call-template name="href.target"/>
+      </xsl:attribute>
+      <b>
+        <xsl:apply-templates select="." mode="divnum"/>
+        <xsl:apply-templates select="head" mode="text"/>
+      </b>
+    </a>
+  </xsl:template>
+
+  <xsl:template match="vcnote" mode="specref">
+    <b xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:text>[VC: </xsl:text>
+      <a>
+        <xsl:attribute name="href">
+          <xsl:call-template name="href.target"/>
+        </xsl:attribute>
+        <xsl:apply-templates select="head" mode="text"/>
+      </a>
+      <xsl:text>]</xsl:text>
+    </b>
+  </xsl:template>
+
+  <xsl:template match="prod" mode="specref">
+    <b xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:text>[PROD: </xsl:text>
+      <a>
+        <xsl:attribute name="href">
+          <xsl:call-template name="href.target"/>
+        </xsl:attribute>
+        <xsl:apply-templates select="." mode="number-simple"/>
+      </a>
+      <xsl:text>]</xsl:text>
+    </b>
+  </xsl:template>
+
+  <xsl:template match="label" mode="specref">
+    <b xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:text>[</xsl:text>
+      <a>
+        <xsl:attribute name="href">
+          <xsl:call-template name="href.target"/>
+        </xsl:attribute>
+        <xsl:value-of select="."/>
+      </a>
+      <xsl:text>]</xsl:text>
+    </b>
+  </xsl:template>
+
+  <xsl:template match="example" mode="specref">
+    <xsl:apply-templates select="head" mode="specref"/>
+  </xsl:template>
+
+  <xsl:template match="example/head" mode="specref">
+    <xsl:variable name="id">
+      <xsl:call-template name="object.id">
+        <xsl:with-param name="node" select=".."/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <a xmlns="http://www.w3.org/1999/xhtml" href="#{$id}">
+      <xsl:text>Example</xsl:text>
+    </a>
+  </xsl:template>
+
+  <!-- /Specref -->
+
+  <!-- status: the status of the spec -->
+  <xsl:template match="status">
+    <div xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:text>
+</xsl:text>
+      <h2>
+        <xsl:call-template name="anchor">
+          <xsl:with-param name="conditional" select="0"/>
+          <xsl:with-param name="default.id" select="'status'"/>
+        </xsl:call-template>
+        <xsl:text>Status of this Document</xsl:text>
+      </h2>
+      <xsl:if test="/spec/@role='editors-copy'">
+        <p><strong>This document is an editors' copy that has
+        no official standing.</strong></p>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <!-- struct: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- sub: subscript -->
+  <xsl:template match="sub">
+    <sub xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </sub>
+  </xsl:template>
+
+  <!-- subtitle: secondary title of spec -->
+  <!-- handled directly within header -->
+  <xsl:template match="title">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- sup: superscript -->
+  <xsl:template match="sup">
+    <sup xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </sup>
+  </xsl:template>
+
+  <!-- table: the HTML table model adopted wholesale; note however that we -->
+  <!-- do this such that the XHTML stylesheet will do the right thing. -->
+  <xsl:template match="caption|col|colgroup|tfoot|thead|tr|tbody">
+    <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
+      <xsl:for-each select="@*">
+        <!-- Wait: some of these aren't HTML attributes after all... -->
+        <xsl:choose>
+          <xsl:when test="local-name(.) = 'role'">
+            <xsl:attribute name="class">
+              <xsl:value-of select="."/>
+            </xsl:attribute>
+          </xsl:when>
+          <xsl:when test="local-name(.) = 'diff'">
+            <!-- nop -->
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:copy>
+
+            </xsl:copy>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:for-each>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+
+  <!-- td/th are special -->
+  <xsl:template match="td|th">
+    <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
+      <xsl:for-each select="@*">
+        <!-- Wait: some of these aren't HTML attributes after all... -->
+	<xsl:choose>
+          <xsl:when test="local-name(.) = 'role'">
+            <xsl:attribute name="class">
+              <xsl:value-of select="."/>
+            </xsl:attribute>
+          </xsl:when>
+          <xsl:when test="local-name(.) = 'diff'"/>
+	  <xsl:when test="local-name(.) = 'colspan' and . = 1"/>
+	  <xsl:when test="local-name(.) = 'rowspan' and . = 1"/>
+	  <xsl:otherwise>
+            <xsl:copy-of select="."/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:for-each>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+
+  <!-- but table is special, to handle footnotes -->
+  <xsl:template match="table">
+    <xsl:call-template name="anchor"/>
+    <table xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:for-each select="@*">
+        <!-- Wait: some of these aren't HTML attributes after all... -->
+        <xsl:choose>
+          <xsl:when test="local-name(.) = 'role'">
+            <xsl:attribute name="class">
+              <xsl:value-of select="."/>
+            </xsl:attribute>
+          </xsl:when>
+          <xsl:when test="local-name(.) = 'diff' or local-name(.) = 'id'">
+            <!-- nop -->
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:copy-of select="."/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:for-each>
+      <xsl:apply-templates/>
+
+      <xsl:if test=".//footnote">
+        <tbody>
+          <tr>
+            <td>
+              <xsl:apply-templates select=".//footnote" mode="table.notes"/>
+            </td>
+          </tr>
+        </tbody>
+      </xsl:if>
+    </table>
+  </xsl:template>
+
+  <!-- term: the actual mention of a term within a termdef -->
+  <xsl:template match="term">
+    <b xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates/></b>
+  </xsl:template>
+
+  <!-- termdef: sentence or phrase defining a term -->
+  <xsl:template match="termdef">
+    <xsl:text>[</xsl:text>
+    <a xmlns="http://www.w3.org/1999/xhtml" name="{@id}" id="{@id}" title="{@term}">
+      <xsl:text>Definition</xsl:text>
+    </a>
+    <xsl:text>: </xsl:text>
+    <xsl:apply-templates/>
+    <xsl:text>]</xsl:text>
+  </xsl:template>
+
+  <!-- termref: reference to a defined term -->
+  <xsl:template match="termref">
+    <a xmlns="http://www.w3.org/1999/xhtml" title="{key('ids', @def)/@term}">
+      <xsl:attribute name="href">
+        <xsl:call-template name="href.target">
+          <xsl:with-param name="target" select="key('ids', @def)"/>
+        </xsl:call-template>
+      </xsl:attribute>
+      <xsl:apply-templates/>
+    </a>
+  </xsl:template>
+
+  <!-- tfoot: see table -->
+  <!-- th: see table -->
+  <!-- thead: see table -->
+
+  <!-- title: title of the specification -->
+  <!-- called directly within header -->
+
+  <!-- titleref: reference to the title of any work -->
+  <!-- if a URL is given, link it -->
+  <xsl:template match="titleref">
+    <xsl:choose>
+      <xsl:when test="@href">
+        <a xmlns="http://www.w3.org/1999/xhtml" href="{@href}">
+          <cite>
+            <xsl:apply-templates/>
+          </cite>
+        </a>
+      </xsl:when>
+      <xsl:when test="ancestor::bibl/@href">
+        <a xmlns="http://www.w3.org/1999/xhtml" href="{ancestor::bibl/@href}">
+          <cite>
+            <xsl:apply-templates/>
+          </cite>
+        </a>
+      </xsl:when>
+      <xsl:otherwise>
+        <cite xmlns="http://www.w3.org/1999/xhtml">
+          <xsl:apply-templates/>
+        </cite>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- tr: see table -->
+
+  <!-- typedef: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- typename: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- ulist: unordered list -->
+  <xsl:template match="ulist">
+    <ul xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </ul>
+  </xsl:template>
+
+  <!-- union: -->
+  <!-- IDL stuff isn't handled yet -->
+
+  <!-- var: a variable -->
+  <xsl:template match="var">
+    <var xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </var>
+  </xsl:template>
+
+  <!-- vc: validity check reference in a formal production -->
+  <xsl:template match="vc">
+    <xsl:choose>
+      <xsl:when test="preceding-sibling::*[1][name()='rhs']">
+        <td xmlns="http://www.w3.org/1999/xhtml">
+          <xsl:if test="@diff and $show.diff.markup != 0">
+            <xsl:attribute name="class">
+              <xsl:text>diff-</xsl:text>
+              <xsl:value-of select="@diff"/>
+            </xsl:attribute>
+          </xsl:if>
+          <a>
+            <xsl:attribute name="href">
+              <xsl:call-template name="href.target">
+                <xsl:with-param name="target" select="key('ids', @def)"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:text>[VC: </xsl:text>
+            <xsl:apply-templates select="key('ids', @def)/head" mode="text"/>
+            <xsl:text>]</xsl:text>
+          </a>
+        </td>
+      </xsl:when>
+      <xsl:otherwise>
+        <tr xmlns="http://www.w3.org/1999/xhtml" valign="baseline">
+          <td/><td/><td/><td/>
+          <td>
+            <xsl:if test="@diff and $show.diff.markup != 0">
+              <xsl:attribute name="class">
+                <xsl:text>diff-</xsl:text>
+                <xsl:value-of select="@diff"/>
+              </xsl:attribute>
+            </xsl:if>
+            <a>
+              <xsl:attribute name="href">
+                <xsl:call-template name="href.target">
+                  <xsl:with-param name="target" select="key('ids', @def)"/>
+                </xsl:call-template>
+              </xsl:attribute>
+              <xsl:text>[VC: </xsl:text>
+              <xsl:apply-templates select="key('ids', @def)/head" mode="text"/>
+              <xsl:text>]</xsl:text>
+            </a>
+          </td>
+        </tr>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- vcnote: validity check note after a formal production -->
+  <xsl:template match="vcnote">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="constraint">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <!-- version: version of this spec -->
+  <!-- called directly from header -->
+  <xsl:template match="version">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- w3c-designation: canonical name for this spec -->
+  <!-- not used for formatting -->
+
+  <!-- wfc: well-formedness check reference in a formal production -->
+  <xsl:template match="wfc">
+    <xsl:choose>
+      <xsl:when test="preceding-sibling::*[1][name()='rhs']">
+        <td xmlns="http://www.w3.org/1999/xhtml">
+          <xsl:if test="@diff and $show.diff.markup != 0">
+            <xsl:attribute name="class">
+              <xsl:text>diff-</xsl:text>
+              <xsl:value-of select="@diff"/>
+            </xsl:attribute>
+          </xsl:if>
+          <a>
+            <xsl:attribute name="href">
+              <xsl:call-template name="href.target">
+                <xsl:with-param name="target" select="key('ids', @def)"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:text>[WFC: </xsl:text>
+            <xsl:apply-templates select="key('ids', @def)/head" mode="text"/>
+            <xsl:text>]</xsl:text>
+          </a>
+        </td>
+      </xsl:when>
+      <xsl:otherwise>
+        <tr xmlns="http://www.w3.org/1999/xhtml" valign="baseline">
+          <td/><td/><td/><td/>
+          <td>
+            <xsl:if test="@diff and $show.diff.markup != 0">
+              <xsl:attribute name="class">
+                <xsl:text>diff-</xsl:text>
+                <xsl:value-of select="@diff"/>
+              </xsl:attribute>
+            </xsl:if>
+            <a>
+              <xsl:attribute name="href">
+                <xsl:call-template name="href.target">
+                  <xsl:with-param name="target" select="key('ids', @def)"/>
+                </xsl:call-template>
+              </xsl:attribute>
+              <xsl:text>[WFC: </xsl:text>
+              <xsl:apply-templates select="key('ids', @def)/head" mode="text"/>
+              <xsl:text>]</xsl:text>
+            </a>
+          </td>
+        </tr>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- wfcnote: well-formedness check note after formal production -->
+  <xsl:template match="wfcnote">
+    <div xmlns="http://www.w3.org/1999/xhtml" class="constraint">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <!-- xnt: external non-terminal -->
+  <!-- xspecref: external specification reference -->
+  <!-- xtermref: external term reference -->
+  <!-- just link to URI provided -->
+  <xsl:template match="xnt | xspecref | xtermref">
+    <a xmlns="http://www.w3.org/1999/xhtml" href="{@href}">
+      <xsl:apply-templates/>
+    </a>
+  </xsl:template>
+
+  <!-- year: year of spec -->
+  <!-- only used in pudate; called directly from header template -->
+  <xsl:template match="year">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!-- Silly HTML elements used for pasting stuff in; shouldn't ever
+       show up in a spec, but they're easy to handle and you just
+       never know. -->
+  <xsl:template match="a|div|em|h1|h2|h3|h4|h5|h6|li|ol|pre|ul">
+    <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
+      <xsl:copy-of select="@*"/>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+
+  <!-- legacy XML spec stuff -->
+  <xsl:template match="htable">
+    <table xmlns="http://www.w3.org/1999/xhtml" summary="HTML Table">
+      <xsl:copy-of select="@*"/>
+      <xsl:apply-templates/>
+    </table>
+  </xsl:template>
+  <xsl:template match="htbody">
+    <tbody xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:copy-of select="@*"/>
+      <xsl:apply-templates/>
+    </tbody>
+  </xsl:template>
+  <xsl:template match="key-term">
+    <b xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates/></b>
+  </xsl:template>
+  <xsl:template match="statusp">
+    <p xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </p>
+  </xsl:template>
+
+  <!-- legacy DocBook stuff -->
+  <xsl:template match="itemizedlist">
+    <ul xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </ul>
+  </xsl:template>
+  <xsl:template match="listitem">
+    <li xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </li>
+  </xsl:template>
+  <xsl:template match="orderedlist">
+    <ol xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </ol>
+  </xsl:template>
+  <xsl:template match="para">
+    <p xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </p>
+  </xsl:template>
+
+  <!-- mode: divnum -->
+  <xsl:template mode="divnum" match="div1">
+    <xsl:number format="1 "/>
+  </xsl:template>
+
+  <xsl:template mode="divnum" match="back/div1 | inform-div1">
+    <xsl:number count="div1 | inform-div1" format="A "/>
+  </xsl:template>
+
+  <xsl:template mode="divnum" match="front/div1 | front//div2 | front//div3 | front//div4 | front//div5"/>
+
+  <xsl:template mode="divnum" match="div2">
+    <xsl:number level="multiple" count="div1 | div2" format="1.1 "/>
+  </xsl:template>
+
+  <xsl:template mode="divnum" match="back//div2">
+    <xsl:number level="multiple" count="div1 | div2 | inform-div1" format="A.1 "/>
+  </xsl:template>
+
+  <xsl:template mode="divnum" match="div3">
+    <xsl:number level="multiple" count="div1 | div2 | div3" format="1.1.1 "/>
+  </xsl:template>
+
+  <xsl:template mode="divnum" match="back//div3">
+    <xsl:number level="multiple" count="div1 | div2 | div3 | inform-div1" format="A.1.1 "/>
+  </xsl:template>
+
+  <xsl:template mode="divnum" match="div4">
+    <xsl:number level="multiple" count="div1 | div2 | div3 | div4" format="1.1.1.1 "/>
+  </xsl:template>
+
+  <xsl:template mode="divnum" match="back//div4">
+    <xsl:number level="multiple" count="div1 | div2 | div3 | div4 | inform-div1" format="A.1.1.1 "/>
+  </xsl:template>
+
+  <xsl:template mode="divnum" match="div5">
+    <xsl:number level="multiple" count="div1 | div2 | div3 | div4 | div5" format="1.1.1.1.1 "/>
+  </xsl:template>
+
+  <xsl:template mode="divnum" match="back//div5">
+    <xsl:number level="multiple" count="div1 | div2 | div3 | div4 | div5 | inform-div1" format="A.1.1.1.1 "/>
+  </xsl:template>
+
+  <!-- mode: notes -->
+  <xsl:template mode="notes" match="footnote">
+    <xsl:variable name="this-note-id">
+      <xsl:choose>
+        <xsl:when test="@id">
+          <xsl:value-of select="@id"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="generate-id(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <dt xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:text>[</xsl:text>
+      <a name="{$this-note-id}" id="{$this-note-id}" href="#FN-ANCH-{$this-note-id}">
+        <xsl:apply-templates select="." mode="number-simple"/>
+      </a>
+      <xsl:text>]</xsl:text>
+    </dt>
+    <dd xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates/>
+    </dd>
+  </xsl:template>
+
+  <!-- mode: table.notes -->
+  <xsl:template match="footnote" mode="table.notes">
+    <xsl:apply-templates mode="table.notes"/>
+  </xsl:template>
+
+  <xsl:template match="footnote/p[1]" mode="table.notes">
+    <xsl:variable name="this-note-id">
+      <xsl:choose>
+        <xsl:when test="../@id">
+          <xsl:value-of select="../@id"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="generate-id(parent::*)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <p xmlns="http://www.w3.org/1999/xhtml" class="table.footnote">
+      <sup>
+        <a name="{$this-note-id}" id="{$this-note-id}" href="#FN-ANCH-{$this-note-id}">
+          <xsl:apply-templates select="parent::footnote" mode="number-simple"/>
+          <xsl:text>.</xsl:text>
+        </a>
+      </sup>
+      <xsl:text> </xsl:text>
+      <xsl:apply-templates/>
+    </p>
+  </xsl:template>
+
+  <!-- mode: number -->
+  <xsl:template mode="number" match="prod">
+    <xsl:text>[</xsl:text>
+    <xsl:apply-templates select="." mode="number-simple"/>
+    <xsl:text>]</xsl:text>
+  </xsl:template>
+
+  <xsl:template mode="number" match="issue">
+    <xsl:number level="single" format="1"/>
+  </xsl:template>
+
+  <xsl:template mode="number" match="prod[@diff='add']">
+    <xsl:text>[</xsl:text>
+    <xsl:apply-templates select="preceding::prod[not(@diff='add')][1]" mode="number-simple"/>
+<!--
+  Once again, this could be done right here, but XT won't hear of it.
+    <xsl:number level="any" count="prod[not(@diff='add')]"/>
+  -->
+    <xsl:number level="any" count="prod[@diff='add']" from="prod[not(@diff='add')]" format="a"/>
+    <xsl:text>]</xsl:text>
+  </xsl:template>
+
+  <!-- mode: number-simple -->
+  <xsl:template mode="number-simple" match="prod">
+    <!-- Using @num and auto-numbered productions is forbidden. -->
+    <xsl:choose>
+      <xsl:when test="@num">
+        <xsl:value-of select="@num"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:number level="any" count="prod[not(@diff='add')]"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template mode="number-simple" match="footnote">
+    <xsl:number level="any" format="1"/>
+  </xsl:template>
+
+  <!-- mode: ref -->
+  <xsl:template match="lhs" mode="ref">
+    <tr xmlns="http://www.w3.org/1999/xhtml" valign="baseline">
+      <td>
+        <xsl:if test="ancestor-or-self::*/@diff and $show.diff.markup != 0">
+          <xsl:attribute name="class">
+            <xsl:text>diff-</xsl:text>
+            <xsl:value-of select="ancestor-or-self::*/@diff"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates select="ancestor::prod" mode="number"/>
+        <xsl:text>   </xsl:text>
+      </td>
+      <td>
+        <xsl:if test="ancestor-or-self::*/@diff and $show.diff.markup != 0">
+          <xsl:attribute name="class">
+            <xsl:text>diff-</xsl:text>
+            <xsl:value-of select="ancestor-or-self::*/@diff"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:choose>
+          <xsl:when test="../@id">
+            <a href="#{../@id}">
+              <code><xsl:apply-templates/></code>
+            </a>
+          </xsl:when>
+          <xsl:otherwise>
+            <code><xsl:apply-templates/></code>
+          </xsl:otherwise>
+        </xsl:choose>
+      </td>
+      <td>
+        <xsl:if test="ancestor-or-self::*/@diff and $show.diff.markup != 0">
+          <xsl:attribute name="class">
+            <xsl:text>diff-</xsl:text>
+            <xsl:value-of select="ancestor-or-self::*/@diff"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:text>   ::=   </xsl:text>
+      </td>
+      <xsl:apply-templates select="following-sibling::*[1][name()='rhs']"/>
+    </tr>
+  </xsl:template>
+
+  <xsl:template mode="ref" match="prod">
+    <xsl:apply-templates select="lhs" mode="ref"/>
+    <xsl:apply-templates select="rhs[preceding-sibling::*[1][name()!='lhs']] |               com[preceding-sibling::*[1][name()!='rhs']] |               constraint[preceding-sibling::*[1][name()!='rhs']] |               vc[preceding-sibling::*[1][name()!='rhs']] |               wfc[preceding-sibling::*[1][name()!='rhs']]"/>
+  </xsl:template>
+
+  <!-- mode: text -->
+  <!-- most stuff processes just as text here, but some things should
+       be hidden -->
+  <xsl:template mode="text" match="ednote | footnote"/>
+
+  <!-- mode: toc -->
+  <xsl:template mode="toc" match="div1">
+    <xsl:apply-templates select="." mode="divnum"/>
+    <a xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:attribute name="href">
+        <xsl:call-template name="href.target">
+          <xsl:with-param name="target" select="."/>
+        </xsl:call-template>
+      </xsl:attribute>
+      <xsl:apply-templates select="head" mode="text"/>
+    </a>
+    <br xmlns="http://www.w3.org/1999/xhtml"/>
+    <xsl:text>
+</xsl:text>
+    <xsl:if test="$toc.level &gt; 1">
+      <xsl:apply-templates select="div2" mode="toc"/>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template mode="toc" match="div2">
+    <xsl:text>    </xsl:text>
+    <xsl:apply-templates select="." mode="divnum"/>
+    <a xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:attribute name="href">
+        <xsl:call-template name="href.target">
+          <xsl:with-param name="target" select="."/>
+        </xsl:call-template>
+      </xsl:attribute>
+      <xsl:apply-templates select="head" mode="text"/>
+    </a>
+    <br xmlns="http://www.w3.org/1999/xhtml"/>
+    <xsl:text>
+</xsl:text>
+    <xsl:if test="$toc.level &gt; 2">
+      <xsl:apply-templates select="div3" mode="toc"/>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template mode="toc" match="div3">
+    <xsl:text>        </xsl:text>
+    <xsl:apply-templates select="." mode="divnum"/>
+    <a xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:attribute name="href">
+        <xsl:call-template name="href.target">
+          <xsl:with-param name="target" select="."/>
+        </xsl:call-template>
+      </xsl:attribute>
+      <xsl:apply-templates select="head" mode="text"/>
+    </a>
+    <br xmlns="http://www.w3.org/1999/xhtml"/>
+    <xsl:text>
+</xsl:text>
+    <xsl:if test="$toc.level &gt; 3">
+      <xsl:apply-templates select="div4" mode="toc"/>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template mode="toc" match="div4">
+    <xsl:text>            </xsl:text>
+    <xsl:apply-templates select="." mode="divnum"/>
+    <a xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:attribute name="href">
+        <xsl:call-template name="href.target">
+          <xsl:with-param name="target" select="."/>
+        </xsl:call-template>
+      </xsl:attribute>
+      <xsl:apply-templates select="head" mode="text"/>
+    </a>
+    <br xmlns="http://www.w3.org/1999/xhtml"/>
+    <xsl:text>
+</xsl:text>
+    <xsl:if test="$toc.level &gt; 4">
+      <xsl:apply-templates select="div5" mode="toc"/>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template mode="toc" match="div5">
+    <xsl:text>                </xsl:text>
+    <xsl:apply-templates select="." mode="divnum"/>
+    <a xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:attribute name="href">
+        <xsl:call-template name="href.target">
+          <xsl:with-param name="target" select="."/>
+        </xsl:call-template>
+      </xsl:attribute>
+      <xsl:apply-templates select="head" mode="text"/>
+    </a>
+    <br xmlns="http://www.w3.org/1999/xhtml"/>
+    <xsl:text>
+</xsl:text>
+  </xsl:template>
+
+  <xsl:template mode="toc" match="inform-div1">
+    <xsl:apply-templates select="." mode="divnum"/>
+    <a xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:attribute name="href">
+        <xsl:call-template name="href.target">
+          <xsl:with-param name="target" select="."/>
+        </xsl:call-template>
+      </xsl:attribute>
+      <xsl:apply-templates select="head" mode="text"/>
+    </a>
+    <xsl:text> (Non-Normative)</xsl:text>
+    <br xmlns="http://www.w3.org/1999/xhtml"/>
+    <xsl:text>
+</xsl:text>
+    <xsl:if test="$toc.level &gt; 2">
+      <xsl:apply-templates select="div2" mode="toc"/>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="css">
+    <style xmlns="http://www.w3.org/1999/xhtml" type="text/css">
+      <xsl:text>
+code           { font-family: monospace; }
+
+div.constraint,
+div.issue,
+div.note,
+div.notice     { margin-left: 2em; }
+
+ol.enumar      { list-style-type: decimal; }
+ol.enumla      { list-style-type: lower-alpha; }
+ol.enumlr      { list-style-type: lower-roman; }
+ol.enumua      { list-style-type: upper-alpha; }
+ol.enumur      { list-style-type: upper-roman; }
+
+</xsl:text>
+      <xsl:if test="$tabular.examples = 0">
+        <xsl:text>
+div.exampleInner pre { margin-left: 1em;
+                       margin-top: 0em; margin-bottom: 0em}
+div.exampleOuter {border: 4px double gray;
+                  margin: 0em; padding: 0em}
+div.exampleInner { background-color: #d5dee3;
+                   border-top-width: 4px;
+                   border-top-style: double;
+                   border-top-color: #d3d3d3;
+                   border-bottom-width: 4px;
+                   border-bottom-style: double;
+                   border-bottom-color: #d3d3d3;
+                   padding: 4px; margin: 0em }
+div.exampleWrapper { margin: 4px }
+div.exampleHeader { font-weight: bold;
+                    margin: 4px}
+</xsl:text>
+      </xsl:if>
+      <xsl:value-of select="$additional.css"/>
+    </style>
+    <link xmlns="http://www.w3.org/1999/xhtml" rel="stylesheet" type="text/css">
+      <xsl:attribute name="href">
+        <xsl:text>http://www.w3.org/StyleSheets/TR/</xsl:text>
+        <xsl:choose>
+          <xsl:when test="/spec/@role='editors-copy'">base</xsl:when>
+          <xsl:otherwise>
+            <xsl:choose>
+	      <!-- Editor's review drafts are a special case. -->
+              <xsl:when test="/spec/@w3c-doctype='review'          or contains(/spec/header/w3c-doctype, 'Editor')">base</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='wd'">W3C-WD</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='rec'">W3C-REC</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='pr'">W3C-PR</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='per'">W3C-PER</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='cr'">W3C-CR</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='note'">W3C-NOTE</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='wgnote'">W3C-WG-NOTE</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='memsub'">W3C-Member-SUBM</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='teamsub'">W3C-Team-SUBM</xsl:when>
+              <xsl:otherwise>base</xsl:otherwise>
+            </xsl:choose>
+          </xsl:otherwise>
+        </xsl:choose>
+        <xsl:text>.css</xsl:text>
+      </xsl:attribute>
+    </link>
+  </xsl:template>
+
+  <xsl:template name="additional-head">
+    <!-- nop -->
+  </xsl:template>
+
+  <xsl:template name="href.target">
+    <xsl:param name="target" select="."/>
+
+    <xsl:text>#</xsl:text>
+
+    <xsl:choose>
+      <xsl:when test="$target/@id">
+        <xsl:value-of select="$target/@id"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="generate-id($target)"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<!-- ================================================================= -->
+
+<xsl:template name="object.id">
+  <xsl:param name="node" select="."/>
+  <xsl:param name="default.id" select="''"/>
+
+  <xsl:choose>
+    <!-- can't use the default ID if it's used somewhere else in the document! -->
+    <xsl:when test="$default.id != '' and not(key('ids', $default.id))">
+      <xsl:value-of select="$default.id"/>
+    </xsl:when>
+    <xsl:when test="$node/@id">
+      <xsl:value-of select="$node/@id"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="generate-id($node)"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="anchor">
+  <xsl:param name="node" select="."/>
+  <xsl:param name="conditional" select="1"/>
+  <xsl:param name="default.id" select="''"/>
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="node" select="$node"/>
+      <xsl:with-param name="default.id" select="$default.id"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:if test="$conditional = 0 or $node/@id">
+    <a xmlns="http://www.w3.org/1999/xhtml" name="{$id}" id="{$id}"/>
+  </xsl:if>
+</xsl:template>
+
+<!-- ================================================================= -->
+
+</xsl:transform>