]> granicus.if.org Git - docbook-dsssl/commitdiff
Contains XSL Stylesheets for API support in DB5
authorrankoo <rankoo>
Fri, 16 Jul 2010 14:09:56 +0000 (14:09 +0000)
committerrankoo <rankoo>
Fri, 16 Jul 2010 14:09:56 +0000 (14:09 +0000)
->Adjusted Stylesheets for HTML output

28 files changed:
xsl/api/admon.xsl [new file with mode: 0644]
xsl/api/annotation.xsl [new file with mode: 0644]
xsl/api/callout.xsl [new file with mode: 0644]
xsl/api/chunk-common.xsl [new file with mode: 0644]
xsl/api/docbook-layout.xsl [new file with mode: 0644]
xsl/api/docbook.xsl [new file with mode: 0644]
xsl/api/error.xsl [new file with mode: 0644]
xsl/api/fo.xsl [new file with mode: 0644]
xsl/api/function.xsl [new file with mode: 0644]
xsl/api/global.xsl [new file with mode: 0644]
xsl/api/html-base.xsl [new file with mode: 0644]
xsl/api/html-help.xsl [new file with mode: 0644]
xsl/api/html-single.xsl [new file with mode: 0644]
xsl/api/html.xsl [new file with mode: 0644]
xsl/api/index.xsl [new file with mode: 0644]
xsl/api/library.xsl [new file with mode: 0644]
xsl/api/lookup.xsl [new file with mode: 0644]
xsl/api/macro.xsl [new file with mode: 0644]
xsl/api/manpages.xsl [new file with mode: 0644]
xsl/api/navbar.xsl [new file with mode: 0644]
xsl/api/reference.xsl [new file with mode: 0644]
xsl/api/relative-href.xsl [new file with mode: 0644]
xsl/api/source-highlight.xsl [new file with mode: 0644]
xsl/api/template.xsl [new file with mode: 0644]
xsl/api/type.xsl [new file with mode: 0644]
xsl/api/utility.xsl [new file with mode: 0644]
xsl/api/xhtml.xsl [new file with mode: 0644]
xsl/api/xref.xsl [new file with mode: 0644]

diff --git a/xsl/api/admon.xsl b/xsl/api/admon.xsl
new file mode 100644 (file)
index 0000000..2b16798
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+  
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:d="http://docbook.org/ns/docbook"
+                               xmlns:exsl="http://exslt.org/common"
+                               exclude-result-prefixes="exsl d"
+                version="1.0">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/html/admon.xsl"/>
+
+<!-- Already included in the main style sheet -->
+<!-- <xsl:import href="relative-href.xsl"/> -->
+
+<xsl:template name="admon.graphic">
+    <xsl:param name="node" select="."/>
+
+    <xsl:call-template name="href.target.relative">
+        <xsl:with-param name="target" select="$admon.graphics.path"/>
+    </xsl:call-template>
+
+    <xsl:choose>
+        <xsl:when test="local-name($node)='note'">note</xsl:when>
+        <xsl:when test="local-name($node)='warning'">warning</xsl:when>
+        <xsl:when test="local-name($node)='caution'">caution</xsl:when>
+        <xsl:when test="local-name($node)='tip'">tip</xsl:when>
+        <xsl:when test="local-name($node)='important'">important</xsl:when>
+        <xsl:otherwise>note</xsl:otherwise>
+    </xsl:choose>
+
+    <xsl:value-of select="$admon.graphics.extension"/>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/xsl/api/annotation.xsl b/xsl/api/annotation.xsl
new file mode 100644 (file)
index 0000000..7d471a5
--- /dev/null
@@ -0,0 +1,425 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+  <xsl:variable name="uppercase-letters" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
+  <xsl:variable name="lowercase-letters" select="'abcdefghijklmnopqrstuvwxyz'"/>
+
+  <xsl:key name="classes" match="class|struct|union|typedef" use="@name"/>
+  <xsl:key name="methods" match="method|overloaded-method" use="@name"/>
+  <xsl:key name="functions" match="function|overloaded-function" use="@name"/>
+  <xsl:key name="enums" match="enum" use="@name"/>
+  <xsl:key name="concepts" match="concept" use="@name"/>
+  <xsl:key name="libraries" match="library" use="@name"/>
+  <xsl:key name="macros" match="macro" use="@name"/>
+  <xsl:key name="headers" match="header" use="@name"/>
+  <xsl:key name="globals" match="namespace/data-member|header/data-member" use="@name"/>
+  <xsl:key name="named-entities" match="class|struct|union|concept|function|overloaded-function|macro|library|namespace/data-member|header/data-member|*[attribute::id]" use="translate(@name|@id, $uppercase-letters, $lowercase-letters)"/>
+
+  <xsl:template match="function|overloaded-function" mode="generate.id">
+    <xsl:call-template name="fully-qualified-id">
+      <xsl:with-param name="node" select="."/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="classname" mode="annotation">
+    <!-- Determine the (possibly qualified) class name we are looking for -->
+    <xsl:variable name="fullname">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="string(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Strip off any instantiation -->
+    <xsl:variable name="name">
+      <xsl:choose>
+        <xsl:when test="contains($fullname, '&lt;')">
+          <xsl:value-of select="substring-before($fullname, '&lt;')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$fullname"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Determine the unqualified name -->
+    <xsl:variable name="unqualified-name">
+      <xsl:call-template name="strip-qualifiers">
+        <xsl:with-param name="name" select="$name"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:call-template name="cxx-link-name">
+      <xsl:with-param name="lookup" select="."/>
+      <xsl:with-param name="type" select="'class'"/>
+      <xsl:with-param name="name" select="$name"/>
+      <xsl:with-param name="display-name" select="string(.)"/>
+      <xsl:with-param name="unqualified-name" select="$unqualified-name"/>
+      <xsl:with-param name="nodes" select="key('classes', $unqualified-name)"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="globalname" mode="annotation">
+    <!-- Determine the (possibly qualified) global name we are looking for -->
+    <xsl:variable name="name">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="string(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Determine the unqualified name -->
+    <xsl:variable name="unqualified-name">
+      <xsl:call-template name="strip-qualifiers">
+        <xsl:with-param name="name" select="$name"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:call-template name="cxx-link-name">
+      <xsl:with-param name="lookup" select="."/>
+      <xsl:with-param name="type" select="'data-member'"/>
+      <xsl:with-param name="name" select="$name"/>
+      <xsl:with-param name="display-name" select="string(.)"/>
+      <xsl:with-param name="unqualified-name" select="$unqualified-name"/>
+      <xsl:with-param name="nodes" select="key('globals', $unqualified-name)"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="methodname" mode="annotation">
+    <!-- Determine the (possibly qualified) method name we are looking for -->
+    <xsl:variable name="fullname">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="string(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Strip off any call -->
+    <xsl:variable name="name">
+      <xsl:choose>
+        <xsl:when test="contains($fullname, '(')">
+          <xsl:value-of select="substring-before($fullname, '(')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$fullname"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Determine the unqualified name -->
+    <xsl:variable name="unqualified-name">
+      <xsl:call-template name="strip-qualifiers">
+        <xsl:with-param name="name" select="$name"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:call-template name="cxx-link-name">
+      <xsl:with-param name="lookup" select="."/>
+      <xsl:with-param name="type" select="'method'"/>
+      <xsl:with-param name="name" select="$name"/>
+      <xsl:with-param name="display-name" select="string(.)"/>
+      <xsl:with-param name="unqualified-name" select="$unqualified-name"/>
+      <xsl:with-param name="nodes" select="key('methods', $unqualified-name)"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="functionname" mode="annotation">
+    <!-- Determine the (possibly qualified) function name we are
+         looking for -->
+    <xsl:variable name="fullname">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="string(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Strip off any call -->
+    <xsl:variable name="name">
+      <xsl:choose>
+        <xsl:when test="contains($fullname, '(')">
+          <xsl:value-of select="substring-before($fullname, '(')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$fullname"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Determine the unqualified name -->
+    <xsl:variable name="unqualified-name">
+      <xsl:call-template name="strip-qualifiers">
+        <xsl:with-param name="name" select="$name"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:call-template name="cxx-link-name">
+      <xsl:with-param name="lookup" select="."/>
+      <xsl:with-param name="type" select="'function'"/>
+      <xsl:with-param name="name" select="$name"/>
+      <xsl:with-param name="display-name" select="string(.)"/>
+      <xsl:with-param name="unqualified-name" select="$unqualified-name"/>
+      <xsl:with-param name="nodes"
+        select="key('functions', $unqualified-name)"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="enumname" mode="annotation">
+    <!-- Determine the (possibly qualified) enum name we are
+         looking for -->
+    <xsl:variable name="fullname">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="string(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Strip off any call -->
+    <xsl:variable name="name">
+      <xsl:choose>
+        <xsl:when test="contains($fullname, '(')">
+          <xsl:value-of select="substring-before($fullname, '(')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$fullname"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Determine the unqualified name -->
+    <xsl:variable name="unqualified-name">
+      <xsl:call-template name="strip-qualifiers">
+        <xsl:with-param name="name" select="$name"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:call-template name="cxx-link-name">
+      <xsl:with-param name="lookup" select="."/>
+      <xsl:with-param name="type" select="'enum'"/>
+      <xsl:with-param name="name" select="$name"/>
+      <xsl:with-param name="display-name" select="string(.)"/>
+      <xsl:with-param name="unqualified-name" select="$unqualified-name"/>
+      <xsl:with-param name="nodes"
+        select="key('enums', $unqualified-name)"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="libraryname" mode="annotation">
+    <xsl:variable name="name">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="text()"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="node" select="key('libraries', $name)"/>
+
+    <xsl:choose>
+      <xsl:when test="count($node)=0">
+        <xsl:message>
+          <xsl:text>warning: Cannot find library '</xsl:text>
+          <xsl:value-of select="$name"/>
+          <xsl:text>'</xsl:text>
+        </xsl:message>
+        <xsl:value-of select="$name"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="library.link">
+          <xsl:with-param name="node" select="$node"/>
+          <xsl:with-param name="name" select="text()"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="conceptname" mode="annotation">
+    <xsl:param name="name" select="text()"/>
+
+    <xsl:call-template name="concept.link">
+      <xsl:with-param name="name" select="$name"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="macroname" mode="annotation">
+    <xsl:param name="name">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="string(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:param>
+
+    <xsl:variable name="node" select="key('macros', $name)"/>
+    <xsl:choose>
+      <xsl:when test="count($node) = 0">
+        <xsl:message>
+          <xsl:text>warning: cannot find macro `</xsl:text>
+          <xsl:value-of select="$name"/>
+          <xsl:text>'</xsl:text>
+        </xsl:message>
+        <xsl:value-of select="$name"/>
+      </xsl:when>
+
+      <xsl:when test="count($node) = 1">
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to">
+            <xsl:call-template name="generate.id">
+              <xsl:with-param name="node" select="$node"/>
+            </xsl:call-template>
+          </xsl:with-param>
+          <xsl:with-param name="text" select="string(.)"/>
+        </xsl:call-template>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <xsl:message>
+          <xsl:text>error: macro `</xsl:text>
+          <xsl:value-of select="$name"/>
+          <xsl:text>' is multiply defined.</xsl:text>
+        </xsl:message>
+        <xsl:value-of select="$node"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="headername" mode="annotation">
+    <xsl:variable name="name">
+      <xsl:choose>
+        <xsl:when test="@alt">
+          <xsl:value-of select="@alt"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="string(.)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="node" select="key('headers', $name)"/>
+    <xsl:choose>
+      <xsl:when test="count($node) = 0">
+        <xsl:message>
+          <xsl:text>warning: cannot find header `</xsl:text>
+          <xsl:value-of select="$name"/>
+          <xsl:text>'</xsl:text>
+        </xsl:message>
+        <xsl:value-of select="$name"/>
+      </xsl:when>
+
+      <xsl:when test="count($node) = 1">
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to">
+            <xsl:call-template name="generate.id">
+              <xsl:with-param name="node" select="$node"/>
+            </xsl:call-template>
+          </xsl:with-param>
+          <xsl:with-param name="text" select="string(.)"/>
+        </xsl:call-template>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <xsl:message>
+          <xsl:text>error: header `</xsl:text>
+          <xsl:value-of select="$name"/>
+          <xsl:text>' is multiply defined.</xsl:text>
+        </xsl:message>
+        <xsl:value-of select="$node"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="text()" mode="annotation">
+    <xsl:param name="highlight" select="false()"/>
+    <xsl:choose>
+      <xsl:when test="$highlight">
+        <xsl:call-template name="source-highlight">
+          <xsl:with-param name="text" select="."/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:copy-of select="."/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="code" mode="annotation">
+    <computeroutput>
+      <xsl:apply-templates mode="annotation"/>
+    </computeroutput>
+  </xsl:template>
+
+  <xsl:template match="bold" mode="annotation">
+    <emphasis role="bold">
+      <xsl:apply-templates mode="annotation"/>
+    </emphasis>
+  </xsl:template>
+
+  <xsl:template match="description" mode="annotation">
+    <xsl:apply-templates mode="annotation"/>
+  </xsl:template>
+
+  <xsl:template match="comment()" mode="annotation">
+    <xsl:copy/>
+  </xsl:template>
+
+  <xsl:template match="node()" mode="annotation">
+    <xsl:param name="highlight" select="false()"/>
+
+    <xsl:element name="{name(.)}">
+      <xsl:for-each select="./@*">
+        <xsl:attribute name="{name(.)}">
+          <xsl:value-of select="."/>
+        </xsl:attribute>
+      </xsl:for-each>
+      <xsl:apply-templates select="./*|./text()" mode="annotation">
+        <xsl:with-param name="highlight" select="$highlight"/>
+      </xsl:apply-templates>
+    </xsl:element>
+  </xsl:template>
+
+  <!-- The "purpose" mode strips simpara/para elements so that we can
+       place the resulting text into a comment in the synopsis. -->
+  <xsl:template match="para|simpara" mode="purpose">
+    <xsl:apply-templates mode="annotation"/>
+  </xsl:template>
+
+  <xsl:template match="*" mode="purpose">
+    <xsl:apply-templates select="." mode="annotation"/>
+  </xsl:template>
+
+  <xsl:template match="text()" mode="purpose">
+    <xsl:apply-templates select="." mode="annotation"/>
+  </xsl:template>
+</xsl:stylesheet>
diff --git a/xsl/api/callout.xsl b/xsl/api/callout.xsl
new file mode 100644 (file)
index 0000000..be44b28
--- /dev/null
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2007 Joel de Guzman <djowel -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:d="http://docbook.org/ns/docbook"
+                               xmlns:exsl="http://exslt.org/common"
+                               exclude-result-prefixes="exsl d"
+                version="1.0">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/html/callout.xsl"/>
+
+<!-- Already included in the main style sheet -->
+<!-- <xsl:import href="relative-href.xsl"/> -->
+
+<xsl:template name="callout-bug">
+  <xsl:param name="conum" select='1'/>
+
+  <xsl:choose>
+    <xsl:when test="$callout.graphics != 0
+                    and $conum &lt;= $callout.graphics.number.limit">
+
+      <xsl:variable name="relative_callout_graphics_path">
+        <xsl:call-template name="href.target.relative">
+          <xsl:with-param name="target" select="$callout.graphics.path"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <img src="{$relative_callout_graphics_path}{$conum}{$callout.graphics.extension}"
+           alt="{$conum}" border="0"/>
+    </xsl:when>
+
+    <xsl:when test="$callout.unicode != 0
+                    and $conum &lt;= $callout.unicode.number.limit">
+      <xsl:choose>
+        <xsl:when test="$callout.unicode.start.character = 10102">
+          <xsl:choose>
+            <xsl:when test="$conum = 1">&#10102;</xsl:when>
+            <xsl:when test="$conum = 2">&#10103;</xsl:when>
+            <xsl:when test="$conum = 3">&#10104;</xsl:when>
+            <xsl:when test="$conum = 4">&#10105;</xsl:when>
+            <xsl:when test="$conum = 5">&#10106;</xsl:when>
+            <xsl:when test="$conum = 6">&#10107;</xsl:when>
+            <xsl:when test="$conum = 7">&#10108;</xsl:when>
+            <xsl:when test="$conum = 8">&#10109;</xsl:when>
+            <xsl:when test="$conum = 9">&#10110;</xsl:when>
+            <xsl:when test="$conum = 10">&#10111;</xsl:when>
+          </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>
+            <xsl:text>Don't know how to generate Unicode callouts </xsl:text>
+            <xsl:text>when $callout.unicode.start.character is </xsl:text>
+            <xsl:value-of select="$callout.unicode.start.character"/>
+          </xsl:message>
+          <xsl:text>(</xsl:text>
+          <xsl:value-of select="$conum"/>
+          <xsl:text>)</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text>(</xsl:text>
+      <xsl:value-of select="$conum"/>
+      <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/xsl/api/chunk-common.xsl b/xsl/api/chunk-common.xsl
new file mode 100644 (file)
index 0000000..b3c598e
--- /dev/null
@@ -0,0 +1,129 @@
+<?xml version="1.0"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:d="http://docbook.org/ns/docbook"
+                               xmlns:exsl="http://exslt.org/common"
+                               exclude-result-prefixes="exsl d"
+                version="1.0">
+
+<!-- Import the HTML chunking stylesheet -->
+  
+<!-- Watch out that we don't override chunk.xsl -->
+<!--
+<xsl:import
+    href="http://docbook.sourceforge.net/release/xsl/current/html/chunk-common.xsl"/> -->
+
+<!-- Already included in the main stylesheet -->
+<!-- <xsl:import href="relative-href.xsl"/> -->
+
+<!-- ==================================================================== -->
+
+<xsl:template match="*" mode="recursive-chunk-filename">
+    <xsl:param name="recursive" select="false()"/>
+
+    <xsl:variable name="their">
+        <xsl:apply-imports mode="recursive-chunk-filename" select="."/>
+    </xsl:variable>
+
+    <xsl:variable name="basename" select="substring-before( $their, $html.ext )"/>
+    <xsl:choose>
+        <xsl:when test="not($recursive)">
+            <!-- translate dots into directory separators, and replace illegal file path characters with underscores -->
+            <xsl:value-of select="translate($basename, '.&lt;&gt;\:*?&quot;|,()!+=&amp;', '/_______________' )"/>
+            <xsl:value-of select="$html.ext"/>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:value-of select="$basename"/>
+            <xsl:value-of select="'.'"/>
+        </xsl:otherwise>
+    </xsl:choose>
+
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="navig.content">
+    <xsl:param name="direction" select="next"/>
+    <xsl:variable name="navtext">
+        <xsl:choose>
+           <xsl:when test="$direction = 'prev'">
+               <xsl:call-template name="gentext.nav.prev"/>
+           </xsl:when>
+           <xsl:when test="$direction = 'next'">
+               <xsl:call-template name="gentext.nav.next"/>
+           </xsl:when>
+           <xsl:when test="$direction = 'up'">
+               <xsl:call-template name="gentext.nav.up"/>
+           </xsl:when>
+           <xsl:when test="$direction = 'home'">
+               <xsl:call-template name="gentext.nav.home"/>
+           </xsl:when>
+           <xsl:otherwise>
+               <xsl:text>xxx</xsl:text>
+           </xsl:otherwise>
+       </xsl:choose>
+    </xsl:variable>
+
+    <xsl:choose>
+    <xsl:when test="$navtext = 'xxx'">
+        <xsl:value-of select="$direction"/>
+    </xsl:when>
+       <xsl:when test="$navig.graphics != 0">
+           <img>
+               <xsl:attribute name="src">
+            <xsl:call-template name="href.target.relative">
+                <xsl:with-param name="target" select="$navig.graphics.path"/>
+            </xsl:call-template>
+                   <xsl:value-of select="$direction"/>
+                   <xsl:value-of select="$navig.graphics.extension"/>
+               </xsl:attribute>
+               <xsl:attribute name="alt">
+                   <xsl:value-of select="$navtext"/>
+               </xsl:attribute>
+           </img>
+       </xsl:when>
+       <xsl:otherwise>
+           <xsl:value-of select="$navtext"/>
+       </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+
+<!-- ====================================================================== -->
+
+<xsl:template match="@fileref">
+    <xsl:choose>
+        <xsl:when test="contains(., ':')">
+            <xsl:value-of select="."/>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:call-template name="href.target.relative">
+                <xsl:with-param name="target" select="."/>
+                <xsl:with-param name="context" select=".."/>
+            </xsl:call-template>
+        </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+
+<xsl:template match="@url">
+    <xsl:choose>
+        <xsl:when test="contains(., ':')">
+            <xsl:value-of select="."/>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:text>XXX</xsl:text>
+            <xsl:value-of select="."/>
+            <xsl:text>XXX</xsl:text>
+        </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+
+</xsl:stylesheet>
diff --git a/xsl/api/docbook-layout.xsl b/xsl/api/docbook-layout.xsl
new file mode 100644 (file)
index 0000000..c5b1172
--- /dev/null
@@ -0,0 +1,214 @@
+<?xml version = "1.0" encoding = "utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+  
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+
+<xsl:stylesheet version = "1.0"
+   xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
+                xmlns:d="http://docbook.org/ns/docbook"
+                               xmlns:exsl="http://exslt.org/common"
+                               exclude-result-prefixes="exsl d"
+>
+  <!-- needed for calsTable template -->
+  
+  <xsl:import
+    href="http://docbook.sourceforge.net/release/xsl-ns/current/html/formal.xsl"/>
+
+  <!--
+     Override the behaviour of some DocBook elements for better
+     integration with the new look & feel.
+  -->
+
+  <xsl:template match = "programlisting[ancestor::informaltable]">
+     <pre class = "table-{name(.)}"><xsl:apply-templates/></pre>
+  </xsl:template>
+
+  <xsl:template match = "refsynopsisdiv">
+     <h2 class = "{name(.)}-title">Synopsis</h2>
+     <div class = "{name(.)}"><xsl:apply-templates/></div>
+  </xsl:template>
+
+  <!-- table: remove border = '1' -->
+
+  <xsl:template match = "table|informaltable">
+     <xsl:choose>
+        <xsl:when test = "self::table and tgroup|mediaobject|graphic">
+           <xsl:apply-imports/>
+        </xsl:when><xsl:when test = "self::informaltable and tgroup|mediaobject|graphic">
+           <xsl:call-template name = "informal.object">
+              <xsl:with-param name = "class"><xsl:choose>
+                 <xsl:when test = "@tabstyle">
+                    <xsl:value-of select = "@tabstyle"/>
+                 </xsl:when><xsl:otherwise>
+                    <xsl:value-of select = "local-name(.)"/>
+                 </xsl:otherwise>
+              </xsl:choose></xsl:with-param>
+           </xsl:call-template>
+        </xsl:when><xsl:otherwise>
+           <table class = "table"><xsl:copy-of select = "@*[not(local-name(.)='border')]"/>
+              <xsl:call-template name = "htmlTable"/>
+           </table>
+        </xsl:otherwise>
+     </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match = "tgroup" name = "tgroup">
+     <xsl:variable name="summary"><xsl:call-template name="dbhtml-attribute">
+        <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
+        <xsl:with-param name="attribute" select="'table-summary'"/>
+     </xsl:call-template></xsl:variable>
+
+     <xsl:variable name="cellspacing"><xsl:call-template name="dbhtml-attribute">
+        <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
+        <xsl:with-param name="attribute" select="'cellspacing'"/>
+     </xsl:call-template></xsl:variable>
+
+     <xsl:variable name="cellpadding"><xsl:call-template name="dbhtml-attribute">
+        <xsl:with-param name="pis" select="processing-instruction('dbhtml')[1]"/>
+        <xsl:with-param name="attribute" select="'cellpadding'"/>
+     </xsl:call-template></xsl:variable>
+
+     <table class = "table">
+        <xsl:choose>
+           <xsl:when test="../textobject/phrase">
+              <xsl:attribute name="summary">
+                 <xsl:value-of select="../textobject/phrase"/>
+              </xsl:attribute>
+           </xsl:when><xsl:when test="$summary != ''">
+              <xsl:attribute name="summary">
+                 <xsl:value-of select="$summary"/>
+              </xsl:attribute>
+           </xsl:when><xsl:when test="../title">
+              <xsl:attribute name="summary">
+                 <xsl:value-of select="string(../title)"/>
+              </xsl:attribute>
+           </xsl:when>
+           <xsl:otherwise/>
+        </xsl:choose><xsl:if test="$cellspacing != '' or $html.cellspacing != ''">
+           <xsl:attribute name="cellspacing"><xsl:choose>
+              <xsl:when test="$cellspacing != ''"><xsl:value-of select="$cellspacing"/></xsl:when>
+              <xsl:otherwise><xsl:value-of select="$html.cellspacing"/></xsl:otherwise>
+           </xsl:choose></xsl:attribute>
+        </xsl:if><xsl:if test="$cellpadding != '' or $html.cellpadding != ''">
+           <xsl:attribute name="cellpadding"><xsl:choose>
+              <xsl:when test="$cellpadding != ''"><xsl:value-of select="$cellpadding"/></xsl:when>
+              <xsl:otherwise><xsl:value-of select="$html.cellpadding"/></xsl:otherwise>
+           </xsl:choose></xsl:attribute>
+        </xsl:if><xsl:if test="../@pgwide=1">
+           <xsl:attribute name="width">100%</xsl:attribute>
+        </xsl:if>
+
+        <xsl:variable name="colgroup">
+           <colgroup><xsl:call-template name="generate.colgroup">
+              <xsl:with-param name="cols" select="@cols"/>
+           </xsl:call-template></colgroup>
+        </xsl:variable>
+
+        <xsl:variable name="explicit.table.width"><xsl:call-template name="dbhtml-attribute">
+           <xsl:with-param name="pis" select="../processing-instruction('dbhtml')[1]"/>
+           <xsl:with-param name="attribute" select="'table-width'"/>
+        </xsl:call-template></xsl:variable>
+
+        <xsl:variable name="table.width"><xsl:choose>
+           <xsl:when test="$explicit.table.width != ''">
+              <xsl:value-of select="$explicit.table.width"/>
+           </xsl:when><xsl:when test="$default.table.width = ''">
+              <xsl:text>100%</xsl:text>
+           </xsl:when><xsl:otherwise>
+              <xsl:value-of select="$default.table.width"/>
+           </xsl:otherwise>
+        </xsl:choose></xsl:variable>
+
+        <xsl:if test="$default.table.width != '' or $explicit.table.width != ''">
+           <xsl:attribute name="width"><xsl:choose>
+              <xsl:when test="contains($table.width, '%')">
+                 <xsl:value-of select="$table.width"/>
+              </xsl:when><xsl:when test="$use.extensions != 0 and $tablecolumns.extension != 0">
+                 <xsl:choose>
+                    <xsl:when test="function-available('stbl:convertLength')">
+                       <xsl:value-of select="stbl:convertLength($table.width)"/>
+                    </xsl:when><xsl:when test="function-available('xtbl:convertLength')">
+                       <xsl:value-of select="xtbl:convertLength($table.width)"/>
+                    </xsl:when><xsl:otherwise>
+                       <xsl:message terminate="yes">
+                          <xsl:text>No convertLength function available.</xsl:text>
+                       </xsl:message>
+                    </xsl:otherwise>
+                 </xsl:choose>
+              </xsl:when><xsl:otherwise>
+                 <xsl:value-of select="$table.width"/>
+              </xsl:otherwise>
+           </xsl:choose></xsl:attribute>
+        </xsl:if>
+
+        <xsl:choose>
+           <xsl:when test="$use.extensions != 0 and $tablecolumns.extension != 0">
+              <xsl:choose>
+                 <xsl:when test="function-available('stbl:adjustColumnWidths')">
+                    <xsl:copy-of select="stbl:adjustColumnWidths($colgroup)"/>
+                 </xsl:when><xsl:when test="function-available('xtbl:adjustColumnWidths')">
+                    <xsl:copy-of select="xtbl:adjustColumnWidths($colgroup)"/>
+                 </xsl:when><xsl:when test="function-available('ptbl:adjustColumnWidths')">
+                    <xsl:copy-of select="ptbl:adjustColumnWidths($colgroup)"/>
+                 </xsl:when><xsl:otherwise>
+                    <xsl:message terminate="yes">
+                       <xsl:text>No adjustColumnWidths function available.</xsl:text>
+                    </xsl:message>
+                 </xsl:otherwise>
+              </xsl:choose>
+           </xsl:when><xsl:otherwise>
+              <xsl:copy-of select="$colgroup"/>
+           </xsl:otherwise>
+        </xsl:choose>
+
+        <xsl:apply-templates select="thead"/>
+        <xsl:apply-templates select="tfoot"/>
+        <xsl:apply-templates select="tbody"/>
+
+        <xsl:if test=".//footnote"><tbody class="footnotes">
+           <tr><td colspan="{@cols}">
+              <xsl:apply-templates select=".//footnote" mode="table.footnote.mode"/>
+           </td></tr>
+        </tbody></xsl:if>
+     </table>
+  </xsl:template>
+
+  <!-- table of contents 
+       
+    The standard Docbook template selects, amoung others,
+    the 'refentry' element for inclusion in TOC. In some
+    cases, this creates empty TOC. The most possible reason
+    is that there's 'refentry' element without 'refentrytitle',
+    but it's a mistery why it occurs. Even if we fix that
+    problem, we'll get non-empty TOC where no TOC is desired
+    (e.g. for section corresponding to each header file in
+    library doc). So, don't bother for now.
+  -->
+
+  <xsl:template name="section.toc">
+     <xsl:param name="toc-context" select="."/>
+     <xsl:param name="toc.title.p" select="true()"/>
+
+     <xsl:call-template name="make.toc">
+        <xsl:with-param name="toc-context" select="$toc-context"/>
+        <xsl:with-param name="toc.title.p" select="$toc.title.p"/>
+        <xsl:with-param name="nodes" select="
+           section|sect1|sect2|sect3|sect4|sect5|
+           bridgehead[$bridgehead.in.toc != 0]
+        "/>
+     </xsl:call-template>
+  </xsl:template>
+
+  <!-- When there is both a title and a caption for a table, only use the 
+       title. -->
+  <xsl:template match="table" mode="title.markup">
+    <xsl:param name="allow-anchors" select="0"/>
+    <xsl:apply-templates select="(title|caption)[1]" mode="title.markup">
+      <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+    </xsl:apply-templates>
+  </xsl:template>
+</xsl:stylesheet>
diff --git a/xsl/api/docbook.xsl b/xsl/api/docbook.xsl
new file mode 100644 (file)
index 0000000..706a7c4
--- /dev/null
@@ -0,0 +1,542 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:xi="http://www.w3.org/2001/XInclude"
+                version="1.0">
+  <xsl:include href="reference.xsl"/>
+
+  <xsl:output method="xml"
+    doctype-public="-//OASIS//DTD DocBook XML V4.2//EN"
+    doctype-system="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"/>
+
+  <!-- The maximum number of columns allowed in preformatted text -->
+  <xsl:param name="max-columns" select="78"/>
+
+  <!-- The root of the Boost directory -->
+  <xsl:param name="boost.root" select="'../..'"/>
+
+  <!-- A space-separated list of libraries to include in the
+       output. If this list is empty, all libraries will be included. -->
+  <xsl:param name="boost.include.libraries" select="''"/>
+
+  <!-- Whether to rewrite relative URL's to point to the website -->
+  <xsl:param name="boost.url.prefix"/>
+
+  <!-- A space-separated list of xml elements in the input file for which
+       whitespace should be preserved -->
+  <xsl:preserve-space elements="*"/>
+
+  <!-- The root for boost headers -->
+  <xsl:param name="boost.header.root">
+    <xsl:if test="$boost.url.prefix">
+      <xsl:value-of select="$boost.url.prefix"/>
+      <xsl:text>/</xsl:text>
+    </xsl:if>
+    <xsl:value-of select="$boost.root"/>
+  </xsl:param>
+
+  <!-- The prefix for 'boost:' links. -->
+  <xsl:variable name="boost.protocol.text">
+    <xsl:if test="($boost.url.prefix != '') and (contains($boost.root, '://') = 0)">
+      <xsl:value-of select="concat($boost.url.prefix, '/', $boost.root)"/>
+    </xsl:if>
+    <xsl:if test="($boost.url.prefix = '') or contains($boost.root, '://')">
+      <xsl:value-of select="$boost.root"/>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:template match="library-reference">
+    <xsl:choose>
+      <xsl:when test="ancestor::library-reference">
+        <xsl:apply-templates/>
+      </xsl:when>
+      <xsl:otherwise>
+        <section>
+          <xsl:choose>
+            <xsl:when test="@id">
+              <xsl:attribute name="id">
+                <xsl:value-of select="@id"/>
+              </xsl:attribute>
+            </xsl:when>
+            <xsl:when test="ancestor::library/attribute::id">
+              <xsl:attribute name="id">
+                <xsl:value-of select="ancestor::library/attribute::id"/>
+                <xsl:text>.reference</xsl:text>
+              </xsl:attribute>
+            </xsl:when>
+          </xsl:choose>
+          <xsl:if test="not(title)">
+            <title>
+              <xsl:text>Reference</xsl:text>
+            </title>
+          </xsl:if>
+
+          <xsl:if test="concept">
+            <section>
+              <xsl:choose>
+                <xsl:when test="@id">
+                  <xsl:attribute name="id">
+                    <xsl:value-of select="@id"/>
+                    <xsl:text>.concepts</xsl:text>
+                  </xsl:attribute>
+                </xsl:when>
+                <xsl:when test="ancestor::library/attribute::id">
+                  <xsl:attribute name="id">
+                    <xsl:value-of select="ancestor::library/attribute::id"/>
+                    <xsl:text>.concepts</xsl:text>
+                  </xsl:attribute>
+                </xsl:when>
+              </xsl:choose>
+
+              <title>Concepts</title>
+
+              <itemizedlist>
+                <xsl:for-each select="concept">
+                  <listitem>
+                    <xsl:call-template name="internal-link">
+                      <xsl:with-param name="to">
+                        <xsl:call-template name="generate.id"/>
+                      </xsl:with-param>
+                      <xsl:with-param name="text" select="@name"/>
+                    </xsl:call-template>
+                  </listitem>
+                </xsl:for-each>
+              </itemizedlist>
+            </section>
+          </xsl:if>
+
+          <xsl:apply-templates/>
+        </section>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="header">
+    <xsl:if test="*">
+      <section>
+        <xsl:attribute name="id">
+          <xsl:call-template name="generate.id"/>
+        </xsl:attribute>
+
+        <title>
+          <xsl:text>Header &lt;</xsl:text>
+          <ulink>
+            <xsl:attribute name="url">
+              <xsl:value-of select="$boost.header.root"/>
+              <xsl:text>/</xsl:text>
+              <xsl:value-of select="@name"/>
+            </xsl:attribute>
+            <xsl:value-of select="@name"/>
+          </ulink>
+          <xsl:text>&gt;</xsl:text>
+        </title>
+
+        <xsl:apply-templates select="para|section" mode="annotation"/>
+
+        <xsl:if test="macro">
+          <xsl:call-template name="synopsis">
+            <xsl:with-param name="text">
+              <xsl:apply-templates mode="synopsis" select="macro">
+                <xsl:with-param name="indentation" select="0"/>
+              </xsl:apply-templates>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+
+        <xsl:if test="descendant::class|descendant::struct|descendant::union
+                     |descendant::function|descendant::free-function-group
+                     |descendant::overloaded-function|descendant::enum
+                     |descendant::typedef">
+          <xsl:call-template name="synopsis">
+            <xsl:with-param name="text">
+              <xsl:apply-templates mode="synopsis"
+                select="namespace|class|struct|union
+                       |function|free-function-group
+                       |overloaded-function|enum
+                       |typedef">
+                <xsl:with-param name="indentation" select="0"/>
+              </xsl:apply-templates>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+
+        <xsl:apply-templates mode="namespace-reference"/>
+      </section>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="header" mode="generate.id">
+    <xsl:text>header.</xsl:text>
+    <xsl:value-of select="translate(@name, '/.', '._')"/>
+  </xsl:template>
+
+  <xsl:template match="*" mode="passthrough">
+    <xsl:copy-of select="."/>
+  </xsl:template>
+
+  <!-- Syntax highlighting -->
+  <xsl:template name="highlight-keyword">
+    <xsl:param name="keyword"/>
+    <xsl:choose>
+      <xsl:when test="$boost.syntax.highlight='1'">
+        <emphasis role="bold"><xsl:value-of select="$keyword"/></emphasis>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$keyword"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="highlight-comment">
+    <xsl:param name="text"/>
+    <emphasis><xsl:copy-of select="$text"/></emphasis>
+  </xsl:template>
+
+  <xsl:template name="monospaced">
+    <xsl:param name="text"/>
+    <computeroutput><xsl:value-of select="$text"/></computeroutput>
+  </xsl:template>
+
+  <!-- Linking -->
+  <xsl:template match="ulink">
+    <xsl:copy>
+      <xsl:copy-of select="@*"/>
+      <xsl:attribute name="url">
+        <xsl:choose>
+          <xsl:when test="starts-with(@url, 'boost:/')">
+            <xsl:value-of select="concat($boost.protocol.text, substring-after(@url, 'boost:'))"/>
+          </xsl:when>
+          <xsl:when test="starts-with(@url, 'boost:')">
+            <xsl:value-of select="concat($boost.protocol.text, '/', substring-after(@url, 'boost:'))"/>
+          </xsl:when>
+          <xsl:when test="$boost.url.prefix != '' and not(contains(@url, ':') or starts-with(@url, '//'))">
+            <xsl:value-of select="concat($boost.url.prefix, '/', @url)"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="@url"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+  <xsl:template name="internal-link">
+    <xsl:param name="to"/>
+    <xsl:param name="text"/>
+    <xsl:param name="highlight" select="false()"/>
+
+    <link linkend="{$to}">
+      <xsl:if test="$highlight">
+        <xsl:call-template name="source-highlight">
+          <xsl:with-param name="text" select="$text"/>
+        </xsl:call-template>
+      </xsl:if>
+      <xsl:if test="not($highlight)">
+        <xsl:value-of select="string($text)"/>
+      </xsl:if>
+    </link>
+  </xsl:template>
+
+  <xsl:template name="anchor">
+    <xsl:param name="to"/>
+    <xsl:param name="text"/>
+    <xsl:param name="highlight" select="false()"/>
+
+    <anchor id="{$to}"/>
+    <xsl:if test="$highlight">
+      <xsl:call-template name="source-highlight">
+        <xsl:with-param name="text" select="$text"/>
+      </xsl:call-template>
+    </xsl:if>
+    <xsl:if test="not($highlight)">
+      <xsl:value-of select="$text"/>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="link-or-anchor">
+    <xsl:param name="to"/>
+    <xsl:param name="text"/>
+
+    <!-- True if we should create an anchor, otherwise we will create
+         a link. If you require more control (e.g., with the possibility of
+         having no link or anchor), set link-type instead: if present, it
+         takes precedence. -->
+    <xsl:param name="is-anchor"/>
+
+    <!-- 'anchor', 'link', or 'none' -->
+    <xsl:param name="link-type">
+      <xsl:choose>
+        <xsl:when test="$is-anchor">
+          <xsl:text>anchor</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>link</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:param>
+
+    <xsl:param name="highlight" select="false()"/>
+
+    <xsl:choose>
+      <xsl:when test="$link-type='anchor'">
+        <xsl:call-template name="anchor">
+          <xsl:with-param name="to" select="$to"/>
+          <xsl:with-param name="text" select="$text"/>
+          <xsl:with-param name="highlight" select="$highlight"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="$link-type='link'">
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to" select="$to"/>
+          <xsl:with-param name="text" select="$text"/>
+          <xsl:with-param name="highlight" select="$highlight"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="$link-type='none'">
+        <xsl:if test="$highlight">
+          <xsl:call-template name="source-highlight">
+            <xsl:with-param name="text" select="$text"/>
+          </xsl:call-template>
+        </xsl:if>
+        <xsl:if test="not($highlight)">
+          <xsl:value-of select="$text"/>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:message>
+Error: XSL template 'link-or-anchor' called with invalid link-type '<xsl:value-of select="$link-type"/>'
+        </xsl:message>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="separator"/>
+
+  <xsl:template name="reference-documentation">
+    <xsl:param name="name"/>
+    <xsl:param name="refname"/>
+    <xsl:param name="purpose"/>
+    <xsl:param name="anchor"/>
+    <xsl:param name="synopsis"/>
+    <xsl:param name="text"/>
+
+    <refentry id="{$anchor}">
+      <refmeta>
+        <refentrytitle><xsl:value-of select="$name"/></refentrytitle>
+        <manvolnum>3</manvolnum>
+      </refmeta>
+      <refnamediv>
+        <refname><xsl:value-of select="$refname"/></refname>
+        <refpurpose>
+                 <xsl:apply-templates mode="purpose" select="$purpose"/>
+               </refpurpose>
+      </refnamediv>
+      <refsynopsisdiv>
+        <synopsis>
+          <xsl:copy-of select="$synopsis"/>
+        </synopsis>
+      </refsynopsisdiv>
+      <xsl:if test="not(string($text)='')">
+        <refsect1>
+          <title>Description</title>
+          <xsl:copy-of select="$text"/>
+        </refsect1>
+      </xsl:if>
+    </refentry>
+  </xsl:template>
+
+  <xsl:template name="member-documentation">
+    <xsl:param name="name"/>
+    <xsl:param name="text"/>
+
+    <refsect2>
+      <title><xsl:copy-of select="$name"/></title>
+      <xsl:copy-of select="$text"/>
+    </refsect2>
+  </xsl:template>
+
+  <xsl:template name="preformatted">
+    <xsl:param name="text"/>
+
+    <literallayout class="monospaced">
+      <xsl:copy-of select="$text"/>
+    </literallayout>
+  </xsl:template>
+
+  <xsl:template name="synopsis">
+    <xsl:param name="text"/>
+
+    <synopsis>
+      <xsl:copy-of select="$text"/>
+    </synopsis>
+  </xsl:template>
+
+  <!-- Fallthrough for DocBook elements -->
+  <xsl:template match="*">
+    <xsl:element name="{name(.)}">
+      <xsl:for-each select="./@*">
+        <xsl:choose>
+          <xsl:when test="local-name(.)='last-revision'">
+            <xsl:attribute
+              name="rev:last-revision"
+              namespace="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision">
+              <xsl:value-of select="."/>
+            </xsl:attribute>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:attribute name="{name(.)}">
+              <xsl:value-of select="."/>
+            </xsl:attribute>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:for-each>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+
+  <xsl:template match="code">
+    <computeroutput>
+      <xsl:apply-templates mode="annotation"/>
+    </computeroutput>
+  </xsl:template>
+
+  <xsl:template match="bold">
+    <emphasis role="bold">
+      <xsl:apply-templates mode="annotation"/>
+    </emphasis>
+  </xsl:template>
+
+  <xsl:template match="library">
+    <xsl:if test="not(@html-only = 1) and
+                  ($boost.include.libraries='' or
+                   contains($boost.include.libraries, @id))">
+      <chapter>
+        <xsl:attribute name="id">
+          <xsl:choose>
+            <xsl:when test="@id">
+              <xsl:value-of select="@id"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:call-template name="generate.id"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:attribute>
+
+        <xsl:if test="@last-revision">
+          <xsl:attribute
+            name="rev:last-revision"
+            namespace="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision">
+            <xsl:value-of select="@last-revision"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates/>
+      </chapter>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="chapter">
+    <xsl:if test="$boost.include.libraries=''">
+      <chapter>
+        <xsl:for-each select="./@*">
+          <xsl:attribute name="{name(.)}">
+            <xsl:value-of select="."/>
+          </xsl:attribute>
+        </xsl:for-each>
+
+        <xsl:apply-templates/>
+      </chapter>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="boostbook">
+    <book><xsl:apply-templates/></book>
+  </xsl:template>
+
+  <xsl:template match="programlisting">
+    <programlisting><xsl:apply-templates/></programlisting>
+  </xsl:template>
+
+  <!-- These DocBook elements have special meaning. Use the annotation mode -->
+  <xsl:template match="classname|methodname|functionname|enumname|
+                       macroname|headername|globalname">
+    <computeroutput>
+      <xsl:apply-templates select="." mode="annotation"/>
+    </computeroutput>
+  </xsl:template>
+
+  <xsl:template match="libraryname|conceptname">
+    <xsl:apply-templates select="." mode="annotation"/>
+  </xsl:template>
+
+  <xsl:template match="description">
+    <xsl:apply-templates mode="annotation"/>
+  </xsl:template>
+
+  <!-- Swallow using-namespace and using-class directives along with
+       last-revised elements -->
+  <xsl:template match="using-namespace|using-class|last-revised"/>
+
+  <!-- If there is no "namespace-reference" mode, forward to
+       "reference" mode -->
+  <xsl:template match="*" mode="namespace-reference">
+    <xsl:apply-templates select="." mode="reference"/>
+  </xsl:template>
+
+  <!-- Make the various blocks immediately below a "part" be
+       "chapter"-s. Must also take into account turning
+       chapters within chpaters into sections. -->
+  <xsl:template match="part/part|part/article">
+    <chapter>
+      <xsl:for-each select="./@*">
+        <xsl:attribute name="{name(.)}">
+          <xsl:value-of select="."/>
+        </xsl:attribute>
+      </xsl:for-each>
+      <xsl:apply-templates/>
+    </chapter>
+  </xsl:template>
+  <xsl:template match="part/part/partinfo|part/article/articleinfo">
+    <chapterinfo><xsl:apply-templates/></chapterinfo>
+  </xsl:template>
+  <xsl:template match="part/part/chapter|part/part/appendix">
+    <section>
+      <xsl:for-each select="./@*">
+        <xsl:attribute name="{name(.)}">
+          <xsl:value-of select="."/>
+        </xsl:attribute>
+      </xsl:for-each>
+      <xsl:apply-templates/>
+    </section>
+  </xsl:template>
+  <xsl:template match="part/part/chapter/chapterinfo|part/part/appendix/appendixinfo">
+    <sectioninfo><xsl:apply-templates/></sectioninfo>
+  </xsl:template>
+
+  <!-- Header link comment to be inserted at the start of a reference page's
+       synopsis -->
+  <xsl:template name="header-link">
+    <xsl:if test="ancestor::header">
+      <xsl:call-template name="highlight-comment">
+        <xsl:with-param name="text">
+          <xsl:text>// In header: &lt;</xsl:text>
+          <xsl:call-template name="internal-link">
+            <xsl:with-param name="to">
+              <xsl:call-template name="generate.id">
+                <xsl:with-param name="node" select="ancestor::header[1]"/>
+              </xsl:call-template>
+            </xsl:with-param>
+            <xsl:with-param name="text" select="ancestor::header[1]/@name" />
+          </xsl:call-template>
+          <xsl:text>&gt;&#10;&#10;</xsl:text>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+</xsl:stylesheet>
+
diff --git a/xsl/api/error.xsl b/xsl/api/error.xsl
new file mode 100644 (file)
index 0000000..a1c1601
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+  
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+  <xsl:template name="print.warning.context">
+    <xsl:message>
+      <xsl:text>  In </xsl:text>
+      <xsl:call-template name="fully-qualified-name">
+        <xsl:with-param name="node" select="."/>
+      </xsl:call-template>
+    </xsl:message>
+  </xsl:template>
+</xsl:stylesheet>
diff --git a/xsl/api/fo.xsl b/xsl/api/fo.xsl
new file mode 100644 (file)
index 0000000..423b6d0
--- /dev/null
@@ -0,0 +1,278 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2003 Douglas Gregor -->
+<!-- Distributed under the Boost Software License, Version 1.0. -->
+<!-- (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version="1.0">
+
+  <!-- Import the FO stylesheet -->
+  <xsl:import 
+    href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
+
+  <xsl:param name="chapter.autolabel" select="0"/>
+  <xsl:param name="refentry.generate.name" select="0"/>
+  <xsl:param name="refentry.generate.title" select="1"/>
+  <xsl:param name="fop1.extensions" select="1"/>
+  <xsl:param name="make.year.ranges" select="1"/>
+  <xsl:param name="ulink.show" select="0"/>
+
+  <!-- The question and answer templates are copied here from the
+       1.61.3 DocBook XSL stylesheets so that we can eliminate the emission
+       of id attributes in the emitted fo:list-item-label elements. FOP
+       0.20.5 has problems with these id attributes, and they are otherwise
+       unused. -->
+<xsl:template match="question">
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+
+  <xsl:variable name="entry.id">
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="parent::*"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="deflabel">
+    <xsl:choose>
+      <xsl:when test="ancestor-or-self::*[@defaultlabel]">
+        <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]
+                              /@defaultlabel"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$qanda.defaultlabel"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <fo:list-item id="{$entry.id}" xsl:use-attribute-sets="list.item.spacing">
+    <fo:list-item-label end-indent="label-end()">
+      <xsl:choose>
+        <xsl:when test="$deflabel = 'none'">
+          <fo:block/>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:block>
+            <xsl:apply-templates select="." mode="label.markup"/>
+            <xsl:text>.</xsl:text> <!-- FIXME: Hack!!! This should be in the locale! -->
+          </fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
+    </fo:list-item-label>
+    <fo:list-item-body start-indent="body-start()">
+      <xsl:choose>
+        <xsl:when test="$deflabel = 'none'">
+          <fo:block font-weight="bold">
+            <xsl:apply-templates select="*[local-name(.)!='label']"/>
+          </fo:block>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="*[local-name(.)!='label']"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </fo:list-item-body>
+  </fo:list-item>
+</xsl:template>
+
+<xsl:template match="answer">
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+  <xsl:variable name="entry.id">
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="parent::*"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="deflabel">
+    <xsl:choose>
+      <xsl:when test="ancestor-or-self::*[@defaultlabel]">
+        <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]
+                              /@defaultlabel"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$qanda.defaultlabel"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <fo:list-item xsl:use-attribute-sets="list.item.spacing">
+    <fo:list-item-label end-indent="label-end()">
+      <xsl:choose>
+        <xsl:when test="$deflabel = 'none'">
+          <fo:block/>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:block>
+            <!-- FIXME: Hack!!! This should be in the locale! -->
+            <xsl:variable name="answer.label">
+              <xsl:apply-templates select="." mode="label.markup"/>
+            </xsl:variable>
+            <xsl:copy-of select="$answer.label"/>
+            <xsl:if test="string($answer.label) != ''">
+              <xsl:text>.</xsl:text>
+            </xsl:if>
+          </fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
+    </fo:list-item-label>
+    <fo:list-item-body start-indent="body-start()">
+      <xsl:apply-templates select="*[local-name(.)!='label']"/>
+    </fo:list-item-body>
+  </fo:list-item>
+</xsl:template>
+
+<!-- 
+
+ The following rules apply syntax highlighting to phrases
+ that have been appropriately marked up, the highlighting
+ used is the same as that used by our CSS style sheets,
+ but potentially we have the option to do better here
+ since we can add bold and italic formatting quite easily
+ -->
+
+<xsl:template match="//programlisting/phrase[@role='keyword']">
+  <fo:inline color="#0000AA"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='special']">
+  <fo:inline color="#707070"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='preprocessor']">
+  <fo:inline color="#402080"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='char']">
+  <fo:inline color="teal"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='comment']">
+  <fo:inline color="#800000"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='string']">
+  <fo:inline color="teal"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='number']">
+  <fo:inline color="teal"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='white_bkd']">
+  <fo:inline color="#FFFFFF"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+<xsl:template match="//programlisting/phrase[@role='dk_grey_bkd']">
+  <fo:inline color="#999999"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+
+<!--
+Make all hyperlinks blue colored:
+-->
+<xsl:attribute-set name="xref.properties">
+  <xsl:attribute name="color">blue</xsl:attribute>
+</xsl:attribute-set>
+
+<!--
+Put a box around admonishments and keep them together:
+-->
+<xsl:attribute-set name="graphical.admonition.properties">
+  <xsl:attribute name="border-color">#FF8080</xsl:attribute>
+  <xsl:attribute name="border-width">1px</xsl:attribute>
+  <xsl:attribute name="border-style">solid</xsl:attribute>
+  <xsl:attribute name="padding-left">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-right">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-top">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-bottom">0.2cm</xsl:attribute>
+  <xsl:attribute name="keep-together.within-page">1</xsl:attribute>
+  <xsl:attribute name="margin-left">0pt</xsl:attribute>
+  <xsl:attribute name="margin-right">0pt</xsl:attribute>
+</xsl:attribute-set>
+
+<!--
+Put a box around code blocks, also set the font size
+and keep the block together if we can using the widows 
+and orphans controls.  Hyphenation and line wrapping
+is also turned on, so that long lines of code don't
+bleed off the edge of the page, a carriage return
+symbol is used as the hyphenation character:
+-->
+<xsl:attribute-set name="monospace.verbatim.properties">
+  <xsl:attribute name="border-color">#DCDCDC</xsl:attribute>
+  <xsl:attribute name="border-width">1px</xsl:attribute>
+  <xsl:attribute name="border-style">solid</xsl:attribute>
+  <xsl:attribute name="padding-left">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-right">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-top">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-bottom">0.2cm</xsl:attribute>
+  <xsl:attribute name="widows">6</xsl:attribute>
+  <xsl:attribute name="orphans">40</xsl:attribute>
+  <xsl:attribute name="font-size">9pt</xsl:attribute>
+  <xsl:attribute name="hyphenate">true</xsl:attribute>
+  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
+  <xsl:attribute name="hyphenation-character">&#x21B5;</xsl:attribute>
+  <xsl:attribute name="margin-left">0pt</xsl:attribute>
+  <xsl:attribute name="margin-right">0pt</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:param name="hyphenate.verbatim" select="1"></xsl:param>
+<xsl:param name="monospace.font.family">monospace,Symbol</xsl:param>
+
+  <!--Regular monospace text should have the same font size as code blocks etc-->
+<xsl:attribute-set name="monospace.properties">
+  <xsl:attribute name="font-size">9pt</xsl:attribute>
+</xsl:attribute-set>
+  
+<!-- 
+Put some small amount of padding around table cells, and keep tables
+together on one page if possible:
+-->
+<xsl:attribute-set name="table.cell.padding">
+  <xsl:attribute name="padding-left">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-right">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-top">0.2cm</xsl:attribute>
+  <xsl:attribute name="padding-bottom">0.2cm</xsl:attribute>
+</xsl:attribute-set>
+
+  <!--Formal and informal tables have the same properties
+      Using widow-and-orphan control here gives much better
+      results for very large tables than a simple "keep-together"
+      instruction-->
+<xsl:attribute-set name="table.properties">
+  <xsl:attribute name="keep-together.within-page">1</xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="informaltable.properties">
+  <xsl:attribute name="keep-together.within-page">1</xsl:attribute>
+</xsl:attribute-set>
+
+<!--
+General default options go here:
+* Borders are mid-grey.
+* Body text is not indented compared to the titles.
+* Page margins are a rather small 0.5in, but we need
+  all the space we can get for code blocks.
+* Paper size is A4: an ISO standard, and just slightly smaller than US Letter.
+* Use SVG graphics for admonishments: the bitmaps look awful in PDF's.
+* Disable draft mode so we're not constantly trying to download the necessary graphic.
+* Set default image paths to pull down direct from SVN: individual Jamfiles can override this
+  and pass an absolute path to local versions of the images, but we can't get that here, so
+  we'll use SVN instead so that most things "just work".
+-->
+<xsl:param name="table.frame.border.color">#DCDCDC</xsl:param>
+<xsl:param name="table.cell.border.color">#DCDCDC</xsl:param>
+<xsl:param name="body.start.indent">0pt</xsl:param>
+<xsl:param name="page.margin.inner">0.5in</xsl:param>
+<xsl:param name="page.margin.outer">0.5in</xsl:param>
+<xsl:param name="paper.type">A4</xsl:param>
+<xsl:param name="admon.graphics">1</xsl:param>
+<xsl:param name="admon.graphics.extension">.svg</xsl:param>
+<xsl:param name="draft.mode">no</xsl:param>
+<xsl:param name="admon.graphics.path">http://svn.boost.org/svn/boost/trunk/doc/src/images/</xsl:param>
+<xsl:param name="callout.graphics.path">http://svn.boost.org/svn/boost/trunk/doc/src/images/callouts/</xsl:param>
+<xsl:param name="img.src.path">http://svn.boost.org/svn/boost/trunk/doc/html/</xsl:param>
+
+<!-- Ideally we would use this to force top level sections
+     to start on a new page, unfortunately this causes rather
+     unfortunate page breaks in some Doxygen-generated
+     documentation which uses <refentry> and <synopsis>
+     sections :-(
+
+<xsl:attribute-set name="section.level1.properties">
+  <xsl:attribute name="break-before">page</xsl:attribute>
+</xsl:attribute-set>
+
+-->
+  
+</xsl:stylesheet>
+
diff --git a/xsl/api/function.xsl b/xsl/api/function.xsl
new file mode 100644 (file)
index 0000000..61619f7
--- /dev/null
@@ -0,0 +1,1129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+
+  <xsl:strip-space elements="requires effects postconditions returns throws
+                             complexity notes rationale purpose"/>
+
+  <!-- When true, the stylesheet will emit compact definitions of
+       functions when the function does not have any detailed
+       description. -->
+  <xsl:param name="boost.compact.function">1</xsl:param>
+
+  <!-- The longest type length that is considered "short" for the
+       layout of function return types. When the length of the result type
+       and any storage specifiers is greater than this length, they will be
+       placed on a separate line from the function name and parameters
+       unless everything fits on a single line. -->
+  <xsl:param name="boost.short.result.type">12</xsl:param>
+
+  <!-- Display a function declaration -->
+  <xsl:template name="function">
+    <xsl:param name="indentation"/>
+    <xsl:param name="is-reference"/>
+
+    <!-- Whether or not we should include parameter names in the output -->
+    <xsl:param name="include-names" select="$is-reference"/>
+
+    <!-- What type of link the function name should have. This shall
+         be one of 'anchor' (the function output will be the target of
+         links), 'link' (the function output will link to a definition), or
+         'none' (the function output will not be either a link or a link
+         target) -->
+    <xsl:param name="link-type">
+      <xsl:choose>
+        <xsl:when test="$is-reference">
+          <xsl:text>anchor</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>link</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:param>
+
+    <!-- The id we should link to or anchor as -->
+    <xsl:param name="link-to">
+      <xsl:call-template name="generate.id"/>
+    </xsl:param>
+
+    <!-- If we are printing a constructor -->
+    <xsl:param name="constructor-for"/>
+
+    <!-- If we are printing a destructor -->
+    <xsl:param name="destructor-for"/>
+
+    <!-- If we are printing a copy assignment operator -->
+    <xsl:param name="copy-assign-for"/>
+
+    <!-- The name of this function -->
+    <xsl:param name="name" select="@name"/>
+
+    <!-- True if this is the function's separate documentation -->
+    <xsl:param name="standalone" select="false()"/>
+
+    <!-- True if we should suppress the template header -->
+    <xsl:param name="suppress-template" select="false()"/>
+
+    <!-- Calculate the specifiers -->
+    <xsl:variable name="specifiers">
+      <xsl:if test="@specifiers">
+        <xsl:value-of select="concat(@specifiers, ' ')"/>
+      </xsl:if>
+    </xsl:variable>
+
+    <!-- Calculate the type -->
+    <xsl:variable name="type">
+      <xsl:value-of select="$specifiers"/>
+
+      <xsl:choose>
+        <!-- Conversion operators have an empty type, because the return
+             type is part of the name -->
+        <xsl:when test="$name='conversion-operator'"/>
+
+        <!-- Constructors and destructors have no return type -->
+        <xsl:when test="$constructor-for or $destructor-for"/>
+
+        <!-- Copy assignment operators return a reference to the class
+             they are in, unless another type has been explicitly
+             provided in the element. -->
+        <xsl:when test="$copy-assign-for and not(type)">
+          <xsl:value-of select="concat($copy-assign-for, '&amp; ')"/>
+        </xsl:when>
+
+        <xsl:otherwise>
+          <xsl:apply-templates select="type" mode="annotation"/>
+          <xsl:text> </xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Build the function name with return type -->
+    <xsl:variable name="function-name">
+      <xsl:choose>
+        <xsl:when test="$constructor-for">
+          <xsl:value-of select="$constructor-for"/>
+        </xsl:when>
+        <xsl:when test="$destructor-for">
+          <xsl:value-of select="concat('~',$destructor-for)"/>
+        </xsl:when>
+        <xsl:when test="$copy-assign-for">
+          <xsl:value-of select="'operator='"/>
+        </xsl:when>
+        <xsl:when test="$name='conversion-operator'">
+          <xsl:text>operator </xsl:text>
+          <xsl:apply-templates select="type" mode="annotation"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$name"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:if test="not ($standalone) or
+                  (local-name(.)='signature' and (position() &gt; 1))
+                  or $suppress-template">
+      <xsl:text>&#10;</xsl:text>
+    </xsl:if>
+
+    <!-- Indent this declaration -->
+    <xsl:call-template name="indent">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:call-template>
+
+    <!-- Build the template header -->
+    <xsl:variable name="template-length">
+      <xsl:choose>
+        <xsl:when test="$suppress-template">
+          0
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="template.synopsis.length"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <!-- Build a full parameter string (without line breaks) -->
+    <xsl:variable name="param-string">
+      <xsl:text>(</xsl:text>
+      <xsl:call-template name="function-parameters">
+        <xsl:with-param name="include-names" select="$include-names"/>
+        <xsl:with-param name="wrap" select="false()"/>
+      </xsl:call-template>
+      <xsl:text>)</xsl:text>
+    </xsl:variable>
+
+    <!-- Build the text that follows the declarator-->
+    <xsl:variable name="postdeclarator">
+      <xsl:if test="@cv">
+        <xsl:text> </xsl:text>
+        <xsl:value-of select="@cv"/>
+      </xsl:if>
+    </xsl:variable>
+
+    <!-- Build the full declaration text -->
+    <xsl:variable name="decl-string"
+      select="concat($type, $function-name, $param-string, $postdeclarator)"/>
+    <xsl:variable name="end-column"
+      select="$template-length + string-length($decl-string) + $indentation"/>
+
+    <xsl:choose>
+      <!-- Check if we should put the template header on its own line to
+           save horizontal space. -->
+      <xsl:when test="($template-length &gt; 0) and
+                      ($end-column &gt; $max-columns)">
+        <!-- Emit template header on its own line -->
+        <xsl:apply-templates select="template" mode="synopsis">
+          <xsl:with-param name="indentation" select="$indentation"/>
+        </xsl:apply-templates>
+
+        <!-- Emit the rest of the function declaration (without the
+             template header) indented two extra spaces. -->
+        <xsl:call-template name="function">
+          <xsl:with-param name="indentation" select="$indentation + 2"/>
+          <xsl:with-param name="is-reference" select="$is-reference"/>
+          <xsl:with-param name="include-names" select="$include-names"/>
+          <xsl:with-param name="link-type" select="$link-type"/>
+          <xsl:with-param name="link-to" select="$link-to"/>
+          <xsl:with-param name="constructor-for" select="$constructor-for"/>
+          <xsl:with-param name="destructor-for" select="$destructor-for"/>
+          <xsl:with-param name="copy-assign-for" select="$copy-assign-for"/>
+          <xsl:with-param name="name" select="$name"/>
+          <xsl:with-param name="standalone" select="$standalone"/>
+          <xsl:with-param name="suppress-template" select="true()"/>
+        </xsl:call-template>
+      </xsl:when>
+
+      <!-- Check if we can put the entire declaration on a single
+           line. -->
+      <xsl:when test="not($end-column &gt; $max-columns)">
+        <!-- Emit template header, if not suppressed -->
+        <xsl:if test="not($suppress-template)">
+          <xsl:apply-templates select="template" mode="synopsis">
+            <xsl:with-param name="indentation" select="$indentation"/>
+            <xsl:with-param name="wrap" select="false()"/>
+            <xsl:with-param name="highlight" select="true()"/>
+          </xsl:apply-templates>
+        </xsl:if>
+
+        <!-- Emit specifiers -->
+        <xsl:call-template name="source-highlight">
+          <xsl:with-param name="text" select="$specifiers"/>
+        </xsl:call-template>
+
+        <!-- Emit type, if any -->
+        <xsl:choose>
+          <!-- Conversion operators have an empty type, because the return
+               type is part of the name -->
+          <xsl:when test="$name='conversion-operator'"/>
+
+          <!-- Constructors and destructors have no return type -->
+          <xsl:when test="$constructor-for or $destructor-for"/>
+
+          <!-- Copy assignment operators return a reference to the class
+               they are in, unless another type has been explicitly
+               provided in the element. -->
+          <xsl:when test="$copy-assign-for and not(type)">
+            <xsl:value-of select="concat($copy-assign-for, '&amp; ')"/>
+          </xsl:when>
+
+          <xsl:otherwise>
+            <xsl:apply-templates select="type" mode="highlight"/>
+            <xsl:text> </xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+
+        <xsl:call-template name="link-or-anchor">
+          <xsl:with-param name="to" select="$link-to"/>
+          <xsl:with-param name="text" select="$function-name"/>
+          <xsl:with-param name="link-type" select="$link-type"/>
+          <xsl:with-param name="highlight" select="true()"/>
+        </xsl:call-template>
+
+        <xsl:text>(</xsl:text>
+        <xsl:call-template name="function-parameters">
+          <xsl:with-param name="include-names" select="$include-names"/>
+          <xsl:with-param name="indentation"
+            select="$indentation + $template-length + string-length($type)
+                    + string-length($function-name) + 1"/>
+          <xsl:with-param name="final" select="true()"/>
+        </xsl:call-template>
+        <xsl:text>)</xsl:text>
+
+        <xsl:call-template name="source-highlight">
+          <xsl:with-param name="text" select="$postdeclarator"/>
+        </xsl:call-template>
+        <xsl:text>;</xsl:text>
+      </xsl:when>
+
+      <!-- This declaration will take multiple lines -->
+      <xsl:otherwise>
+        <!-- Emit specifiers -->
+        <xsl:call-template name="source-highlight">
+          <xsl:with-param name="text" select="$specifiers"/>
+        </xsl:call-template>
+
+        <!-- Emit type, if any -->
+        <xsl:choose>
+          <!-- Conversion operators have an empty type, because the return
+               type is part of the name -->
+          <xsl:when test="$name='conversion-operator'"/>
+
+          <!-- Constructors and destructors have no return type -->
+          <xsl:when test="$constructor-for or $destructor-for"/>
+
+          <!-- Copy assignment operators return a reference to the class
+               they are in, unless another type has been explicitly
+               provided in the element. -->
+          <xsl:when test="$copy-assign-for and not(type)">
+            <xsl:value-of select="concat($copy-assign-for, '&amp; ')"/>
+          </xsl:when>
+
+          <xsl:otherwise>
+            <xsl:apply-templates select="type" mode="highlight"/>
+            <xsl:text> </xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+
+        <xsl:if test="string-length($type) &gt; $boost.short.result.type">
+          <xsl:text>&#10;</xsl:text>
+          <xsl:call-template name="indent">
+            <xsl:with-param name="indentation" select="$indentation"/>
+          </xsl:call-template>
+        </xsl:if>
+
+        <!-- Determine how many columns the type and storage
+             specifiers take on the same line as the function name. -->
+        <xsl:variable name="type-length">
+          <xsl:choose>
+            <xsl:when test="string-length($type) &gt; $boost.short.result.type">
+              0
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="string-length($type)"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+
+        <xsl:call-template name="link-or-anchor">
+          <xsl:with-param name="to" select="$link-to"/>
+          <xsl:with-param name="text" select="$function-name"/>
+          <xsl:with-param name="link-type" select="$link-type"/>
+          <xsl:with-param name="highlight" select="true()"/>
+        </xsl:call-template>
+        <xsl:text>(</xsl:text>
+        <xsl:call-template name="function-parameters">
+          <xsl:with-param name="include-names" select="$include-names"/>
+          <xsl:with-param name="indentation"
+            select="$indentation + $type-length
+                    + string-length($function-name) + 1"/>
+          <xsl:with-param name="final" select="true()"/>
+        </xsl:call-template>
+        <xsl:text>)</xsl:text>
+        <xsl:call-template name="source-highlight">
+          <xsl:with-param name="text" select="$postdeclarator"/>
+        </xsl:call-template>
+        <xsl:text>;</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Synopsis of function parameters, e.g., "(const T&, int x = 5)" -->
+  <xsl:template name="function-parameters">
+    <!-- Indentation level of this parameter list -->
+    <xsl:param name="indentation"/>
+
+    <!-- True if we should include parameter names -->
+    <xsl:param name="include-names" select="true()"/>
+
+    <!-- True if we should wrap function parameters to the next line -->
+    <xsl:param name="wrap" select="true()"/>
+
+    <!-- True if we are printing the final output -->
+    <xsl:param name="final" select="false()"/>
+
+    <!-- Internal: The prefix to emit before a parameter -->
+    <xsl:param name="prefix" select="''"/>
+
+    <!-- Internal: The list of parameters -->
+    <xsl:param name="parameters" select="parameter"/>
+
+    <!-- Internal: The column we are on -->
+    <xsl:param name="column" select="$indentation"/>
+
+    <!-- Internal: Whether this is the first parameter on this line or not -->
+    <xsl:param name="first-on-line" select="true()"/>
+
+    <xsl:if test="$parameters">
+      <!-- Information for this parameter -->
+      <xsl:variable name="parameter" select="$parameters[position()=1]"/>
+      <xsl:variable name="pack">
+        <xsl:if test="$parameter/@pack=1"><xsl:text>...</xsl:text></xsl:if>
+      </xsl:variable>
+      <xsl:variable name="name">
+        <xsl:if test="$include-names and $parameter/@name != ''">
+          <xsl:text> </xsl:text><xsl:value-of select="$parameter/@name"/>
+        </xsl:if>
+      </xsl:variable>
+
+      <xsl:variable name="type" select="string($parameter/paramtype)"/>
+
+      <xsl:variable name="default">
+        <xsl:choose>
+          <xsl:when test="$parameter/@default">
+            <xsl:text> = </xsl:text>
+            <xsl:value-of select="$parameter/@default"/>
+          </xsl:when>
+          <xsl:when test="$parameter/default">
+            <xsl:text> = </xsl:text>
+            <xsl:choose>
+              <xsl:when test="$final">
+                <xsl:apply-templates
+                  select="$parameter/default/*|$parameter/default/text()"
+                  mode="annotation"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="string($parameter/default)"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:variable name="text" select="concat($type, $pack, $name, $default)"/>
+
+      <xsl:variable name="end-column"
+        select="$column + string-length($prefix) + string-length($text)"/>
+
+      <xsl:choose>
+        <!-- Parameter goes on this line -->
+        <xsl:when test="$first-on-line or ($end-column &lt; $max-columns)
+                        or not($wrap)">
+          <xsl:choose>
+            <xsl:when test="$final">
+              <xsl:value-of select="$prefix"/>
+              <xsl:apply-templates
+                select="$parameter/paramtype/*|$parameter/paramtype/text()"
+                mode="annotation">
+                <xsl:with-param name="highlight" select="true()"/>
+              </xsl:apply-templates>
+              <xsl:value-of select="$pack"/>
+              <xsl:value-of select="$name"/>
+              <xsl:copy-of select="$default"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="concat($prefix, $text)"/>
+            </xsl:otherwise>
+          </xsl:choose>
+
+          <xsl:call-template name="function-parameters">
+            <xsl:with-param name="indentation" select="$indentation"/>
+            <xsl:with-param name="include-names" select="$include-names"/>
+            <xsl:with-param name="wrap" select="$wrap"/>
+            <xsl:with-param name="final" select="$final"/>
+            <xsl:with-param name="parameters"
+              select="$parameters[position()!=1]"/>
+            <xsl:with-param name="prefix" select="', '"/>
+            <xsl:with-param name="column" select="$end-column"/>
+            <xsl:with-param name="first-on-line" select="false()"/>
+          </xsl:call-template>
+        </xsl:when>
+        <!-- Parameter goes on next line -->
+        <xsl:otherwise>
+          <!-- The comma goes on this line -->
+          <xsl:value-of select="$prefix"/><xsl:text>&#10;</xsl:text>
+
+          <!-- Indent and print the parameter -->
+          <xsl:call-template name="indent">
+            <xsl:with-param name="indentation" select="$indentation"/>
+          </xsl:call-template>
+          <xsl:choose>
+            <xsl:when test="$final">
+              <xsl:apply-templates
+                select="$parameter/paramtype/*|$parameter/paramtype/text()"
+                mode="annotation">
+                <xsl:with-param name="highlight" select="true()"/>
+              </xsl:apply-templates>
+              <xsl:value-of select="$pack"/>
+              <xsl:value-of select="$name"/>
+              <xsl:value-of select="$default"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="concat($prefix, $text)"/>
+            </xsl:otherwise>
+          </xsl:choose>
+
+          <!-- Emit next parameter -->
+          <xsl:call-template name="function-parameters">
+            <xsl:with-param name="indentation" select="$indentation"/>
+            <xsl:with-param name="include-names" select="$include-names"/>
+            <xsl:with-param name="wrap" select="$wrap"/>
+            <xsl:with-param name="final" select="$final"/>
+            <xsl:with-param name="parameters"
+              select="$parameters[position()!=1]"/>
+            <xsl:with-param name="prefix" select="', '"/>
+            <xsl:with-param name="column"
+              select="1 + string-length($text) + $indentation"/>
+            <xsl:with-param name="first-on-line" select="false()"/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Function synopsis -->
+  <xsl:template match="function|method" mode="synopsis">
+    <xsl:param name="indentation"/>
+
+    <!-- True if we should compact this function -->
+    <xsl:variable name="compact"
+      select="not (para|description|requires|effects|postconditions|returns|
+                   throws|complexity|notes|rationale) and
+              ($boost.compact.function='1') and
+              not (local-name(.)='method')"/>
+
+    <xsl:choose>
+      <xsl:when test="$compact">
+        <xsl:if test="purpose">
+          <!-- Compact display outputs the purpose as a comment (if
+               there is one) and the entire function declaration. -->
+          <xsl:text>&#10;&#10;</xsl:text>
+          <xsl:call-template name="indent">
+            <xsl:with-param name="indentation" select="$indentation"/>
+          </xsl:call-template>
+
+          <xsl:call-template name="highlight-comment">
+            <xsl:with-param name="text">
+              <xsl:text>// </xsl:text>
+              <xsl:apply-templates select="purpose/*|purpose/text()"
+                mode="purpose"/>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+
+        <xsl:call-template name="function">
+          <xsl:with-param name="indentation" select="$indentation"/>
+          <xsl:with-param name="is-reference" select="true()"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="function">
+          <xsl:with-param name="indentation" select="$indentation"/>
+          <xsl:with-param name="is-reference" select="false()"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="overloaded-function|overloaded-method" mode="synopsis">
+    <xsl:param name="indentation"/>
+
+    <xsl:variable name="name" select="@name"/>
+
+    <!-- True if we should compact this function -->
+    <xsl:variable name="compact"
+      select="not (para|description|requires|effects|postconditions|returns|
+                   throws|complexity|notes|rationale) and
+              ($boost.compact.function='1') and
+              not (local-name(.)='overloaded-method')"/>
+
+    <xsl:choose>
+      <xsl:when test="$compact">
+        <xsl:if test="purpose">
+          <!-- Compact display outputs the purpose as a comment (if
+               there is one) and the entire function declaration. -->
+          <xsl:text>&#10;</xsl:text>
+          <xsl:call-template name="indent">
+            <xsl:with-param name="indentation" select="$indentation"/>
+          </xsl:call-template>
+
+          <xsl:call-template name="highlight-comment">
+            <xsl:with-param name="text">
+              <xsl:text>// </xsl:text>
+              <xsl:apply-templates select="purpose" mode="annotation"/>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+
+        <xsl:for-each select="signature">
+          <xsl:call-template name="function">
+            <xsl:with-param name="indentation" select="$indentation"/>
+            <xsl:with-param name="is-reference" select="true()"/>
+            <xsl:with-param name="name" select="$name"/>
+          </xsl:call-template>
+        </xsl:for-each>
+      </xsl:when>
+      <xsl:when test="local-name(..)='namespace'">
+        <xsl:variable name="link-to">
+          <xsl:call-template name="generate.id"/>
+        </xsl:variable>
+
+        <xsl:for-each select="signature">
+          <xsl:call-template name="function">
+            <xsl:with-param name="indentation" select="$indentation"/>
+            <xsl:with-param name="is-reference" select="false()"/>
+            <xsl:with-param name="name" select="$name"/>
+            <xsl:with-param name="link-to" select="$link-to"/>
+          </xsl:call-template>
+        </xsl:for-each>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:for-each select="signature">
+          <xsl:call-template name="function">
+            <xsl:with-param name="indentation" select="$indentation"/>
+            <xsl:with-param name="is-reference" select="false()"/>
+            <xsl:with-param name="name" select="$name"/>
+          </xsl:call-template>
+        </xsl:for-each>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Group free functions together under a category name (header synopsis)-->
+  <xsl:template match="free-function-group" mode="header-synopsis">
+    <xsl:param name="class"/>
+    <xsl:param name="indentation"/>
+    <xsl:apply-templates select="function|overloaded-function" mode="synopsis">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <!-- Constructors, destructor, and assignment operators -->
+  <xsl:template name="construct-copy-destruct-synopsis">
+    <xsl:param name="indentation"/>
+    <xsl:if test="constructor|copy-assignment|destructor">
+      <xsl:if test="typedef|static-constant">
+        <xsl:text>&#10;</xsl:text>
+      </xsl:if>
+      <xsl:text>&#10;</xsl:text>
+      <xsl:call-template name="indent">
+        <xsl:with-param name="indentation" select="$indentation"/>
+      </xsl:call-template>
+      <emphasis>
+        <xsl:text>// </xsl:text>
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to">
+            <xsl:call-template name="generate.id"/>
+            <xsl:text>construct-copy-destruct</xsl:text>
+          </xsl:with-param>
+          <xsl:with-param name="text" select="'construct/copy/destruct'"/>
+        </xsl:call-template>
+      </emphasis>
+      <xsl:apply-templates select="constructor" mode="synopsis">
+        <xsl:with-param name="indentation" select="$indentation"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates select="copy-assignment" mode="synopsis">
+        <xsl:with-param name="indentation" select="$indentation"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates select="destructor" mode="synopsis">
+        <xsl:with-param name="indentation" select="$indentation"/>
+      </xsl:apply-templates>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="construct-copy-destruct-reference">
+    <xsl:if test="constructor|copy-assignment|destructor">
+      <xsl:call-template name="member-documentation">
+        <xsl:with-param name="name">
+          <xsl:call-template name="anchor">
+            <xsl:with-param name="to">
+              <xsl:call-template name="generate.id"/>
+              <xsl:text>construct-copy-destruct</xsl:text>
+            </xsl:with-param>
+            <xsl:with-param name="text" select="''"/>
+          </xsl:call-template>
+          <xsl:call-template name="monospaced">
+            <xsl:with-param name="text">
+              <xsl:call-template name="object-name"/>
+            </xsl:with-param>
+          </xsl:call-template>
+          <xsl:text> </xsl:text>
+          <xsl:call-template name="access-name"/>
+          <xsl:text> construct/copy/destruct</xsl:text>
+        </xsl:with-param>
+        <xsl:with-param name="text">
+          <orderedlist>
+            <xsl:apply-templates select="constructor" mode="reference"/>
+            <xsl:apply-templates select="copy-assignment" mode="reference"/>
+            <xsl:apply-templates select="destructor" mode="reference"/>
+          </orderedlist>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="constructor" mode="reference">
+    <xsl:call-template name="function.documentation">
+      <xsl:with-param name="text">
+        <para>
+          <xsl:call-template name="preformatted">
+            <xsl:with-param name="text">
+              <xsl:call-template name="function">
+                <xsl:with-param name="indentation" select="0"/>
+                <xsl:with-param name="is-reference" select="true()"/>
+                <xsl:with-param name="constructor-for">
+                  <xsl:call-template name="object-name"/>
+                </xsl:with-param>
+                <xsl:with-param name="standalone" select="true()"/>
+              </xsl:call-template>
+            </xsl:with-param>
+          </xsl:call-template>
+        </para>
+        <xsl:call-template name="function-requirements"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="copy-assignment" mode="reference">
+    <xsl:call-template name="function.documentation">
+      <xsl:with-param name="text">
+        <para>
+          <xsl:call-template name="preformatted">
+            <xsl:with-param name="text">
+              <xsl:call-template name="function">
+                <xsl:with-param name="indentation" select="0"/>
+                <xsl:with-param name="is-reference" select="true()"/>
+                <xsl:with-param name="copy-assign-for">
+                  <xsl:call-template name="object-name"/>
+                </xsl:with-param>
+                <xsl:with-param name="standalone" select="true()"/>
+              </xsl:call-template>
+            </xsl:with-param>
+          </xsl:call-template>
+        </para>
+        <xsl:call-template name="function-requirements"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="destructor" mode="reference">
+    <xsl:call-template name="function.documentation">
+      <xsl:with-param name="text">
+        <para>
+          <xsl:call-template name="preformatted">
+            <xsl:with-param name="text">
+              <xsl:call-template name="function">
+                <xsl:with-param name="indentation" select="0"/>
+                <xsl:with-param name="is-reference" select="true()"/>
+                <xsl:with-param name="destructor-for">
+                  <xsl:call-template name="object-name"/>
+                </xsl:with-param>
+                <xsl:with-param name="standalone" select="true()"/>
+              </xsl:call-template>
+            </xsl:with-param>
+          </xsl:call-template>
+        </para>
+        <xsl:call-template name="function-requirements"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- Templates for functions -->
+  <xsl:template name="function.documentation">
+    <xsl:param name="text"/>
+    <xsl:choose>
+      <xsl:when test="count(ancestor::free-function-group) &gt; 0
+                      or count(ancestor::method-group) &gt; 0
+                      or local-name(.)='constructor'
+                      or local-name(.)='copy-assignment'
+                      or local-name(.)='destructor'">
+        <listitem><xsl:copy-of select="$text"/></listitem>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:copy-of select="$text"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Semantic descriptions of functions -->
+  <xsl:template name="function-requirements">
+    <xsl:param name="namespace-reference" select="false()"/>
+
+    <xsl:if test="$namespace-reference=false()">
+      <xsl:apply-templates select="purpose/*|purpose/text()"/>
+    </xsl:if>
+
+    <xsl:apply-templates select="description/*"/>
+
+    <xsl:if test="parameter/description|signature/parameter/description|
+                  requires|effects|postconditions|returns|throws|complexity|
+                  notes|rationale">
+      <variablelist spacing="compact">
+        <xsl:processing-instruction name="dbhtml">
+          list-presentation="table"
+        </xsl:processing-instruction>
+
+        <!-- Document parameters -->
+        <xsl:if test="parameter/description|signature/parameter/description">
+          <varlistentry>
+            <term>Parameters:</term>
+            <listitem>
+              <variablelist spacing="compact">
+                <xsl:processing-instruction name="dbhtml">
+                  list-presentation="table"
+                </xsl:processing-instruction>
+                <xsl:for-each select="parameter|signature/parameter">
+                             <xsl:sort select="attribute::name"/>
+                  <xsl:if test="description">
+                    <varlistentry>
+                      <term>
+                        <xsl:call-template name="monospaced">
+                          <xsl:with-param name="text" select="@name"/>
+                        </xsl:call-template>
+                      </term>
+                      <listitem>
+                        <xsl:apply-templates select="description/*"/>
+                      </listitem>
+                    </varlistentry>
+                  </xsl:if>
+                </xsl:for-each>
+              </variablelist>
+            </listitem>
+          </varlistentry>
+        </xsl:if>
+
+        <!-- Document rest of function's contract -->
+        <xsl:for-each select="requires|effects|postconditions|returns|throws|complexity|
+                      notes|rationale">
+          <varlistentry>
+            <term><xsl:call-template name="function.requirement.name"/>:</term>
+            <listitem>
+              <xsl:apply-templates select="./*|./text()" mode="annotation"/>
+            </listitem>
+          </varlistentry>
+        </xsl:for-each>
+
+      </variablelist>
+    </xsl:if>
+
+    <xsl:if test="para">
+      <xsl:message>
+        <xsl:text>Warning: Use of 'para' elements in a function is deprecated.&#10;</xsl:text>
+        <xsl:text>  Wrap them in a 'description' element.</xsl:text>
+      </xsl:message>
+      <xsl:call-template name="print.warning.context"/>
+      <xsl:apply-templates select="para"/>
+    </xsl:if>
+
+  </xsl:template>
+
+  <xsl:template name="function.requirement.name">
+    <xsl:param name="node" select="."/>
+    <xsl:choose>
+      <xsl:when test="local-name($node)='requires'">Requires</xsl:when>
+      <xsl:when test="local-name($node)='effects'">Effects</xsl:when>
+      <xsl:when test="local-name($node)='postconditions'">
+        <xsl:text>Postconditions</xsl:text>
+      </xsl:when>
+      <xsl:when test="local-name($node)='returns'">Returns</xsl:when>
+      <xsl:when test="local-name($node)='throws'">Throws</xsl:when>
+      <xsl:when test="local-name($node)='complexity'">Complexity</xsl:when>
+      <xsl:when test="local-name($node)='notes'">Notes</xsl:when>
+      <xsl:when test="local-name($node)='rationale'">Rationale</xsl:when>
+      <xsl:otherwise>
+        <xsl:message>
+          <xsl:text>Error: unhandled node type `</xsl:text>
+          <xsl:value-of select="local-name($node)"/>
+          <xsl:text>' in template function.requirement.name.</xsl:text>
+        </xsl:message>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Function reference -->
+  <xsl:template match="function|method" mode="reference">
+    <!-- True if we should compact this function -->
+    <xsl:variable name="compact"
+      select="not (para|description|requires|effects|postconditions|returns|
+                   throws|complexity|notes|rationale) and
+              ($boost.compact.function='1') and
+              not (local-name(.)='method')"/>
+
+    <xsl:if test="not ($compact)">
+      <xsl:call-template name="function.documentation">
+        <xsl:with-param name="text">
+          <para>
+            <xsl:call-template name="preformatted">
+              <xsl:with-param name="text">
+                <xsl:call-template name="function">
+                  <xsl:with-param name="indentation" select="0"/>
+                  <xsl:with-param name="is-reference" select="true()"/>
+                  <xsl:with-param name="link-type" select="'anchor'"/>
+                  <xsl:with-param name="standalone" select="true()"/>
+                </xsl:call-template>
+              </xsl:with-param>
+            </xsl:call-template>
+          </para>
+          <xsl:call-template name="function-requirements"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Reference for functions at namespace level -->
+  <xsl:template match="function" mode="namespace-reference">
+    <!-- True if we should compact this function -->
+    <xsl:variable name="compact"
+      select="not (para|description|requires|effects|postconditions|returns|
+                   throws|complexity|notes|rationale) and
+              ($boost.compact.function='1')"/>
+
+    <xsl:if test="not ($compact)">
+      <xsl:call-template name="reference-documentation">
+        <xsl:with-param name="name">
+          <xsl:text>Function </xsl:text>
+          <xsl:if test="template">
+            <xsl:text>template </xsl:text>
+          </xsl:if>
+          <xsl:call-template name="monospaced">
+            <xsl:with-param name="text" select="@name"/>
+          </xsl:call-template>
+        </xsl:with-param>
+        <xsl:with-param name="refname">
+          <xsl:call-template name="fully-qualified-name">
+            <xsl:with-param name="node" select="."/>
+          </xsl:call-template>
+        </xsl:with-param>
+        <xsl:with-param name="purpose" select="purpose/*|purpose/text()"/>
+        <xsl:with-param name="anchor">
+          <xsl:call-template name="generate.id"/>
+        </xsl:with-param>
+        <xsl:with-param name="synopsis">
+          <xsl:call-template name="header-link"/>
+          <xsl:call-template name="function">
+            <xsl:with-param name="indentation" select="0"/>
+            <xsl:with-param name="is-reference" select="true()"/>
+            <xsl:with-param name="link-type" select="'none'"/>
+          </xsl:call-template>
+        </xsl:with-param>
+        <xsl:with-param name="text">
+          <xsl:call-template name="function-requirements">
+            <xsl:with-param name="namespace-reference" select="true()"/>
+          </xsl:call-template>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="overloaded-function" mode="reference">
+    <xsl:variable name="name" select="@name"/>
+
+    <!-- True if we should compact this function -->
+    <xsl:variable name="compact"
+      select="not (para|description|requires|effects|postconditions|returns|
+                   throws|complexity|notes|rationale) and
+              ($boost.compact.function='1')"/>
+
+    <xsl:if test="not ($compact)">
+      <xsl:call-template name="function.documentation">
+        <xsl:with-param name="text">
+          <para>
+            <xsl:attribute name="id">
+              <xsl:call-template name="generate.id"/>
+            </xsl:attribute>
+
+            <xsl:call-template name="preformatted">
+              <xsl:with-param name="text">
+                <xsl:for-each select="signature">
+                  <xsl:call-template name="function">
+                    <xsl:with-param name="indentation" select="0"/>
+                    <xsl:with-param name="is-reference" select="true()"/>
+                    <xsl:with-param name="name" select="$name"/>
+                    <xsl:with-param name="standalone" select="true()"/>
+                  </xsl:call-template>
+                </xsl:for-each>
+              </xsl:with-param>
+            </xsl:call-template>
+          </para>
+          <xsl:call-template name="function-requirements"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="overloaded-function" mode="namespace-reference">
+    <!-- True if we should compact this function -->
+    <xsl:variable name="compact"
+      select="not (para|description|requires|effects|postconditions|returns|
+                   throws|complexity|notes|rationale) and
+              ($boost.compact.function='1')"/>
+
+    <xsl:variable name="name" select="@name"/>
+
+    <xsl:if test="not ($compact)">
+      <xsl:call-template name="reference-documentation">
+        <xsl:with-param name="name">
+          <xsl:text>Function </xsl:text>
+          <xsl:if test="template">
+            <xsl:text>template </xsl:text>
+          </xsl:if>
+          <xsl:call-template name="monospaced">
+            <xsl:with-param name="text" select="@name"/>
+          </xsl:call-template>
+        </xsl:with-param>
+        <xsl:with-param name="refname">
+          <xsl:call-template name="fully-qualified-name">
+            <xsl:with-param name="node" select="."/>
+          </xsl:call-template>
+        </xsl:with-param>
+        <xsl:with-param name="purpose" select="purpose/*|purpose/text()"/>
+        <xsl:with-param name="anchor">
+          <xsl:call-template name="generate.id"/>
+        </xsl:with-param>
+        <xsl:with-param name="synopsis">
+          <xsl:call-template name="header-link"/>
+          <xsl:for-each select="signature">
+            <xsl:call-template name="function">
+              <xsl:with-param name="indentation" select="0"/>
+              <xsl:with-param name="is-reference" select="true()"/>
+              <xsl:with-param name="link-type" select="'none'"/>
+              <xsl:with-param name="name" select="$name"/>
+            </xsl:call-template>
+          </xsl:for-each>
+        </xsl:with-param>
+        <xsl:with-param name="text">
+          <xsl:call-template name="function-requirements">
+            <xsl:with-param name="namespace-reference" select="true()"/>
+          </xsl:call-template>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="overloaded-method" mode="reference">
+    <xsl:variable name="name" select="@name"/>
+
+    <xsl:call-template name="function.documentation">
+      <xsl:with-param name="text">
+        <para>
+          <xsl:call-template name="preformatted">
+            <xsl:with-param name="text">
+              <xsl:call-template name="anchor">
+                <xsl:with-param name="to">
+                  <xsl:call-template name="generate.id"/>
+                </xsl:with-param>
+              </xsl:call-template>
+              <xsl:for-each select="signature">
+                <xsl:call-template name="function">
+                  <xsl:with-param name="indentation" select="0"/>
+                  <xsl:with-param name="is-reference" select="true()"/>
+                  <xsl:with-param name="name" select="$name"/>
+                  <xsl:with-param name="standalone" select="true()"/>
+                </xsl:call-template>
+              </xsl:for-each>
+            </xsl:with-param>
+          </xsl:call-template>
+        </para>
+        <xsl:call-template name="function-requirements"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- Group member functions together under a category name (synopsis)-->
+  <xsl:template match="method-group" mode="synopsis">
+    <xsl:param name="indentation"/>
+    <xsl:if test="count(child::*) &gt; 0">
+      <xsl:text>&#10;</xsl:text>
+      <xsl:text>&#10;</xsl:text>
+      <xsl:call-template name="indent">
+        <xsl:with-param name="indentation" select="$indentation"/>
+      </xsl:call-template>
+      <emphasis>
+        <xsl:text>// </xsl:text>
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to">
+            <xsl:call-template name="generate.id"/>
+          </xsl:with-param>
+          <xsl:with-param name="text" select="string(@name)"/>
+        </xsl:call-template>
+      </emphasis>
+      <xsl:apply-templates select="method|overloaded-method"
+        mode="synopsis">
+        <xsl:with-param name="indentation" select="$indentation"/>
+      </xsl:apply-templates>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Group member functions together under a category name (reference)-->
+  <xsl:template match="method-group" mode="reference">
+    <xsl:if test="count(child::*) &gt; 0">
+      <xsl:call-template name="member-documentation">
+        <xsl:with-param name="name">
+          <xsl:call-template name="anchor">
+            <xsl:with-param name="to">
+              <xsl:call-template name="generate.id"/>
+            </xsl:with-param>
+            <xsl:with-param name="text" select="''"/>
+          </xsl:call-template>
+          <xsl:call-template name="monospaced">
+            <xsl:with-param name="text">
+              <xsl:call-template name="object-name"/>
+            </xsl:with-param>
+          </xsl:call-template>
+          <xsl:text> </xsl:text>
+          <xsl:value-of select="@name"/>
+        </xsl:with-param>
+        <xsl:with-param name="text">
+          <orderedlist>
+            <xsl:apply-templates select="method|overloaded-method"
+              mode="reference"/>
+          </orderedlist>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Group free functions together under a category name (synopsis)-->
+  <xsl:template match="free-function-group" mode="synopsis">
+    <xsl:param name="class"/>
+    <xsl:param name="indentation"/>
+    <xsl:text>&#10;</xsl:text>
+    <xsl:text>&#10;</xsl:text>
+    <xsl:call-template name="indent">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:call-template>
+    <emphasis>
+      <xsl:text>// </xsl:text>
+      <xsl:call-template name="internal-link">
+        <xsl:with-param name="to">
+          <xsl:call-template name="generate.id"/>
+        </xsl:with-param>
+        <xsl:with-param name="text" select="string(@name)"/>
+      </xsl:call-template>
+    </emphasis>
+    <xsl:apply-templates select="function|overloaded-function" mode="synopsis">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <!-- Group free functions together under a category name (reference)-->
+  <xsl:template match="free-function-group" mode="reference">
+    <xsl:param name="class"/>
+    <xsl:call-template name="member-documentation">
+      <xsl:with-param name="name">
+        <xsl:call-template name="anchor">
+          <xsl:with-param name="to">
+            <xsl:call-template name="generate.id"/>
+          </xsl:with-param>
+          <xsl:with-param name="text" select="''"/>
+        </xsl:call-template>
+        <xsl:call-template name="monospaced">
+          <xsl:with-param name="text" select="$class"/>
+        </xsl:call-template>
+        <xsl:value-of select="concat(' ',@name)"/>
+      </xsl:with-param>
+      <xsl:with-param name="text">
+        <orderedlist>
+          <xsl:apply-templates select="function|overloaded-function"
+            mode="reference"/>
+        </orderedlist>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+</xsl:stylesheet>
diff --git a/xsl/api/global.xsl b/xsl/api/global.xsl
new file mode 100644 (file)
index 0000000..9c7e62b
--- /dev/null
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+  
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+  <xsl:template name="global-synopsis">
+    <xsl:param name="indentation" select="0" />
+    <xsl:if test="not(local-name(preceding-sibling::*[position()=1])=local-name(.)) and (position() &gt; 1)">
+      <xsl:text>&#10;</xsl:text>
+    </xsl:if>
+    <xsl:text>&#10;</xsl:text>
+    <xsl:call-template name="indent">
+      <xsl:with-param name="indentation" select="$indentation" />
+    </xsl:call-template>
+    <xsl:call-template name="global-synopsis-impl">
+      <xsl:with-param name="link-type" select="'link'" />
+    </xsl:call-template>
+  </xsl:template>
+  <xsl:template name="global-reference">
+    <xsl:call-template name="reference-documentation">
+      <xsl:with-param name="refname">
+        <xsl:call-template name="fully-qualified-name">
+          <xsl:with-param name="node" select="." />
+        </xsl:call-template>
+        <xsl:apply-templates select="specialization" />
+      </xsl:with-param>
+      <xsl:with-param name="purpose" select="purpose/*|purpose/text()" />
+      <xsl:with-param name="anchor">
+        <xsl:call-template name="generate.id" />
+      </xsl:with-param>
+      <xsl:with-param name="name">
+        <xsl:text>Global </xsl:text>
+        <xsl:call-template name="monospaced">
+          <xsl:with-param name="text" select="@name" />
+        </xsl:call-template>
+      </xsl:with-param>
+      <xsl:with-param name="synopsis">
+        <xsl:call-template name="header-link"/>
+        <xsl:call-template name="global-synopsis-impl">
+          <xsl:with-param name="link-type" select="'none'" />
+        </xsl:call-template>
+      </xsl:with-param>
+      <xsl:with-param name="text">
+        <xsl:apply-templates select="description" />
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+  <xsl:template name="global-synopsis-impl">
+    <xsl:param name="link-type" />
+    <xsl:if test="@specifiers">
+      <xsl:call-template name="highlight-keyword">
+        <xsl:with-param name="keyword" select="@specifiers" />
+      </xsl:call-template>
+      <xsl:text> </xsl:text>
+    </xsl:if>
+    <xsl:apply-templates select="type/*|type/text()" mode="annotation" />
+    <xsl:text> </xsl:text>
+    <xsl:call-template name="link-or-anchor">
+      <xsl:with-param name="to">
+        <xsl:call-template name="generate.id" select="." />
+      </xsl:with-param>
+      <xsl:with-param name="text" select="@name" />
+      <xsl:with-param name="link-type" select="$link-type" />
+    </xsl:call-template>
+    <xsl:text>;</xsl:text>
+  </xsl:template>
+  <xsl:template match="data-member" mode="generate.id">
+    <xsl:call-template name="fully-qualified-id">
+      <xsl:with-param name="node" select="."/>
+    </xsl:call-template>
+  </xsl:template>
+</xsl:stylesheet>
diff --git a/xsl/api/html-base.xsl b/xsl/api/html-base.xsl
new file mode 100644 (file)
index 0000000..cfdd4a3
--- /dev/null
@@ -0,0 +1,314 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"
+                xmlns:d="http://docbook.org/ns/docbook"
+                               xmlns:exsl="http://exslt.org/common"
+                               exclude-result-prefixes="exsl d"
+                version="1.0">
+  
+  <xsl:param name="html.stylesheet">
+    <xsl:choose>
+      <xsl:when test = "$boost.defaults = 'Boost'">
+        <xsl:value-of select = "concat($boost.root, '/doc/src/boostbook.css')"/>
+      </xsl:when>
+      <xsl:otherwise>
+        boostbook.css
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:param>
+
+  <xsl:param name="admon.style"/>
+  <xsl:param name="admon.graphics">1</xsl:param>
+  <xsl:param name="boostbook.verbose" select="0"/>
+  <xsl:param name="navig.graphics" select="1"/>
+  <xsl:param name="navig.graphics.extension" select="'.png'"/>
+  <xsl:param name="chapter.autolabel" select="1"/>
+  <xsl:param name="use.id.as.filename" select="1"/>
+  <xsl:param name="refentry.generate.name" select="0"/>
+  <xsl:param name="refentry.generate.title" select="1"/>
+  <xsl:param name="make.year.ranges" select="1"/>
+  <xsl:param name="generate.manifest" select="1"/>
+  <xsl:param name="generate.section.toc.level" select="3"/>
+  <xsl:param name="doc.standalone">false</xsl:param>
+  <xsl:param name="chunker.output.indent">yes</xsl:param>
+  <xsl:param name="chunker.output.encoding">US-ASCII</xsl:param>
+  <xsl:param name="chunk.quietly" select="not(number($boostbook.verbose))"/>
+  <xsl:param name="toc.max.depth">2</xsl:param>
+  <xsl:param name="callout.graphics.number.limit">15</xsl:param>
+  <xsl:param name = "admon.graphics.path"
+            select = "concat($boost.root, '/doc/html/images/')"/>
+  <xsl:param name = "navig.graphics.path"
+            select = "concat($boost.root, '/doc/html/images/')"/>
+  <xsl:param name = "callout.graphics.path"
+            select = "concat($boost.root, '/doc/src/images/callouts/')"/>
+
+
+  <xsl:param name="admon.style">
+    <!-- Remove the style. Let the CSS do the styling -->
+</xsl:param>
+
+<!-- Always have graphics -->
+<xsl:param name="admon.graphics" select="1"/>
+
+  <xsl:param name="generate.toc">
+appendix  toc,title
+article/appendix  nop
+article   toc,title
+book      toc,title
+chapter   toc,title
+part      toc,title
+preface   toc,title
+qandadiv  toc
+qandaset  toc
+reference toc,title
+sect1     toc
+sect2     toc
+sect3     toc
+sect4     toc
+sect5     toc
+section   toc
+set       toc,title
+  </xsl:param>
+
+
+  <xsl:template name="format.cvs.revision">
+    <xsl:param name="text"/>
+
+    <!-- Remove the "$Date: " -->
+    <xsl:variable name="text.noprefix"
+      select="substring-after($text, '$Date: ')"/>
+
+    <!-- Grab the year -->
+    <xsl:variable name="year" select="substring-before($text.noprefix, '/')"/>
+    <xsl:variable name="text.noyear"
+      select="substring-after($text.noprefix, '/')"/>
+
+    <!-- Grab the month -->
+    <xsl:variable name="month" select="substring-before($text.noyear, '/')"/>
+    <xsl:variable name="text.nomonth"
+      select="substring-after($text.noyear, '/')"/>
+
+    <!-- Grab the year -->
+    <xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
+    <xsl:variable name="text.noday"
+      select="substring-after($text.nomonth, ' ')"/>
+
+    <!-- Get the time -->
+    <xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
+
+    <xsl:variable name="month.name">
+      <xsl:choose>
+        <xsl:when test="$month=1">January</xsl:when>
+        <xsl:when test="$month=2">February</xsl:when>
+        <xsl:when test="$month=3">March</xsl:when>
+        <xsl:when test="$month=4">April</xsl:when>
+        <xsl:when test="$month=5">May</xsl:when>
+        <xsl:when test="$month=6">June</xsl:when>
+        <xsl:when test="$month=7">July</xsl:when>
+        <xsl:when test="$month=8">August</xsl:when>
+        <xsl:when test="$month=9">September</xsl:when>
+        <xsl:when test="$month=10">October</xsl:when>
+        <xsl:when test="$month=11">November</xsl:when>
+        <xsl:when test="$month=12">December</xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
+                                 $time, ' GMT')"/>
+  </xsl:template>
+
+
+  <xsl:template name="format.svn.revision">
+    <xsl:param name="text"/>
+
+    <!-- Remove the "$Date: " -->
+    <xsl:variable name="text.noprefix"
+      select="substring-after($text, '$Date: ')"/>
+
+    <!-- Grab the year -->
+    <xsl:variable name="year" select="substring-before($text.noprefix, '-')"/>
+    <xsl:variable name="text.noyear"
+      select="substring-after($text.noprefix, '-')"/>
+
+    <!-- Grab the month -->
+    <xsl:variable name="month" select="substring-before($text.noyear, '-')"/>
+    <xsl:variable name="text.nomonth"
+      select="substring-after($text.noyear, '-')"/>
+
+    <!-- Grab the year -->
+    <xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
+    <xsl:variable name="text.noday"
+      select="substring-after($text.nomonth, ' ')"/>
+
+    <!-- Get the time -->
+    <xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
+    <xsl:variable name="text.notime"
+      select="substring-after($text.noday, ' ')"/>
+
+    <!-- Get the timezone -->
+    <xsl:variable name="timezone" select="substring-before($text.notime, ' ')"/>
+
+    <xsl:variable name="month.name">
+      <xsl:choose>
+        <xsl:when test="$month=1">January</xsl:when>
+        <xsl:when test="$month=2">February</xsl:when>
+        <xsl:when test="$month=3">March</xsl:when>
+        <xsl:when test="$month=4">April</xsl:when>
+        <xsl:when test="$month=5">May</xsl:when>
+        <xsl:when test="$month=6">June</xsl:when>
+        <xsl:when test="$month=7">July</xsl:when>
+        <xsl:when test="$month=8">August</xsl:when>
+        <xsl:when test="$month=9">September</xsl:when>
+        <xsl:when test="$month=10">October</xsl:when>
+        <xsl:when test="$month=11">November</xsl:when>
+        <xsl:when test="$month=12">December</xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
+                                 $time, ' ', $timezone)"/>
+  </xsl:template>
+
+  <!-- Footer Copyright -->
+  <xsl:template match="copyright" mode="boost.footer">
+    <xsl:if test="position() &gt; 1">
+      <br/>
+    </xsl:if>
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="'Copyright'"/>
+    </xsl:call-template>
+    <xsl:call-template name="gentext.space"/>
+    <xsl:call-template name="dingbat">
+      <xsl:with-param name="dingbat">copyright</xsl:with-param>
+    </xsl:call-template>
+    <xsl:call-template name="gentext.space"/>
+    <xsl:call-template name="copyright.years">
+      <xsl:with-param name="years" select="year"/>
+      <xsl:with-param name="print.ranges" select="$make.year.ranges"/>
+      <xsl:with-param name="single.year.ranges"
+        select="$make.single.year.ranges"/>
+    </xsl:call-template>
+    <xsl:call-template name="gentext.space"/>
+    <xsl:apply-templates select="holder" mode="titlepage.mode"/>
+  </xsl:template>
+
+  <!-- Footer License -->
+  <xsl:template match="legalnotice" mode="boost.footer">
+    <xsl:apply-templates select="para" mode="titlepage.mode" />
+  </xsl:template>
+
+  <xsl:template name="user.footer.content">
+    <table width="100%">
+      <tr>
+        <td align="left">
+          <xsl:variable name="revision-nodes"
+            select="ancestor-or-self::*
+                    [not (attribute::rev:last-revision='')]"/>
+          <xsl:if test="count($revision-nodes) &gt; 0">
+            <xsl:variable name="revision-node"
+              select="$revision-nodes[last()]"/>
+            <xsl:variable name="revision-text">
+              <xsl:value-of
+                select="normalize-space($revision-node/attribute::rev:last-revision)"/>
+            </xsl:variable>
+            <xsl:if test="string-length($revision-text) &gt; 0">
+              <p>
+                <small>
+                  <xsl:text>Last revised: </xsl:text>
+                  <xsl:choose>
+                    <xsl:when test="contains($revision-text, '/')">
+                      <xsl:call-template name="format.cvs.revision">
+                        <xsl:with-param name="text" select="$revision-text"/>
+                      </xsl:call-template>
+                    </xsl:when>
+                    <xsl:otherwise>
+                      <xsl:call-template name="format.svn.revision">
+                        <xsl:with-param name="text" select="$revision-text"/>
+                      </xsl:call-template>
+                    </xsl:otherwise>
+                  </xsl:choose>
+                </small>
+              </p>
+            </xsl:if>
+          </xsl:if>
+        </td>
+        <td align="right">
+          <div class = "copyright-footer">
+            <xsl:apply-templates select="ancestor::*/*/copyright"
+              mode="boost.footer"/>
+            <xsl:apply-templates select="ancestor::*/*/legalnotice"
+              mode="boost.footer"/>
+          </div>
+        </td>
+      </tr>
+    </table>
+  </xsl:template>
+
+  <!-- We don't want refentry's to show up in the TOC because they
+       will merely be redundant with the synopsis. -->
+  <xsl:template match="refentry" mode="toc"/>
+
+  <!-- override the behaviour of some DocBook elements for better
+       rendering facilities -->
+
+  <xsl:template match = "programlisting[ancestor::informaltable]">
+     <pre class = "table-{name(.)}"><xsl:apply-templates/></pre>
+  </xsl:template>
+
+  <xsl:template match = "refsynopsisdiv">
+     <h2 class = "{name(.)}-title">Synopsis</h2>
+     <div class = "{name(.)}">
+        <xsl:apply-templates/>
+     </div>
+  </xsl:template>
+
+  <xsl:template name="generate.html.title"/>
+  
+<!-- ============================================================ -->
+
+<xsl:template name="output.html.stylesheets">
+    <xsl:param name="stylesheets" select="''"/>
+
+    <xsl:choose>
+        <xsl:when test="contains($stylesheets, ' ')">
+            <link rel="stylesheet">
+                <xsl:attribute name="href">
+                    <xsl:call-template name="href.target.relative">
+                        <xsl:with-param name="target" select="substring-before($stylesheets, ' ')"/>
+                    </xsl:call-template>
+                </xsl:attribute>
+                <xsl:if test="$html.stylesheet.type != ''">
+                    <xsl:attribute name="type">
+                        <xsl:value-of select="$html.stylesheet.type"/>
+                    </xsl:attribute>
+                </xsl:if>
+            </link>
+            <xsl:call-template name="output.html.stylesheets">
+                <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
+            </xsl:call-template>
+        </xsl:when>
+        <xsl:when test="$stylesheets != ''">
+            <link rel="stylesheet">
+                <xsl:attribute name="href">
+                    <xsl:call-template name="href.target.relative">
+                        <xsl:with-param name="target" select="$stylesheets"/>
+                    </xsl:call-template>
+                </xsl:attribute>
+                <xsl:if test="$html.stylesheet.type != ''">
+                    <xsl:attribute name="type">
+                        <xsl:value-of select="$html.stylesheet.type"/>
+                    </xsl:attribute>
+                </xsl:if>
+            </link>
+        </xsl:when>
+    </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/xsl/api/html-help.xsl b/xsl/api/html-help.xsl
new file mode 100644 (file)
index 0000000..9b99789
--- /dev/null
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"
+                version="1.0">
+
+  <!-- Import the HTML chunking stylesheet -->
+  <xsl:import
+    href="http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl"/>
+
+  <xsl:param name="admon.style"/>
+  <xsl:param name="admon.graphics">1</xsl:param>
+  <xsl:param name="boostbook.verbose" select="0"/>
+  <xsl:param name="html.stylesheet" select="'boostbook.css'"/>
+  <xsl:param name="chapter.autolabel" select="1"/>
+  <xsl:param name="use.id.as.filename" select="1"/>
+  <xsl:param name="refentry.generate.name" select="0"/>
+  <xsl:param name="refentry.generate.title" select="1"/>
+  <xsl:param name="make.year.ranges" select="1"/>
+  <xsl:param name="generate.manifest" select="1"/>
+  <xsl:param name="callout.graphics.number.limit">15</xsl:param>
+  <xsl:param name="draft.mode">no</xsl:param>
+  <xsl:param name="admon.graphics" select="1"/>
+
+  <xsl:template name="format.cvs.revision">
+    <xsl:param name="text"/>
+
+    <!-- Remove the "$Date: " -->
+    <xsl:variable name="text.noprefix"
+      select="substring-after($text, '$Date: ')"/>
+
+    <!-- Grab the year -->
+    <xsl:variable name="year" select="substring-before($text.noprefix, '/')"/>
+    <xsl:variable name="text.noyear"
+      select="substring-after($text.noprefix, '/')"/>
+
+    <!-- Grab the month -->
+    <xsl:variable name="month" select="substring-before($text.noyear, '/')"/>
+    <xsl:variable name="text.nomonth"
+      select="substring-after($text.noyear, '/')"/>
+
+    <!-- Grab the year -->
+    <xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
+    <xsl:variable name="text.noday"
+      select="substring-after($text.nomonth, ' ')"/>
+
+    <!-- Get the time -->
+    <xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
+
+    <xsl:variable name="month.name">
+      <xsl:choose>
+        <xsl:when test="$month=1">January</xsl:when>
+        <xsl:when test="$month=2">February</xsl:when>
+        <xsl:when test="$month=3">March</xsl:when>
+        <xsl:when test="$month=4">April</xsl:when>
+        <xsl:when test="$month=5">May</xsl:when>
+        <xsl:when test="$month=6">June</xsl:when>
+        <xsl:when test="$month=7">July</xsl:when>
+        <xsl:when test="$month=8">August</xsl:when>
+        <xsl:when test="$month=9">September</xsl:when>
+        <xsl:when test="$month=10">October</xsl:when>
+        <xsl:when test="$month=11">November</xsl:when>
+        <xsl:when test="$month=12">December</xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
+                                 $time, ' GMT')"/>
+  </xsl:template>
+
+
+  <xsl:template name="format.svn.revision">
+    <xsl:param name="text"/>
+
+    <!-- Remove the "$Date: " -->
+    <xsl:variable name="text.noprefix"
+      select="substring-after($text, '$Date: ')"/>
+
+    <!-- Grab the year -->
+    <xsl:variable name="year" select="substring-before($text.noprefix, '-')"/>
+    <xsl:variable name="text.noyear"
+      select="substring-after($text.noprefix, '-')"/>
+
+    <!-- Grab the month -->
+    <xsl:variable name="month" select="substring-before($text.noyear, '-')"/>
+    <xsl:variable name="text.nomonth"
+      select="substring-after($text.noyear, '-')"/>
+
+    <!-- Grab the year -->
+    <xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
+    <xsl:variable name="text.noday"
+      select="substring-after($text.nomonth, ' ')"/>
+
+    <!-- Get the time -->
+    <xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
+    <xsl:variable name="text.notime"
+      select="substring-after($text.noday, ' ')"/>
+
+    <!-- Get the timezone -->
+    <xsl:variable name="timezone" select="substring-before($text.notime, ' ')"/>
+
+    <xsl:variable name="month.name">
+      <xsl:choose>
+        <xsl:when test="$month=1">January</xsl:when>
+        <xsl:when test="$month=2">February</xsl:when>
+        <xsl:when test="$month=3">March</xsl:when>
+        <xsl:when test="$month=4">April</xsl:when>
+        <xsl:when test="$month=5">May</xsl:when>
+        <xsl:when test="$month=6">June</xsl:when>
+        <xsl:when test="$month=7">July</xsl:when>
+        <xsl:when test="$month=8">August</xsl:when>
+        <xsl:when test="$month=9">September</xsl:when>
+        <xsl:when test="$month=10">October</xsl:when>
+        <xsl:when test="$month=11">November</xsl:when>
+        <xsl:when test="$month=12">December</xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
+                                 $time, ' ', $timezone)"/>
+  </xsl:template>
+
+  <!-- We don't want refentry's to show up in the TOC because they
+       will merely be redundant with the synopsis. -->
+  <xsl:template match="refentry" mode="toc"/>
+
+  <!-- override the behaviour of some DocBook elements for better
+       rendering facilities -->
+
+  <xsl:template match = "programlisting[ancestor::informaltable]">
+     <pre class = "table-{name(.)}"><xsl:apply-templates/></pre>
+  </xsl:template>
+
+  <xsl:template match = "refsynopsisdiv">
+     <h2 class = "{name(.)}-title">Synopsis</h2>
+     <div class = "{name(.)}">
+        <xsl:apply-templates/>
+     </div>
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/xsl/api/html-single.xsl b/xsl/api/html-single.xsl
new file mode 100644 (file)
index 0000000..69dff32
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+  
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"
+                version="1.0">
+
+  <!-- Import the HTML stylesheet -->
+  <xsl:import 
+    href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
+  <xsl:import href="admon.xsl"/>
+
+  <xsl:param name="admon.style"/>
+  <xsl:param name="admon.graphics">1</xsl:param>
+  <xsl:param name="chapter.autolabel" select="0"/>
+  <xsl:param name="refentry.generate.name" select="0"/>
+  <xsl:param name="refentry.generate.title" select="1"/>
+  <xsl:param name="make.year.ranges" select="1"/>
+
+</xsl:stylesheet>
diff --git a/xsl/api/html.xsl b/xsl/api/html.xsl
new file mode 100644 (file)
index 0000000..3a3f54c
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"
+                xmlns:d="http://docbook.org/ns/docbook"
+                               xmlns:exsl="http://exslt.org/common"
+                               exclude-result-prefixes="exsl d"
+                 version="1.0">
+
+  <!-- Import the HTML chunking stylesheet -->
+  <xsl:import
+    href="http://docbook.sourceforge.net/release/xsl-ns/current/html/chunk.xsl"/>
+  <xsl:import
+    href="http://docbook.sourceforge.net/release/xsl-ns/current/html/math.xsl"/>
+
+  <!-- Bring in the fast chunking overrides.  There's nothing
+       that we need to override, so include instead of importing it. -->
+  <xsl:include
+    href="http://docbook.sourceforge.net/release/xsl-ns/current/html/chunkfast.xsl"/>
+  
+  <!-- We have to make sure that our templates override all
+       docbook templates.  Therefore, we include our own templates
+       instead of importing them.  In order for this to work,
+       the stylesheets included here cannot also include each other -->
+  <xsl:include href="chunk-common.xsl"/>
+  <xsl:include href="docbook-layout.xsl"/>
+  <xsl:include href="navbar.xsl"/>
+  <xsl:include href="admon.xsl"/>
+  <xsl:include href="xref.xsl"/>
+  <xsl:include href="relative-href.xsl"/>
+  <xsl:include href="callout.xsl"/>
+  <xsl:include href="html-base.xsl"/>
+
+</xsl:stylesheet>
diff --git a/xsl/api/index.xsl b/xsl/api/index.xsl
new file mode 100644 (file)
index 0000000..3a93193
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+  
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+  <xsl:template match="class-index">
+    
+  </xsl:template>
+
+  <xsl:template match="function-index">
+    
+  </xsl:template>
+</xsl:stylesheet>
diff --git a/xsl/api/library.xsl b/xsl/api/library.xsl
new file mode 100644 (file)
index 0000000..4d299fe
--- /dev/null
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+  
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+  <xsl:key name="library-categories" match="library" 
+    use="libraryinfo/librarycategory/@name"/>
+
+  <xsl:template match="librarylist">
+    <itemizedlist spacing="compact">
+      <xsl:apply-templates select="//library"
+        mode="build-library-list">
+        <xsl:sort select="@name"/>
+      </xsl:apply-templates>
+    </itemizedlist>
+  </xsl:template>
+
+  <xsl:template name="library.link">
+    <xsl:param name="node" select="."/>
+    <xsl:param name="name" select="$node/attribute::name"/>
+
+    <xsl:choose>
+      <xsl:when test="$node/attribute::html-only = 1">
+        <xsl:variable name="url">
+          <xsl:choose>
+            <xsl:when test="$node/attribute::url">
+              <xsl:value-of select="$node/attribute::url"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="concat($boost.root,
+                                           '/libs/', 
+                                           $node/attribute::dirname, 
+                                           '/index.html')"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+        <ulink>
+          <xsl:attribute name="url">
+            <xsl:value-of select="$url"/>
+          </xsl:attribute>
+          <xsl:value-of select="$name"/>
+        </ulink>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to">
+            <xsl:choose>
+              <xsl:when test="$node/attribute::id">
+                <xsl:value-of select="$node/attribute::id"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:call-template name="generate.id">
+                  <xsl:with-param name="node" select="$node"/>
+                </xsl:call-template>
+              </xsl:otherwise>
+            </xsl:choose>                 
+          </xsl:with-param>
+          <xsl:with-param name="text" select="$name"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>    
+  </xsl:template>
+  
+  <xsl:template match="library" mode="build-library-list">
+    <listitem>
+      <simpara>
+        <xsl:call-template name="library.link"/>
+        <xsl:text> - </xsl:text>
+        <xsl:apply-templates select="libraryinfo/librarypurpose"
+          mode="build-library-list"/>
+      </simpara>
+    </listitem>
+  </xsl:template>
+
+  <xsl:template match="librarypurpose" mode="build-library-list">
+    <xsl:apply-templates/>
+    <xsl:text>, from </xsl:text>
+    <xsl:apply-templates select="../author" mode="display-author-list"/>
+  </xsl:template>
+
+  <xsl:template match="author" mode="display-author-list">
+    <xsl:if test="(position() &gt; 1) and (count(../author) &gt; 2)">
+      <xsl:text>, </xsl:text>
+    </xsl:if>
+    <xsl:if test="(position() = count(../author)) and (position() &gt; 1)">
+      <xsl:if test="position() &lt; 3">
+        <xsl:text> </xsl:text>
+      </xsl:if>
+      <xsl:text>and </xsl:text>
+    </xsl:if>
+    <xsl:apply-templates select="firstname/text()"/>
+    <xsl:text> </xsl:text>
+    <xsl:apply-templates select="surname/text()"/>
+    <xsl:if test="(position() = count(../author))">
+      <xsl:text>.</xsl:text>      
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="librarycategorylist">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="librarycategorydef">
+    <section>
+      <title><xsl:apply-templates/></title>
+      <xsl:variable name="name" select="@name"/>
+      <itemizedlist spacing="compact">
+        <xsl:apply-templates select="key('library-categories', $name)"
+          mode="build-library-list">
+          <xsl:sort select="@name"/>
+        </xsl:apply-templates>
+      </itemizedlist>
+    </section>
+  </xsl:template>
+
+  <xsl:template match="libraryinfo">
+    <chapterinfo>
+      <xsl:apply-templates select="author|authorgroup/author|copyright|legalnotice"/>
+    </chapterinfo>
+  </xsl:template>
+
+  <xsl:template match="librarypurpose|librarycategory"/>
+
+</xsl:stylesheet>
diff --git a/xsl/api/lookup.xsl b/xsl/api/lookup.xsl
new file mode 100644 (file)
index 0000000..d37e787
--- /dev/null
@@ -0,0 +1,424 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:exsl="http://exslt.org/common"
+                version="1.0">
+
+  <!-- Maximum length of directory and file names is 31 characters.
+       '.html' uses 5 characters.
+       31 - 5 = 26 -->
+  <xsl:param name="boost.max.id.part.length">26</xsl:param>
+
+  <!-- Generate an ID for the entity referenced -->
+  <xsl:template name="generate.id">
+    <xsl:param name="node" select="."/>
+    <xsl:apply-templates select="$node" mode="generate.id"/>
+  </xsl:template>
+
+  <xsl:template match="*" mode="generate.id">
+    <xsl:value-of select="generate-id(.)"/>
+    <xsl:text>-bb</xsl:text>
+  </xsl:template>
+
+  <xsl:template name="strip-qualifiers-non-template">
+    <xsl:param name="name"/>
+    <xsl:choose>
+      <xsl:when test="contains($name, '&gt;')">
+        <xsl:call-template name="strip-qualifiers-non-template">
+          <xsl:with-param name="name" select="substring-after($name, '&gt;')"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="contains($name, '::')">
+        <xsl:call-template name="strip-qualifiers-non-template">
+          <xsl:with-param name="name" select="substring-after($name, '::')"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$name"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="strip-balanced">
+    <xsl:param name="name"/>
+    <xsl:param name="open" select="'&lt;'"/>
+    <xsl:param name="close" select="'&gt;'"/>
+    <xsl:param name="depth" select="0"/>
+    <xsl:choose>
+      <xsl:when test="contains($name, $open)
+                and not(contains(substring-before($name, $open), $close))">
+        <xsl:call-template name="strip-balanced">
+          <xsl:with-param name="name" select="substring-after($name, $open)"/>
+          <xsl:with-param name="open" select="$open"/>
+          <xsl:with-param name="close" select="$close"/>
+          <xsl:with-param name="depth" select="$depth + 1"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="contains($name, $close) and ($depth &gt; 1)">
+        <xsl:call-template name="strip-balanced">
+          <xsl:with-param name="name" select="substring-after($name, $close)"/>
+          <xsl:with-param name="open" select="$open"/>
+          <xsl:with-param name="close" select="$close"/>
+          <xsl:with-param name="depth" select="$depth - 1"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="substring-after($name, $close)"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="strip-qualifiers-template">
+    <xsl:param name="name"/>
+    <xsl:choose>
+      <xsl:when test="contains($name, '::')
+                and not(contains(substring-before($name, '::'), '&lt;'))">
+        <xsl:call-template name="strip-qualifiers-template">
+          <xsl:with-param name="name" select="substring-after($name, '::')"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:variable name="rest">
+          <xsl:call-template name="strip-balanced">
+            <xsl:with-param name="name" select="$name"/>
+          </xsl:call-template>
+        </xsl:variable>
+        <xsl:choose>
+          <xsl:when test="$rest != ''">
+            <xsl:call-template name="strip-qualifiers-template">
+              <xsl:with-param name="name" select="$rest"/>
+            </xsl:call-template>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$name"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Strip the qualifiers off a qualified name and return the unqualified
+       name. For instance, "boost::python::function" would become just
+       "function".
+       Must handle ns::foo                    -> foo
+       Must handle ns::foo<bar::baz>          -> foo<bar::baz>
+       Must handle ns::foo<bar::baz>::nested  -> nested
+       Must handle ns::foo<x>::bar<y>         -> bar<y> -->
+  <xsl:template name="strip-qualifiers">
+    <xsl:param name="name"/>
+    <xsl:choose>
+      <xsl:when test="substring($name, string-length($name)) = '&gt;'">
+        <xsl:call-template name="strip-qualifiers-template">
+          <xsl:with-param name="name" select="$name"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="strip-qualifiers-non-template">
+          <xsl:with-param name="name" select="$name"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Build the fully-qualified id of the given node -->
+  <xsl:template name="fully-qualified-id">
+    <xsl:param name="node"/>
+
+    <xsl:apply-templates select="$node" mode="fully-qualified-name">
+      <xsl:with-param name="is.id" select="true()"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <!-- Build the fully-qualified name of the given node -->
+  <xsl:template name="fully-qualified-name">
+    <xsl:param name="node"/>
+    <xsl:apply-templates select="$node" mode="fully-qualified-name"/>
+  </xsl:template>
+
+  <!-- Hack to make the node we are building the current node so that the
+       ancestor:: syntax will work -->
+  <xsl:template match="*" mode="fully-qualified-name">
+    <xsl:param name="is.id" select="false()" />
+    <xsl:call-template name="build-fully-qualified-name">
+      <xsl:with-param name="is.id" select="$is.id"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- The real routine that builds a fully-qualified name for the current
+       node. -->
+  <xsl:template name="build-fully-qualified-name">
+    <xsl:param name="is.id" select="false()" />
+
+    <!-- Determine the set of ancestor namespaces -->
+    <xsl:variable name="ancestors"
+      select="ancestor::namespace|
+                  ancestor::class|ancestor::struct|ancestor::union|
+                  ancestor::class-specialization|ancestor::struct-specialization|ancestor::union-specialization"/>
+
+    <xsl:for-each select="$ancestors">
+      <xsl:apply-templates select="." mode="fast-print-id-part">
+        <xsl:with-param name="is.id" select="$is.id"/>
+      </xsl:apply-templates>
+      <xsl:choose>
+        <xsl:when test="$is.id"><xsl:text>.</xsl:text></xsl:when>
+        <xsl:otherwise><xsl:text>::</xsl:text></xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+    <xsl:apply-templates select="." mode="fast-print-id-part">
+      <xsl:with-param name="is.id" select="$is.id"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <xsl:variable name="elements-with-ids">
+    <xsl:apply-templates select="namespace|class|struct|union|class-specialization|struct-specialization|union-specialization"
+                         mode="preprocess-ids"/>
+  </xsl:variable>
+  
+  <xsl:variable name="fast-elements" select="exsl:node-set($elements-with-ids)"/>
+  
+  <xsl:template match="*" mode="preprocess-ids">
+    <element>
+      <xsl:attribute name="id">
+        <xsl:value-of select="generate-id()"/>
+      </xsl:attribute>
+      <xsl:attribute name="part-id">
+        <xsl:call-template name="print-id-part"/>
+      </xsl:attribute>
+    </element>
+  </xsl:template>
+  
+  <xsl:template name="print-id-part">
+    <xsl:apply-templates select="." mode="print-id-part"/>
+  </xsl:template>
+  
+  <xsl:template match="*" mode="fast-print-id-part">
+    <xsl:param name="is.id"/>
+    <xsl:choose>
+      <xsl:when test="not($is.id)">
+        <xsl:apply-templates select="." mode="print-name"/>
+      </xsl:when>
+      <xsl:when test="$fast-elements[@id=generate-id()]">
+        <xsl:value-of select="$fast-elements[@id=generate-id()]/@part-id"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates select="." mode="print-id-part">
+          <xsl:with-param name="is.id" select="$is.id"/>
+        </xsl:apply-templates>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <!-- Print the part of a fully qualified name for a single element -->
+  <xsl:template match="*" mode="print-id-part">
+    <xsl:param name="is.id"/>
+
+    <xsl:variable name="part">
+      <xsl:apply-templates select="." mode="print-name"/>
+    </xsl:variable>
+
+    <xsl:variable name="unique-name">
+      <xsl:apply-templates select="." mode="unique.name"/>
+    </xsl:variable>
+
+    <xsl:choose>
+      <xsl:when test=
+        "$is.id and (
+          string-length($part) &gt; $boost.max.id.part.length or
+          $unique-name = 0 or
+          translate($part, '.&lt;&gt;;\:*?&quot;| ', '') != $part
+        )">
+        <xsl:variable name="normalized" select="translate(normalize-space(translate($part, '.&lt;&gt;;\:*?&quot;|_', '            ')), ' ', '_')"/>
+        <xsl:value-of select =
+          "concat(
+            substring($normalized, 1, $boost.max.id.part.length - string-length(generate-id(.) - 1)),
+            concat('_', generate-id(.)))"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$part"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Override this if an id might not be unique -->
+  <xsl:template match="*" mode="unique.name">
+    <xsl:value-of select="1"/>
+  </xsl:template>
+
+  <xsl:template match="function|overloaded-function" mode="unique.name">
+    <xsl:value-of select="number(count(key('named-entities',
+        translate(@name, $uppercase-letters, $lowercase-letters))) = 1)"/>
+  </xsl:template>
+
+  <!-- Print the name of the current node -->
+  <xsl:template match="*" mode="print-name">
+    <xsl:value-of select="@name"/>
+  </xsl:template>
+
+  <xsl:template match="template-arg" mode="print-name">
+    <xsl:if test="position() &gt; 1">
+      <xsl:text>, </xsl:text>
+    </xsl:if>
+    <xsl:value-of select="text()"/>
+    <xsl:if test="@pack=1">
+      <xsl:text>...</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template
+      match="struct-specialization|class-specialization|union-specialization"
+      mode="print-name">
+    <xsl:value-of select="@name"/>
+    <xsl:text>&lt;</xsl:text>
+    <xsl:apply-templates select="specialization/template-arg" mode="print-name"/>
+    <xsl:text>&gt;</xsl:text>
+  </xsl:template>
+  
+  <xsl:template name="concat-directives">
+    <xsl:param name="directives"/>
+    <xsl:for-each select="$directives">
+      <xsl:apply-templates select="." mode="print-name"/>
+      <xsl:text>::</xsl:text>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template name="find-nodes-matching-name">
+    <!-- The name we are looking for -->
+    <xsl:param name="name"/>
+
+    <!-- The context in which this name occurs -->
+    <xsl:param name="context"/>
+
+    <!-- The node that we are checking against -->
+    <xsl:param name="nodes"/>
+
+    <!-- The set of using directives for this context node -->
+    <xsl:variable name="directives"
+      select="$context/ancestor::*/using-namespace |
+                  $context/ancestor::namespace |
+                  $context/ancestor::*/using-class |
+                  $context/ancestor::class |
+                  $context/ancestor::struct"/>
+
+    <xsl:variable name="directives-str">
+      <xsl:call-template name="concat-directives">
+        <xsl:with-param name="directives" select="$directives"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:apply-templates select="$nodes" mode="generate-cxx-links">
+      <xsl:with-param name="name" select="$name"/>
+      <xsl:with-param name="directives-str" select="$directives-str"/>
+    </xsl:apply-templates>
+  </xsl:template>
+  
+  <xsl:template match="*" mode="generate-cxx-links">
+    <xsl:param name="name"/>
+    <xsl:param name="directives-str"/>
+
+    <xsl:variable name="node-name">
+      <xsl:call-template name="fully-qualified-name">
+        <xsl:with-param name="node" select="."/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:variable name="leading-chars"
+                  select="string-length($node-name) - string-length($name)"/>
+
+    <!-- Check if this node matches any visible namespace -->
+    <xsl:if test="string-length($node-name) &gt;= string-length($name) and
+                  substring($node-name, $leading-chars + 1,
+                                        string-length($name)) = $name">
+      <xsl:variable name="qualifiers"
+                    select="substring($node-name, 1, $leading-chars)"/>
+      <xsl:if test="contains($directives-str, $qualifiers)">
+        <xsl:variable name="myid">
+          <xsl:call-template name="generate.id">
+            <xsl:with-param name="node" select="."/>
+          </xsl:call-template>
+        </xsl:variable>
+        <cxx-link-helper>
+          <xsl:attribute name="id">
+            <xsl:value-of select="$myid"/>
+          </xsl:attribute>
+          <xsl:attribute name="namespace">
+            <xsl:value-of select="$qualifiers"/>
+          </xsl:attribute>
+          <xsl:text>random text</xsl:text>
+        </cxx-link-helper>
+      </xsl:if>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="cxx-link-name">
+    <!-- The actual lookup node -->
+    <xsl:param name="lookup"/>
+
+    <!-- The type of name to lookup (e.g., class) -->
+    <xsl:param name="type"/>
+
+    <!-- The name we are looking for -->
+    <xsl:param name="name"/>
+
+    <!-- The name we will display  -->
+    <xsl:param name="display-name"/>
+
+    <!-- The name we are looking for (unqualified)-->
+    <xsl:param name="unqualified-name"/>
+
+    <!-- The list of nodes that match the lookup node in both name and type -->
+    <xsl:param name="nodes"/>
+    
+    <!-- Filter the nodes to leave only the ones that are in scope. -->
+    <xsl:variable name="matches1">
+      <xsl:call-template name="find-nodes-matching-name">
+        <xsl:with-param name="name" select="$name"/>
+        <xsl:with-param name="nodes" select="$nodes"/>
+        <xsl:with-param name="context" select="$lookup"/>
+      </xsl:call-template>
+    </xsl:variable>
+    
+    <xsl:variable name="matches" select="exsl:node-set($matches1)//cxx-link-helper"/>
+
+    <xsl:choose>
+      <xsl:when test="count($matches) = 0">
+        <xsl:message>
+          <xsl:text>Cannot find </xsl:text>
+          <xsl:value-of select="$type"/>
+          <xsl:text> named '</xsl:text>
+          <xsl:value-of select="$name"/>
+          <xsl:text>'</xsl:text>
+        </xsl:message>
+        <xsl:value-of select="$display-name"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- If we found more than one, print a message and take the first -->
+        <xsl:if test="count($matches) &gt; 1">
+          <xsl:message>
+            <xsl:text>Reference to </xsl:text>
+            <xsl:value-of select="$type"/>
+            <xsl:text> '</xsl:text>
+            <xsl:value-of select="$name"/>
+            <xsl:text>' is ambiguous. Found:</xsl:text>
+            <xsl:for-each select="$matches">
+              <xsl:text>
+              Match in namespace ::</xsl:text>
+              <xsl:value-of select="@namespace"/>
+            </xsl:for-each>
+          </xsl:message>
+        </xsl:if>
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to">
+            <xsl:value-of select="$matches[position() = 1]/@id"/>
+          </xsl:with-param>
+          <xsl:with-param name="text" select="$display-name"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+</xsl:stylesheet>
diff --git a/xsl/api/macro.xsl b/xsl/api/macro.xsl
new file mode 100644 (file)
index 0000000..e396295
--- /dev/null
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+  
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+  <xsl:template match="macro" mode="synopsis">
+    <xsl:param name="indentation" select="0"/>
+
+    <xsl:text>&#10;</xsl:text>
+    <xsl:if 
+      test="not(local-name(preceding-sibling::*[position()=1])=local-name(.))">
+      <xsl:text>&#10;</xsl:text>
+    </xsl:if>
+    <xsl:call-template name="indent">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:call-template>
+    <xsl:call-template name="macro-synopsis">
+      <xsl:with-param name="link-type" select="'link'"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="macro" mode="reference">
+    <xsl:call-template name="reference-documentation">
+      <xsl:with-param name="refname" select="@name"/>
+      <xsl:with-param name="purpose" select="purpose/*|purpose/text()"/>
+      <xsl:with-param name="anchor">
+        <xsl:call-template name="generate.id"/>
+      </xsl:with-param>
+      <xsl:with-param name="name">
+        <xsl:text>Macro </xsl:text>
+        <xsl:call-template name="monospaced">
+          <xsl:with-param name="text" select="@name"/>
+        </xsl:call-template>
+      </xsl:with-param>
+      <xsl:with-param name="synopsis">
+        <xsl:call-template name="header-link"/>
+        <xsl:call-template name="macro-synopsis">
+          <xsl:with-param name="link-type" select="'none'"/>
+        </xsl:call-template>
+      </xsl:with-param>
+      <xsl:with-param name="text">
+        <xsl:apply-templates select="description"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="macro-synopsis">
+    <xsl:param name="link-type"/>
+
+    <xsl:call-template name="link-or-anchor">
+      <xsl:with-param name="to">
+        <xsl:call-template name="generate.id" select="."/>
+      </xsl:with-param>
+      <xsl:with-param name="text" select="@name"/>
+      <xsl:with-param name="link-type" select="$link-type"/>
+    </xsl:call-template>
+
+    <xsl:if test="@kind='functionlike'">
+      <xsl:text>(</xsl:text>
+      <xsl:for-each select="macro-parameter">
+        <xsl:if test="position() &gt; 1">
+          <xsl:text>, </xsl:text>
+        </xsl:if>
+        <xsl:value-of select="@name"/>
+      </xsl:for-each>
+      <xsl:text>)</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="macro" mode="generate.id">
+    <xsl:value-of select="@name"/>
+    <xsl:if test="count(key('named-entities',
+        translate(@name, $uppercase-letters, $lowercase-letters)))!=1">
+      <xsl:text>_</xsl:text>
+      <xsl:value-of select="generate-id(.)"/>
+    </xsl:if>
+  </xsl:template>
+</xsl:stylesheet>
diff --git a/xsl/api/manpages.xsl b/xsl/api/manpages.xsl
new file mode 100644 (file)
index 0000000..2f781c2
--- /dev/null
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+  
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+
+  <!-- Import the man pages stylesheet -->
+  <xsl:import 
+    href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
+
+  <xsl:param name="generate.manifest" select="1"/>
+  <xsl:param name="manifest">man.manifest</xsl:param>
+
+  <xsl:template match="literallayout">
+    <xsl:text>&#10;.nf&#10;</xsl:text>
+    <xsl:apply-templates/>
+    <xsl:text>&#10;.fi&#10;</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="para|simpara|remark" mode="list">
+    <xsl:variable name="foo">
+      <xsl:apply-templates/>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="literallayout">
+        <xsl:copy-of select="$foo"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="normalize-space($foo)"/>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:text>&#10;</xsl:text>
+    <xsl:if test="following-sibling::para or following-sibling::simpara or
+                  following-sibling::remark">
+      <!-- Make sure multiple paragraphs within a list item don't -->
+      <!-- merge together.                                        -->
+      <xsl:text>&#10;</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="build.refentry.filename">
+    <xsl:param name="node" select="."/>
+    <xsl:variable name="section" select="$node/refmeta/manvolnum"/>
+    <xsl:variable name="name" select="$node/refnamediv/refname[1]"/>
+    <xsl:value-of select="concat('man', $section, '/', 
+                                 translate(normalize-space($name), 
+                                          '&lt;&gt;', '__'), 
+                                 '.', $section)"/>
+                                    
+  </xsl:template>
+
+  <xsl:template match="refentry" mode="manifest">
+    <xsl:call-template name="build.refentry.filename"/>
+    <xsl:text>&#10;</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="/">
+    <xsl:choose>
+      <xsl:when test="//refentry">
+        <xsl:apply-templates select="//refentry"/>
+        <xsl:if test="$generate.manifest=1">
+          <xsl:call-template name="write.text.chunk">
+            <xsl:with-param name="filename" select="$manifest"/>
+            <xsl:with-param name="content">
+              <xsl:value-of select="$manifest"/>
+              <xsl:text>&#10;</xsl:text>
+              <xsl:apply-templates select="//refentry" mode="manifest"/>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:message>No refentry elements!</xsl:message>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<xsl:template match="refentry">
+  <xsl:variable name="section" select="refmeta/manvolnum"/>
+  <xsl:variable name="name" select="refnamediv/refname[1]"/>
+
+  <!-- standard man page width is 64 chars; 6 chars needed for the two
+       (x) volume numbers, and 2 spaces, leaves 56 -->
+  <xsl:variable name="twidth" select="(56 - string-length(refmeta/refentrytitle)) div 2"/>
+
+  <xsl:variable name="reftitle" 
+               select="substring(refmeta/refentrytitle, 1, $twidth)"/>
+
+  <xsl:variable name="title">
+    <xsl:choose>
+      <xsl:when test="refentryinfo/title">
+        <xsl:value-of select="refentryinfo/title"/>
+      </xsl:when>
+      <xsl:when test="../referenceinfo/title">
+        <xsl:value-of select="../referenceinfo/title"/>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="date">
+    <xsl:choose>
+      <xsl:when test="refentryinfo/date">
+        <xsl:value-of select="refentryinfo/date"/>
+      </xsl:when>
+      <xsl:when test="../referenceinfo/date">
+        <xsl:value-of select="../referenceinfo/date"/>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="productname">
+    <xsl:choose>
+      <xsl:when test="refentryinfo/productname">
+        <xsl:value-of select="refentryinfo/productname"/>
+      </xsl:when>
+      <xsl:when test="../referenceinfo/productname">
+        <xsl:value-of select="../referenceinfo/productname"/>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:call-template name="write.text.chunk">
+    <xsl:with-param name="filename">
+      <xsl:call-template name="build.refentry.filename"/>
+    </xsl:with-param>
+    <xsl:with-param name="content">
+      <xsl:text>.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "</xsl:text>
+      <xsl:value-of select="translate($reftitle,'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
+      <xsl:text>" </xsl:text>
+      <xsl:value-of select="refmeta/manvolnum[1]"/>
+      <xsl:text> "</xsl:text>
+      <xsl:value-of select="normalize-space($date)"/>
+      <xsl:text>" "</xsl:text>
+      <xsl:value-of select="normalize-space($productname)"/>
+      <xsl:text>" "</xsl:text>
+      <xsl:value-of select="$title"/>
+      <xsl:text>"
+</xsl:text>
+      <xsl:apply-templates/>
+      <xsl:text>&#10;</xsl:text>
+
+      <!-- Author section -->
+      <xsl:choose>
+        <xsl:when test="refentryinfo//author">
+          <xsl:apply-templates select="refentryinfo" mode="authorsect"/>
+        </xsl:when>
+        <xsl:when test="/book/bookinfo//author">
+          <xsl:apply-templates select="/book/bookinfo" mode="authorsect"/>
+        </xsl:when>
+        <xsl:when test="/article/articleinfo//author">
+          <xsl:apply-templates select="/article/articleinfo" mode="authorsect"/>
+        </xsl:when>
+      </xsl:choose>
+
+    </xsl:with-param>
+  </xsl:call-template>
+  <!-- Now generate stub include pages for every page documented in
+       this refentry (except the page itself) -->
+  <xsl:for-each select="refnamediv/refname">
+    <xsl:if test=". != $name">
+      <xsl:call-template name="write.text.chunk">
+       <xsl:with-param name="filename"
+                       select="concat(normalize-space(.), '.', $section)"/>
+       <xsl:with-param name="content" select="concat('.so man',
+             $section, '/', $name, '.', $section, '&#10;')"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:for-each>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/xsl/api/navbar.xsl b/xsl/api/navbar.xsl
new file mode 100644 (file)
index 0000000..bb7db77
--- /dev/null
@@ -0,0 +1,410 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+  
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:d="http://docbook.org/ns/docbook"
+                               xmlns:exsl="http://exslt.org/common"
+                               exclude-result-prefixes="exsl d"
+                version="1.0">
+
+<!-- Already included in the main style sheet -->
+<!-- <xsl:import href="relative-href.xsl"/> -->
+   <!--
+      boost.defaults:
+        *custom  - only use explicitly set parameters
+         Boost   - use standard boost settings, can be overridden
+   -->
+   <xsl:param name = "boost.defaults" select = "'none'"/>
+
+   <!--
+      how to render the Home | Libraries | ... | More contents
+        *none       - do not display ("standalone" mode)
+         horizontal - display in old-Boost style format (default for Boost)
+         vertical   - like the new Getting Started layout
+   -->
+   <xsl:param name = "nav.layout">
+      <xsl:choose>
+         <xsl:when test = "$boost.defaults='Boost'">horizontal</xsl:when>
+         <xsl:otherwise>none</xsl:otherwise>
+      </xsl:choose>
+   </xsl:param>
+   <!--
+      header border layout
+         Boost - place the old-Boost border around the header
+        *none  - do not place a border around the header
+   -->
+   <xsl:param name = "nav.border" select = "'none'" />
+
+   <!--
+      nav.flow:
+         none    - do not display navigation at the header
+         DocBook - display the navigation after the header
+        *Spirit  - display "mini" navigation on the right
+   -->
+   <xsl:param name = "nav.flow" select = "'Spirit'"/>
+   
+   <!-- location of the various Boost elements -->
+
+   <xsl:param name = "boost.root"      select = "'../..'"/>
+   <xsl:param name = "boost.website"   select = "'http://www.boost.org'"/>
+   <!-- Logo image location, leave empty for no logo -->
+   <xsl:param name = "boost.image.src">
+      <xsl:if test = "$boost.defaults = 'Boost'">
+         <xsl:value-of select = "concat($boost.root, '/boost.png')"/>
+      </xsl:if>
+   </xsl:param>
+   <xsl:param name = "boost.image.alt">
+      <xsl:if test = "$boost.defaults = 'Boost'">
+         <xsl:value-of select = "'Boost C++ Libraries'"/>
+      </xsl:if>
+   </xsl:param>
+   <xsl:param name = "boost.image.w">
+      <xsl:if test = "$boost.defaults = 'Boost'">
+         <xsl:value-of select = "277"/>
+      </xsl:if>
+   </xsl:param>
+   <xsl:param name = "boost.image.h">
+      <xsl:if test = "$boost.defaults = 'Boost'">
+         <xsl:value-of select = "86"/>
+      </xsl:if>
+   </xsl:param>
+   <xsl:param name = "boost.libraries">
+      <xsl:if test = "$boost.defaults = 'Boost'">
+         <xsl:value-of select = "concat($boost.root, '/libs/libraries.htm')"/>
+      </xsl:if>
+   </xsl:param>
+
+   <!-- header -->
+
+   <xsl:template name = "header.navigation">
+      <xsl:param name = "prev" select = "/foo"/>
+      <xsl:param name = "next" select = "/foo"/>
+      <xsl:param name = "nav.context"/>
+
+      <xsl:variable name = "home" select = "/*[1]"/>
+      <xsl:variable name = "up"   select = "parent::*"/>
+
+      <table cellpadding = "2" width = "100%"><tr>
+         <xsl:if test = "$nav.border = 'Boost'">
+            <xsl:attribute name = "class">boost-head</xsl:attribute>
+         </xsl:if>
+
+         <td valign = "top">
+            <xsl:if test = "$nav.border = 'Boost'">
+               <xsl:attribute name = "style">background-color: white; width: 50%;</xsl:attribute>
+            </xsl:if>
+            <xsl:if test = "boolean(normalize-space($boost.image.src))">
+               <img alt="{$boost.image.alt}" width="{$boost.image.w}" height="{$boost.image.h}">
+                   <xsl:attribute name="src">
+                       <xsl:call-template name="href.target.relative">
+                           <xsl:with-param name="target" select="$boost.image.src"/>
+                       </xsl:call-template>
+                   </xsl:attribute>
+               </img>
+            </xsl:if>
+         </td><xsl:choose>
+            <xsl:when test = "$nav.layout = 'horizontal'">
+               <xsl:call-template name = "header.navdata-horiz"/>
+            </xsl:when><xsl:when test = "$nav.layout = 'vertical'">
+               <xsl:call-template name = "header.navdata-vert"/>
+            </xsl:when>
+         </xsl:choose>
+      </tr></table>
+      <hr/>
+      <xsl:choose>
+         <xsl:when test = "$nav.flow = 'DocBook'">
+            <table width = "100%" class = "navheader">
+               <xsl:call-template name = "navbar.docbook-homeinfo">
+                  <xsl:with-param name = "prev" select = "$prev"/>
+                  <xsl:with-param name = "next" select = "$next"/>
+                  <xsl:with-param name = "nav.context" select = "$nav.context"/>
+               </xsl:call-template>
+               <xsl:call-template name = "navbar.docbook-prevnext">
+                  <xsl:with-param name = "prev" select = "$prev"/>
+                  <xsl:with-param name = "next" select = "$next"/>
+                  <xsl:with-param name = "nav.context" select = "$nav.context"/>
+               </xsl:call-template>
+            </table>
+         </xsl:when><xsl:when test = "$nav.flow = 'Spirit'">
+            <xsl:call-template name = "navbar.spirit">
+               <xsl:with-param name = "prev" select = "$prev"/>
+               <xsl:with-param name = "next" select = "$next"/>
+               <xsl:with-param name = "nav.context" select = "$nav.context"/>
+            </xsl:call-template>
+         </xsl:when>
+      </xsl:choose>
+   </xsl:template>
+
+   <xsl:template name = "header.navdata-horiz">
+      <xsl:variable name="home_link">
+         <xsl:call-template name="href.target.relative">
+            <xsl:with-param name="target" select="concat( $boost.root, '/index.html' )"/>
+         </xsl:call-template>
+      </xsl:variable>
+      <xsl:variable name="libraries_link">
+         <xsl:if test = "boolean($boost.libraries)">
+            <xsl:call-template name="href.target.relative">
+               <xsl:with-param name="target" select="$boost.libraries"/>
+            </xsl:call-template>
+         </xsl:if>
+      </xsl:variable>
+      <xsl:variable name="people_link">
+         <xsl:call-template name="href.target.relative">
+            <xsl:with-param name="target" select="concat( $boost.website, '/users/people.html' )"/> 
+         </xsl:call-template>
+      </xsl:variable>
+      <xsl:variable name="faq_link">
+         <xsl:call-template name="href.target.relative">
+            <xsl:with-param name="target" select="concat( $boost.website, '/users/faq.html' )"/> 
+         </xsl:call-template>
+      </xsl:variable>
+      <xsl:variable name="more_link">
+         <xsl:call-template name="href.target.relative">
+            <xsl:with-param name="target" select="concat( $boost.root, '/more/index.htm' )"/>
+         </xsl:call-template>
+      </xsl:variable>
+      
+      <xsl:choose>
+         <xsl:when test = "$nav.border = 'Boost'">
+            <td align = "center" class = "boost-headtd"><a href = "{$home_link}" class = "boost-headelem">Home</a></td>
+            <xsl:if test = "boolean($libraries_link)">
+              <td align = "center" class = "boost-headtd"><a href = "{$libraries_link}" class = "boost-headelem">Libraries</a></td>
+            </xsl:if>
+            <td align = "center" class = "boost-headtd"><a href = "{$people_link}" class = "boost-headelem">People</a></td>
+            <td align = "center" class = "boost-headtd"><a href = "{$faq_link}" class = "boost-headelem">FAQ</a></td>
+            <td align = "center" class = "boost-headtd"><a href = "{$more_link}" class = "boost-headelem">More</a></td>
+         </xsl:when><xsl:otherwise>
+            <td align = "center"><a href = "{$home_link}">Home</a></td>
+            <td align = "center"><a href = "{$libraries_link}">Libraries</a></td>
+            <td align = "center"><a href = "{$people_link}">People</a></td>
+            <td align = "center"><a href = "{$faq_link}">FAQ</a></td>
+            <td align = "center"><a href = "{$more_link}">More</a></td>
+         </xsl:otherwise>
+      </xsl:choose>
+   </xsl:template>
+
+   <xsl:template name = "header.navdata-vert">
+      <xsl:variable name="home_link">
+         <xsl:call-template name="href.target.relative">
+            <xsl:with-param name="target" select="concat( $boost.root, '/index.html' )"/>
+         </xsl:call-template>
+      </xsl:variable>
+      <xsl:variable name="libraries_link">
+         <xsl:call-template name="href.target.relative">
+            <xsl:with-param name="target" select="$boost.libraries"/>
+         </xsl:call-template>
+      </xsl:variable>
+      <xsl:variable name="people_link">
+         <xsl:call-template name="href.target.relative">
+            <xsl:with-param name="target" select="concat( $boost.website, '/users/people.html' )"/>
+         </xsl:call-template>
+      </xsl:variable>
+      <xsl:variable name="faq_link">
+         <xsl:call-template name="href.target.relative">
+            <xsl:with-param name="target" select="concat( $boost.website, '/users/faq.html' )"/>
+         </xsl:call-template>
+      </xsl:variable>
+      <xsl:variable name="more_link">
+         <xsl:call-template name="href.target.relative">
+            <xsl:with-param name="target" select="concat( $boost.root, '/more/index.htm' )"/>
+         </xsl:call-template>
+      </xsl:variable>
+
+      <td><div>
+         <xsl:if test = "$nav.border != 'Boost'">
+            <xsl:attribute name = "class">boost-toc</xsl:attribute>
+         </xsl:if>
+         <div><a href = "{$home_link}">Home</a></div>
+         <div><a href = "{$libraries_link}">Libraries</a></div>
+         <div><a href = "{$people_link}">People</a></div>
+         <div><a href = "{$faq_link}">FAQ</a></div>
+         <div><a href = "{$more_link}">More</a></div>
+      </div></td>
+   </xsl:template>
+
+
+   <!-- footer -->
+
+   <xsl:template name = "footer.navigation">
+      <xsl:param name = "prev" select = "/foo"/>
+      <xsl:param name = "next" select = "/foo"/>
+      <xsl:param name = "nav.context"/>
+
+      <hr/>
+      <xsl:choose>
+         <xsl:when test = "$nav.flow = 'DocBook'">
+            <table width = "100%" class = "navheader">
+               <xsl:call-template name = "navbar.docbook-prevnext">
+                  <xsl:with-param name = "prev" select = "$prev"/>
+                  <xsl:with-param name = "next" select = "$next"/>
+                  <xsl:with-param name = "nav.context" select = "$nav.context"/>
+               </xsl:call-template>
+               <xsl:call-template name = "navbar.docbook-homeinfo">
+                  <xsl:with-param name = "prev" select = "$prev"/>
+                  <xsl:with-param name = "next" select = "$next"/>
+                  <xsl:with-param name = "nav.context" select = "$nav.context"/>
+               </xsl:call-template>
+            </table>
+         </xsl:when><xsl:when test = "$nav.flow = 'Spirit'">
+            <xsl:call-template name = "navbar.spirit">
+               <xsl:with-param name = "prev" select = "$prev"/>
+               <xsl:with-param name = "next" select = "$next"/>
+               <xsl:with-param name = "nav.context" select = "$nav.context"/>
+            </xsl:call-template>
+         </xsl:when>
+      </xsl:choose>
+   </xsl:template>
+
+   <!-- navbar -->
+
+   <xsl:template name = "navbar.docbook-homeinfo">
+      <xsl:param name = "prev" select = "/foo"/>
+      <xsl:param name = "next" select = "/foo"/>
+      <xsl:param name = "nav.context"/>
+
+      <xsl:variable name = "home" select = "/*[1]"/>
+      <tr>
+         <td align = "left" width = "40%">
+            <xsl:if test = "$navig.showtitles != 0"> <!-- prev:name -->
+               <xsl:apply-templates select = "$prev" mode = "object.title.markup"/>
+            </xsl:if>
+         </td><td align = "center" width = "20%">
+            <!-- home -->
+            <xsl:if test = "$home != . or $nav.context = 'toc'">
+               <a accesskey = "h">
+                  <xsl:attribute name = "href"><xsl:call-template name = "href.target">
+                     <xsl:with-param name = "object" select = "$home"/>
+                  </xsl:call-template></xsl:attribute>
+                  <xsl:call-template name = "navig.content">
+                     <xsl:with-param name = "direction" select = "'home'"/>
+                  </xsl:call-template>
+               </a>
+               <xsl:if test = "$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
+                  <xsl:text>|</xsl:text>
+               </xsl:if>
+            </xsl:if>
+            <xsl:if test = "$chunk.tocs.and.lots != 0 and $nav.context != 'toc'"><a accesskey = "t">
+               <xsl:attribute name = "href">
+                  <xsl:apply-templates select = "/*[1]" mode = "recursive-chunk-filename"/>
+                  <xsl:text>-toc</xsl:text>
+                  <xsl:value-of select = "$html.ext"/>
+               </xsl:attribute>
+               <xsl:call-template name = "gentext">
+                  <xsl:with-param name = "key" select = "'nav-toc'"/>
+               </xsl:call-template>
+            </a></xsl:if>
+         </td><td align = "right" width = "40%">
+            <xsl:if test = "$navig.showtitles != 0"> <!-- next:name -->
+               <xsl:apply-templates select = "$next" mode = "object.title.markup"/>
+            </xsl:if>
+         </td>
+      </tr>
+   </xsl:template>
+
+   <xsl:template name = "navbar.docbook-prevnext">
+      <xsl:param name = "prev" select = "/foo"/>
+      <xsl:param name = "next" select = "/foo"/>
+      <xsl:param name = "nav.context"/>
+
+      <xsl:variable name = "up" select = "parent::*"/>
+      <tr>
+         <td align = "left" width = "40%">
+            <xsl:if test = "count($prev)>0"><a accesskey = "p"> <!-- prev -->
+               <xsl:attribute name = "href"><xsl:call-template name = "href.target">
+                   <xsl:with-param name = "object" select = "$prev"/>
+               </xsl:call-template></xsl:attribute>
+               <xsl:call-template name = "navig.content">
+                  <xsl:with-param name = "direction" select = "'prev'"/>
+               </xsl:call-template>
+            </a></xsl:if>
+         </td><td align = "center" width = "20%">
+            <xsl:if test = "count($up)>0"><a accesskey = "u"> <!-- up -->
+               <xsl:attribute name = "href"><xsl:call-template name = "href.target">
+                  <xsl:with-param name = "object" select = "$up"/>
+               </xsl:call-template></xsl:attribute>
+               <xsl:call-template name = "navig.content">
+                  <xsl:with-param name = "direction" select = "'up'"/>
+               </xsl:call-template>
+            </a></xsl:if>
+         </td><td align = "right" width = "40%">
+            <xsl:if test = "count($next)>0"><a accesskey = "n"> <!-- next -->
+               <xsl:attribute name = "href"><xsl:call-template name = "href.target">
+                  <xsl:with-param name = "object" select = "$next"/>
+               </xsl:call-template></xsl:attribute>
+               <xsl:call-template name = "navig.content">
+                  <xsl:with-param name = "direction" select = "'next'"/>
+               </xsl:call-template>
+            </a></xsl:if>
+         </td>
+      </tr>
+   </xsl:template>
+
+   <xsl:template name = "navbar.spirit">
+      <xsl:param name = "prev" select = "/foo"/>
+      <xsl:param name = "next" select = "/foo"/>
+      <xsl:param name = "nav.context"/>
+
+      <xsl:variable name = "home" select = "/*[1]"/>
+      <xsl:variable name = "up"   select = "parent::*"/>
+
+      <div class = "spirit-nav">
+         <!-- prev -->
+         <xsl:if test = "count($prev)>0"><a accesskey = "p">
+            <xsl:attribute name = "href"><xsl:call-template name = "href.target">
+               <xsl:with-param name = "object" select = "$prev"/>
+            </xsl:call-template></xsl:attribute>
+            <xsl:call-template name = "navig.content">
+               <xsl:with-param name = "direction" select = "'prev'"/>
+            </xsl:call-template>
+         </a></xsl:if>
+         <!-- up -->
+         <xsl:if test = "count($up)>0"><a accesskey = "u">
+            <xsl:attribute name = "href"><xsl:call-template name = "href.target">
+               <xsl:with-param name = "object" select = "$up"/>
+            </xsl:call-template></xsl:attribute>
+            <xsl:call-template name = "navig.content">
+               <xsl:with-param name = "direction" select = "'up'"/>
+            </xsl:call-template>
+         </a></xsl:if>
+         <!-- home -->
+         <xsl:if test = "generate-id($home) != generate-id(.) or $nav.context = 'toc'">
+            <a accesskey = "h">
+               <xsl:attribute name = "href"><xsl:call-template name = "href.target">
+                  <xsl:with-param name = "object" select = "$home"/>
+               </xsl:call-template></xsl:attribute>
+               <xsl:call-template name = "navig.content">
+                  <xsl:with-param name = "direction" select = "'home'"/>
+               </xsl:call-template>
+            </a>
+            <xsl:if test = "$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
+               <xsl:text>|</xsl:text>
+            </xsl:if>
+         </xsl:if>
+         <xsl:if test = "$chunk.tocs.and.lots != 0 and $nav.context != 'toc'"><a accesskey = "t">
+            <xsl:attribute name = "href">
+               <xsl:apply-templates select = "/*[1]" mode = "recursive-chunk-filename"/>
+               <xsl:text>-toc</xsl:text>
+               <xsl:value-of select = "$html.ext"/>
+            </xsl:attribute>
+            <xsl:call-template name = "gentext">
+               <xsl:with-param name = "key" select = "'nav-toc'"/>
+            </xsl:call-template>
+         </a></xsl:if>
+         <!-- next -->
+         <xsl:if test = "count($next)>0"><a accesskey = "n">
+            <xsl:attribute name = "href"><xsl:call-template name = "href.target">
+               <xsl:with-param name = "object" select = "$next"/>
+            </xsl:call-template></xsl:attribute>
+            <xsl:call-template name = "navig.content">
+               <xsl:with-param name = "direction" select = "'next'"/>
+            </xsl:call-template>
+         </a></xsl:if>
+      </div>
+   </xsl:template>
+</xsl:stylesheet>
diff --git a/xsl/api/reference.xsl b/xsl/api/reference.xsl
new file mode 100644 (file)
index 0000000..fd3b46b
--- /dev/null
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+  <xsl:include href="annotation.xsl"/>
+  <xsl:include href="template.xsl"/>
+  <xsl:include href="function.xsl"/>
+  <xsl:include href="type.xsl"/>
+  <xsl:include href="source-highlight.xsl"/>
+  <xsl:include href="utility.xsl"/>
+  <xsl:include href="lookup.xsl"/>
+  <xsl:include href="library.xsl"/>
+  <xsl:include href="index.xsl"/>
+  <xsl:include href="error.xsl"/>
+  <xsl:include href="macro.xsl"/>
+  <xsl:include href="testing/testsuite.xsl"/>
+  <xsl:include href="caramel/concept2docbook.xsl"/>
+
+  <xsl:template name="namespace-synopsis">
+    <xsl:param name="indentation" select="0"/>
+    <!-- Open namespace-->
+    <xsl:call-template name="indent">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:call-template>
+    <xsl:call-template name="source-highlight">
+      <xsl:with-param name="text" select="concat('namespace ',@name)"/>
+    </xsl:call-template>
+    <xsl:text> {</xsl:text>
+
+    <!-- Emit namespace types -->
+    <xsl:apply-templates select="class|class-specialization|
+                                 struct|struct-specialization|
+                                 union|union-specialization|
+                                 typedef|enum|data-member" mode="synopsis">
+      <xsl:with-param name="indentation" select="$indentation + 2"/>
+    </xsl:apply-templates>
+
+    <!-- Emit namespace functions -->
+    <xsl:apply-templates
+      select="free-function-group|function|overloaded-function"
+      mode="synopsis">
+      <xsl:with-param name="indentation" select="$indentation + 2"/>
+    </xsl:apply-templates>
+
+    <!-- Emit namespaces -->
+    <xsl:apply-templates select="namespace" mode="synopsis">
+      <xsl:with-param name="indentation" select="$indentation + 2"/>
+    </xsl:apply-templates>
+
+    <!-- Close namespace -->
+    <xsl:text>&#10;</xsl:text>
+    <xsl:call-template name="indent">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:call-template>
+    <xsl:text>}</xsl:text>
+  </xsl:template>
+
+  <!-- Emit namespace synopsis -->
+  <xsl:template match="namespace" mode="synopsis">
+    <xsl:param name="indentation" select="0"/>
+
+    <xsl:choose>
+      <xsl:when test="count(ancestor::namespace)=0">
+        <xsl:call-template name="namespace-synopsis">
+          <xsl:with-param name="indentation" select="$indentation"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text>&#10;</xsl:text>
+        <xsl:call-template name="namespace-synopsis">
+          <xsl:with-param name="indentation" select="$indentation"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Emit namespace reference -->
+  <xsl:template match="namespace" mode="reference">
+    <xsl:apply-templates select="namespace|free-function-group"
+      mode="reference">
+      <xsl:with-param name="indentation" select="0"/>
+    </xsl:apply-templates>
+    <xsl:apply-templates select="class|class-specialization|
+                                 struct|struct-specialization|
+                                 union|union-specialization|enum|function|
+                                 overloaded-function|data-member|typedef"
+      mode="namespace-reference"/>
+  </xsl:template>
+
+  <!-- Eat extra documentation when in the synopsis or reference sections -->
+  <xsl:template match="para|section" mode="synopsis"/>
+  <xsl:template match="para|section" mode="reference"/>
+
+  <!-- Comment mode tries to wipe out any extra spacing in the output -->
+  <xsl:template match="purpose" mode="comment">
+    <xsl:apply-templates mode="comment"/>
+  </xsl:template>
+
+  <xsl:template match="simpara|para" mode="comment">
+    <xsl:apply-templates select="text()|*" mode="comment"/>
+  </xsl:template>
+
+  <xsl:template match="text()" mode="comment">
+    <xsl:value-of select="."/>
+  </xsl:template>
+
+  <xsl:template match="*" mode="comment">
+    <xsl:apply-templates select="." mode="annotation"/>
+  </xsl:template>
+</xsl:stylesheet>
diff --git a/xsl/api/relative-href.xsl b/xsl/api/relative-href.xsl
new file mode 100644 (file)
index 0000000..25d0095
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+  
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:d="http://docbook.org/ns/docbook"
+                               xmlns:exsl="http://exslt.org/common"
+                               exclude-result-prefixes="exsl d"
+                version="1.0">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/lib/lib.xsl"/>
+
+<!-- ==================================================================== -->
+
+<!-- Check if path is absolute
+
+    Not attempting to fully parse or validate absolute vs. relative URI.
+    Assumes an absolute url when $target matches the regex '^[a-zA-Z.+-]*:'
+
+    According to RFC1808, however, the colon (':') may also appear in a relative
+    URL. To workaround this limitation for relative links containing colons one
+    may use the alternatives below, instead.
+
+    For the relative URI this:that use ./this:that or this%3Athat, instead.
+-->
+<xsl:template name="is.absolute.uri">
+    <xsl:param name="uri"/>
+
+    <xsl:variable name="scheme1" select="substring-before($uri, ':')"/>
+    <xsl:variable name="scheme2" select="translate($scheme1, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.', '')"/>
+
+    <xsl:choose>
+        <xsl:when test="$scheme1 and not($scheme2)">1</xsl:when>
+        <xsl:otherwise>0</xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template name="href.target.relative">
+    <xsl:param name="target"/>
+    <xsl:param name="context" select="."/>
+
+    <xsl:variable name="isabsoluteuri">
+        <xsl:call-template name="is.absolute.uri">
+            <xsl:with-param name="uri" select="$target"/>
+        </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:choose>
+        <xsl:when test="$isabsoluteuri='1'">
+            <xsl:value-of select="$target"/>
+        </xsl:when>
+
+        <xsl:otherwise>
+            <xsl:variable name="href.to.uri" select="$target"/>
+            <xsl:variable name="href.from.uri">
+                <xsl:call-template name="href.target.uri">
+                    <xsl:with-param name="object" select="$context"/>
+                </xsl:call-template>
+            </xsl:variable>
+
+            <xsl:variable name="href.to">
+                <xsl:call-template name="trim.common.uri.paths">
+                    <xsl:with-param name="uriA" select="$href.to.uri"/>
+                    <xsl:with-param name="uriB" select="$href.from.uri"/>
+                    <xsl:with-param name="return" select="'A'"/>
+                </xsl:call-template>
+            </xsl:variable>
+
+            <xsl:variable name="href.from">
+                <xsl:call-template name="trim.common.uri.paths">
+                    <xsl:with-param name="uriA" select="$href.to.uri"/>
+                    <xsl:with-param name="uriB" select="$href.from.uri"/>
+                    <xsl:with-param name="return" select="'B'"/>
+                </xsl:call-template>
+            </xsl:variable>
+
+            <xsl:variable name="depth">
+                <xsl:call-template name="count.uri.path.depth">
+                    <xsl:with-param name="filename" select="$href.from"/>
+                </xsl:call-template>
+            </xsl:variable>
+
+            <xsl:variable name="href">
+                <xsl:call-template name="copy-string">
+                    <xsl:with-param name="string" select="'../'"/>
+                    <xsl:with-param name="count" select="$depth"/>
+                </xsl:call-template>
+                <xsl:value-of select="$href.to"/>
+            </xsl:variable>
+
+            <xsl:value-of select="$href"/>
+        </xsl:otherwise>
+    </xsl:choose>
+
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/xsl/api/source-highlight.xsl b/xsl/api/source-highlight.xsl
new file mode 100644 (file)
index 0000000..3f46640
--- /dev/null
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+  
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+  <xsl:param name="boost.syntax.highlight">1</xsl:param>
+
+  <xsl:template name="source-highlight">
+    <xsl:param name="text" select="."/>
+    <xsl:choose>
+      <xsl:when test="$boost.syntax.highlight='1'">
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="$text"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$text"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:variable name="id-chars" select="'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_'"/>
+  <xsl:variable name="keywords"
+    select="' asm auto bool break case catch char class const const_cast continue default delete do double dynamic_cast else enum explicit export extern false float for friend goto if inline int long mutable namespace new operator private protected public register reinterpret_cast return short signed sizeof static static_cast struct switch template this throw true try typedef typeid typename union unsigned using virtual void volatile wchar_t while '"/>
+    
+
+  <xsl:template name="highlight-identifier">
+    <xsl:param name="identifier"/>
+    <xsl:choose>
+      <xsl:when test="contains($keywords, concat(' ', $identifier, ' '))">
+        <xsl:call-template name="highlight-keyword">
+          <xsl:with-param name="keyword" select="$identifier"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$identifier"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template name="highlight-text-impl-ident">
+    <xsl:param name="text"/>
+    <xsl:param name="pos"/>
+    <xsl:choose>
+      <xsl:when test="string-length($text) + 1 = $pos">
+        <xsl:call-template name="highlight-identifier">
+          <xsl:with-param name="identifier" select="substring($text, 1, $pos - 1)"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="contains($id-chars, substring($text, $pos, 1))">
+        <xsl:call-template name ="highlight-text-impl-ident">
+          <xsl:with-param name="text" select="$text"/>
+          <xsl:with-param name="pos" select="$pos + 1"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="highlight-identifier">
+          <xsl:with-param name="identifier" select="substring($text, 1, $pos - 1)"/>
+        </xsl:call-template>
+        <xsl:call-template name ="highlight-text-impl-root">
+          <xsl:with-param name="text" select="substring($text, $pos)"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template name="highlight-text-impl-root">
+    <xsl:param name="text"/>
+    <xsl:choose>
+      <xsl:when test="string-length($text) = 0"/>
+      <xsl:when test="contains($id-chars, substring($text, 1, 1))">
+        <xsl:call-template name="highlight-text-impl-ident">
+          <xsl:with-param name="text" select="$text"/>
+          <xsl:with-param name="pos" select="2"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="substring($text, 1, 1)"/>
+        <xsl:call-template name="highlight-text-impl-root">
+          <xsl:with-param name="text" select="substring($text, 2)"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Perform C++ keyword highlighting on the given text -->
+  <xsl:template name="highlight-text">
+    <xsl:param name="text" select="."/>
+    <xsl:call-template name="highlight-text-impl-root">
+      <xsl:with-param name="text" select="$text"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="*" mode="highlight">
+    <xsl:element name="{name(.)}">
+      <xsl:for-each select="./@*">
+        <xsl:choose>
+          <xsl:when test="local-name(.)='last-revision'">
+            <xsl:attribute
+              name="rev:last-revision"
+              namespace="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"
+>
+              <xsl:value-of select="."/>
+            </xsl:attribute>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:attribute name="{name(.)}">
+              <xsl:value-of select="."/>
+            </xsl:attribute>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:for-each>
+      <xsl:apply-templates mode="highlight"/>
+    </xsl:element>
+  </xsl:template>
+
+  <xsl:template match="text()" mode="highlight">
+    <xsl:call-template name="source-highlight">
+      <xsl:with-param name="text" select="."/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="classname|methodname|functionname|libraryname|enumname|
+                       conceptname|macroname|globalname" mode="highlight">
+    <xsl:apply-templates select="." mode="annotation"/>
+  </xsl:template>
+</xsl:stylesheet>
diff --git a/xsl/api/template.xsl b/xsl/api/template.xsl
new file mode 100644 (file)
index 0000000..730cb55
--- /dev/null
@@ -0,0 +1,448 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+  
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+  <!-- Determine the length of a template header synopsis -->
+  <xsl:template name="template.synopsis.length">
+    <xsl:variable name="text">
+      <xsl:apply-templates select="template" mode="synopsis">
+        <xsl:with-param name="indentation" select="0"/>
+        <xsl:with-param name="wrap" select="false()"/>
+        <xsl:with-param name="highlight" select="false()"/>
+      </xsl:apply-templates>
+    </xsl:variable>
+    <xsl:value-of select="string-length($text)"/>
+  </xsl:template>
+
+  <!-- Determine the length of a template header reference -->
+  <xsl:template name="template.reference.length">
+    <xsl:choose>
+      <xsl:when test="not(template)">
+        0
+      </xsl:when>
+      <xsl:when test="template/*/purpose">
+        <!-- TBD: The resulting value need only be greater than the number of
+             columns. We chose to add 17 because it's funny for C++
+             programmers. :) -->
+        <xsl:value-of select="$max-columns + 17"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="template.synopsis.length"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Output a template header in synopsis mode -->
+  <xsl:template match="template" mode="synopsis">
+    <xsl:param name="indentation" select="0"/>
+    <xsl:param name="wrap" select="true()"/>
+    <xsl:param name="highlight" select="true()"/>
+
+    <xsl:call-template name="template.synopsis"> 
+      <xsl:with-param name="indentation" select="$indentation"/>
+      <xsl:with-param name="wrap" select="$wrap"/>
+      <xsl:with-param name="highlight" select="$highlight"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- Output a template header in reference mode -->
+  <xsl:template match="template" mode="reference">
+    <xsl:param name="indentation" select="0"/>
+    <xsl:param name="highlight" select="true()"/>
+    <xsl:call-template name="template.reference">
+      <xsl:with-param name="indentation" select="$indentation"/>
+      <xsl:with-param name="highlight" select="$highlight"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- Emit a template header synopsis -->
+  <xsl:template name="template.synopsis">
+    <xsl:param name="indentation" select="0"/>
+    <xsl:param name="wrap" select="true()"/>
+    <xsl:param name="highlight" select="true()"/>
+
+    <xsl:choose>
+      <xsl:when test="$highlight">
+        <xsl:call-template name="highlight-keyword">
+          <xsl:with-param name="keyword" select="'template'"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text>template</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:text>&lt;</xsl:text>
+    <xsl:call-template name="template.synopsis.parameters">
+      <xsl:with-param name="indentation" select="$indentation + 9"/>
+      <xsl:with-param name="wrap" select="$wrap"/>
+      <xsl:with-param name="highlight" select="$highlight"/>
+    </xsl:call-template>
+    <xsl:text>&gt; </xsl:text>
+  </xsl:template>
+
+  <!-- Display a list of template parameters for a synopsis (no comments) -->
+  <xsl:template name="template.synopsis.parameters">
+    <xsl:param name="indentation"/>
+    <xsl:param name="wrap" select="true()"/>
+    <xsl:param name="highlight" select="true()"/>
+
+    <xsl:param name="column" select="$indentation"/>
+    <xsl:param name="prefix" select="''"/>
+    <xsl:param name="parameters" select="template-type-parameter|template-varargs|template-nontype-parameter"/>
+    <xsl:param name="first-on-line" select="true()"/>
+
+    <xsl:if test="$parameters">
+      <!-- Emit the prefix (either a comma-space, or empty if this is
+           the first parameter) -->
+      <xsl:value-of select="$prefix"/>
+
+      <!-- Get the actual parameter and its attributes -->
+      <xsl:variable name="parameter" select="$parameters[position()=1]"/>
+      <xsl:variable name="rest" select="$parameters[position()!=1]"/>
+
+      <!-- Compute the actual text of this parameter -->
+      <xsl:variable name="text">
+        <xsl:call-template name="template.parameter">
+          <xsl:with-param name="parameter" select="$parameter"/>
+          <xsl:with-param name="is-last" select="not(rest)"/>
+          <xsl:with-param name="highlight" select="false()"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <!-- Where will this template parameter finish? -->
+      <xsl:variable name="end-column" 
+        select="$column + string-length($prefix) + string-length($text)"/>
+
+      <!-- Should the text go on this line or on the next? -->
+      <xsl:choose>
+        <xsl:when test="$first-on-line or ($end-column &lt; $max-columns) or
+                        not($wrap)">
+          <!-- Print on this line -->
+          <xsl:call-template name="template.parameter">
+            <xsl:with-param name="parameter" select="$parameter"/>
+            <xsl:with-param name="is-last" select="not($rest)"/>
+            <xsl:with-param name="highlight" select="$highlight"/>
+          </xsl:call-template>
+          
+          <!-- Recurse -->
+          <xsl:call-template name="template.synopsis.parameters">
+            <xsl:with-param name="indentation" select="$indentation"/>
+            <xsl:with-param name="wrap" select="$wrap"/>
+            <xsl:with-param name="highlight" select="$highlight"/>
+            <xsl:with-param name="column" select="$end-column"/>
+            <xsl:with-param name="prefix" select="', '"/>
+            <xsl:with-param name="parameters" select="$rest"/>
+            <xsl:with-param name="first-on-line" select="false()"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <!-- Print on next line -->
+          <xsl:text>&#10;</xsl:text>
+          <xsl:call-template name="indent">
+            <xsl:with-param name="indentation" select="$indentation"/>
+          </xsl:call-template>
+          <xsl:call-template name="template.parameter">
+            <xsl:with-param name="parameter" select="$parameter"/>
+            <xsl:with-param name="is-last" select="not($rest)"/>
+            <xsl:with-param name="highlight" select="$highlight"/>
+          </xsl:call-template>
+
+          <xsl:call-template name="template.synopsis.parameters">
+            <xsl:with-param name="indentation" select="$indentation"/>
+            <xsl:with-param name="wrap" select="$wrap"/>
+            <xsl:with-param name="highlight" select="$highlight"/>
+            <xsl:with-param name="column" 
+              select="$indentation + string-length($text)"/>
+            <xsl:with-param name="prefix" select="', '"/>
+            <xsl:with-param name="parameters" select="$rest"/>
+            <xsl:with-param name="first-on-line" select="false()"/>           
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Emit a template header reference -->
+  <xsl:template name="template.reference">
+    <xsl:param name="indentation" select="0"/>
+    <xsl:param name="highlight" select="true()"/>
+
+    <xsl:if test="template-type-parameter|template-varargs|template-nontype-parameter">
+      <xsl:choose>
+        <xsl:when test="$highlight">
+          <xsl:call-template name="highlight-keyword">
+            <xsl:with-param name="keyword" select="'template'"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>template</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:text>&lt;</xsl:text>
+      <xsl:call-template name="template.reference.parameters">
+        <xsl:with-param name="indentation" select="$indentation + 9"/>
+        <xsl:with-param name="highlight" select="$highlight"/>
+      </xsl:call-template>
+      <xsl:text>&gt; </xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Display a set of template parameters for a reference -->
+  <xsl:template name="template.reference.parameters">
+    <xsl:param name="indentation"/>
+    <xsl:param name="highlight" select="true()"/>
+    <xsl:param name="parameters" select="template-type-parameter|template-varargs|template-nontype-parameter"/>
+
+    <xsl:choose>
+      <xsl:when test="$parameters/purpose">
+        <xsl:call-template name="template.reference.parameters.comments">
+          <xsl:with-param name="indentation" select="$indentation"/>
+          <xsl:with-param name="highlight" select="$highlight"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="template.synopsis.parameters">
+          <xsl:with-param name="indentation" select="$indentation"/>
+          <xsl:with-param name="wrap" select="true()"/>
+          <xsl:with-param name="highlight" select="$highlight"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Output template parameters when there are comments with the parameters.
+       For clarity, we output each template parameter on a separate line. -->
+  <xsl:template name="template.reference.parameters.comments">
+    <xsl:param name="indentation"/>
+    <xsl:param name="highlight" select="true()"/>
+    <xsl:param name="parameters" select="template-type-parameter|template-varargs|template-nontype-parameter"/>
+
+    <xsl:if test="$parameters">
+      <!-- Get the actual parameter and its attributes -->
+      <xsl:variable name="parameter" select="$parameters[position()=1]"/>
+      <xsl:variable name="rest" select="$parameters[position()!=1]"/>
+
+      <!-- Display the parameter -->
+      <xsl:call-template name="template.parameter">
+        <xsl:with-param name="parameter" select="$parameter"/>
+        <xsl:with-param name="is-last" select="not($rest)"/>
+        <xsl:with-param name="highlight" select="$highlight"/>
+      </xsl:call-template>
+
+      <xsl:if test="$rest">
+        <xsl:text>, </xsl:text>
+      </xsl:if>
+
+      <!-- Display the comment -->
+      <xsl:if test="$parameter/purpose">
+        <xsl:call-template name="highlight-comment">
+          <xsl:with-param name="text">
+            <xsl:text>  // </xsl:text>
+            <xsl:apply-templates 
+              select="$parameter/purpose/*|$parameter/purpose/text()"/>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+
+      <!-- Indent the next line -->
+      <xsl:if test="$parameter/purpose or $rest">
+        <xsl:text>&#10;</xsl:text>
+        <xsl:call-template name="indent">
+          <xsl:with-param name="indentation" select="$indentation"/>
+        </xsl:call-template>
+      </xsl:if>
+
+      <!-- Recurse to print the rest of the parameters -->
+      <xsl:call-template name="template.reference.parameters.comments">
+        <xsl:with-param name="indentation" select="$indentation"/>
+        <xsl:with-param name="highlight" select="$highlight"/>
+        <xsl:with-param name="parameters" select="$rest"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Print a template parameter -->
+  <xsl:template name="template.parameter">
+    <xsl:param name="parameter"/>
+    <xsl:param name="is-last"/>
+    <xsl:param name="highlight" select="true()"/>
+    <xsl:apply-templates select="$parameter"
+      mode="print.parameter">
+      <xsl:with-param name="parameter" select="$parameter"/>
+      <xsl:with-param name="is-last" select="$is-last"/>
+      <xsl:with-param name="highlight" select="$highlight"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <xsl:template name="template.parameter.name">
+    <xsl:param name="name" select="@name"/>
+    <xsl:param name="highlight" select="true()"/>
+    
+    <xsl:choose>
+      <xsl:when test="$highlight">
+        <xsl:call-template name="concept.link">
+          <xsl:with-param name="name" 
+            select="translate($name, '0123456789', '')"/>
+          <xsl:with-param name="text" select="$name"/>
+          <xsl:with-param name="warn" select="false"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$name"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="template-type-parameter" mode="print.parameter">
+    <xsl:param name="parameter"/>
+    <xsl:param name="is-last"/>
+    <xsl:param name="highlight"/>
+
+    <xsl:choose>
+      <xsl:when test="$highlight">
+        <xsl:call-template name="highlight-keyword">
+          <xsl:with-param name="keyword" select="'typename'"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text>typename</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:if test="$parameter/@pack=1"><xsl:text>...</xsl:text></xsl:if>
+    <xsl:text> </xsl:text>
+
+    <xsl:call-template name="template.parameter.name">
+      <xsl:with-param name="name" select="$parameter/@name"/>
+      <xsl:with-param name="highlight" select="$highlight"/>
+    </xsl:call-template>
+
+    <xsl:variable name="def">
+      <xsl:choose>
+        <xsl:when test="$parameter/@default">
+          <xsl:message>
+            <xsl:text>Warning: 'default' attribute of template parameter element is deprecated. Use 'default' element.</xsl:text>
+            <xsl:call-template name="print.warning.context"/>
+          </xsl:message>
+          <xsl:choose>
+            <xsl:when test="$highlight and false()">
+              <xsl:call-template name="source-highlight">
+                <xsl:with-param name="text">
+                  <xsl:value-of select="$parameter/@default"/>
+                </xsl:with-param>
+              </xsl:call-template>       
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="$parameter/@default"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+        <xsl:when test="$parameter/default">
+          <xsl:choose>
+            <xsl:when test="$highlight">
+              <xsl:apply-templates 
+                select="$parameter/default/*|$parameter/default/text()" 
+                mode="highlight"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="string($parameter/default)"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:if test="not($def='')">
+      <xsl:text> = </xsl:text>
+
+      <xsl:copy-of select="$def"/>
+
+      <!-- If this is the last parameter, add an extra space to
+           avoid printing >> -->
+      <xsl:if 
+        test="$is-last and (substring($def, string-length($def))='&gt;')">
+        <xsl:text> </xsl:text>
+      </xsl:if>
+    </xsl:if>    
+  </xsl:template>
+
+  <xsl:template match="template-nontype-parameter" mode="print.parameter">
+    <xsl:param name="parameter"/>
+    <xsl:param name="is-last"/>
+    <xsl:param name="highlight"/>
+
+    <xsl:choose>
+      <xsl:when test="$highlight">
+        <xsl:call-template name="source-highlight">
+          <xsl:with-param name="text">
+            <xsl:apply-templates 
+              select="$parameter/type/*|$parameter/type/text()"/>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$parameter/type/*|$parameter/type/text()"/>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:if test="$parameter/@pack=1"><xsl:text>...</xsl:text></xsl:if>
+    <xsl:text> </xsl:text>
+
+    <xsl:call-template name="template.parameter.name">
+      <xsl:with-param name="name" select="$parameter/@name"/>
+      <xsl:with-param name="highlight" select="$highlight"/>
+    </xsl:call-template>
+
+    <xsl:variable name="def">
+      <xsl:value-of select="string($parameter/default)"/>
+    </xsl:variable>
+
+    <xsl:if test="not($def='')">
+      <xsl:text> = </xsl:text>
+
+      <xsl:choose>
+        <xsl:when test="$highlight">
+          <xsl:apply-templates select="$parameter/default/*|$parameter/default/text()" mode="highlight"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$def"/>
+        </xsl:otherwise>
+      </xsl:choose>
+
+      <!-- If this is the last parameter, add an extra space to
+           avoid printing >> -->
+      <xsl:if 
+        test="$is-last and (substring($def, string-length($def))='&gt;')">
+        <xsl:text> </xsl:text>
+      </xsl:if>
+    </xsl:if>    
+  </xsl:template>
+
+  <xsl:template match="template-varargs" mode="print.parameter">
+    <xsl:text>...</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="specialization">
+    <xsl:param name="highlight" select="true()"/>
+    <xsl:text>&lt;</xsl:text>
+    <xsl:apply-templates select="template-arg">
+      <xsl:with-param name="highlight" select="$highlight"/>
+    </xsl:apply-templates>
+    <xsl:text>&gt;</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="template-arg">
+    <xsl:if test="position() &gt; 1">
+      <xsl:text>, </xsl:text>
+    </xsl:if>
+    <xsl:apply-templates mode="highlight"/>
+    <xsl:if test="@pack=1">
+      <xsl:text>...</xsl:text>
+    </xsl:if>
+  </xsl:template>
+</xsl:stylesheet>
+
diff --git a/xsl/api/type.xsl b/xsl/api/type.xsl
new file mode 100644 (file)
index 0000000..dde6de4
--- /dev/null
@@ -0,0 +1,1492 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+   Copyright (c) 2007 Frank Mori Hess <fmhess@users.sourceforge.net>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+
+  <xsl:include href="global.xsl"/>
+  <xsl:strip-space elements="inherit purpose"/>
+
+  <!-- When true, the stylesheet will emit compact definitions of
+       enumerations when the enumeration does not have any detailed
+       description. A compact definition renders the enum definition along
+       with a comment for the purpose of the enum (if it exists) directly
+       within the synopsis. A non-compact definition will create a
+       separate refentry element for the enum. -->
+  <xsl:param name="boost.compact.enum">1</xsl:param>
+
+  <!-- When true, the stylesheet will emit compact definitions of
+       typedefs when the typedef does not have any detailed
+       description. -->
+  <xsl:param name="boost.compact.typedef">1</xsl:param>
+
+  <xsl:template match="class|struct|union" mode="generate.id">
+    <xsl:call-template name="fully-qualified-id">
+      <xsl:with-param name="node" select="."/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="class-specialization|struct-specialization|union-specialization" mode="generate.id">
+    <xsl:call-template name="fully-qualified-id">
+      <xsl:with-param name="node" select="."/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="typedef" mode="generate.id">
+    <xsl:call-template name="fully-qualified-id">
+      <xsl:with-param name="node" select="."/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="enum" mode="generate.id">
+    <xsl:call-template name="fully-qualified-id">
+      <xsl:with-param name="node" select="."/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="enumvalue" mode="generate.id">
+    <xsl:call-template name="fully-qualified-id">
+      <xsl:with-param name="node" select="parent::enum"/>
+    </xsl:call-template>
+    <xsl:text>.</xsl:text>
+    <xsl:value-of select="@name"/>
+  </xsl:template>
+
+  <!-- Display the full name of the current node, e.g., "Class
+       template function". -->
+  <xsl:template name="type.display.name">
+    <xsl:choose>
+      <xsl:when test="contains(local-name(.), 'class')">
+        <xsl:text>Class </xsl:text>
+      </xsl:when>
+      <xsl:when test="contains(local-name(.), 'struct')">
+        <xsl:text>Struct </xsl:text>
+      </xsl:when>
+      <xsl:when test="contains(local-name(.), 'union')">
+        <xsl:text>Union </xsl:text>
+      </xsl:when>
+      <xsl:when test="local-name(.)='enum'">
+        <xsl:text>Type </xsl:text>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:message>
+Unknown type element "<xsl:value-of select="local-name(.)"/>" in type.display.name
+        </xsl:message>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:if test="template and count(template/*) &gt; 0">
+      <xsl:text>template </xsl:text>
+    </xsl:if>
+    <xsl:call-template name="monospaced">
+      <xsl:with-param name="text">
+        <xsl:value-of select="@name"/>
+        <xsl:apply-templates select="specialization"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- Determine the class key for the given node -->
+  <xsl:template name="type.class.key">
+    <xsl:param name="node" select="."/>
+    <xsl:choose>
+      <xsl:when test="contains(local-name($node), '-specialization')">
+        <xsl:value-of select="substring-before(local-name($node), '-')"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="local-name($node)"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Emit class synopsis -->
+  <xsl:template match="class|class-specialization|
+                       struct|struct-specialization|
+                       union|union-specialization" mode="synopsis">
+    <xsl:param name="indentation"/>
+
+    <!-- The keyword used to declare this class type, e.g., class,
+         struct, or union. -->
+    <xsl:variable name="class-key">
+      <xsl:call-template name="type.class.key"/>
+    </xsl:variable>
+
+    <!-- Spacing -->
+    <xsl:if test="not (local-name(preceding-sibling::*[position()=1])=local-name(.)) and (position() &gt; 1)">
+      <xsl:text>&#10;</xsl:text>
+    </xsl:if>
+
+    <xsl:text>&#10;</xsl:text>
+
+    <!-- Calculate how long this declaration would be if we put it all
+         on one line -->
+    <xsl:variable name="full-decl-string">
+      <xsl:apply-templates select="template" mode="synopsis">
+        <xsl:with-param name="indentation" select="$indentation"/>
+        <xsl:with-param name="wrap" select="false()"/>
+      </xsl:apply-templates>
+      <xsl:value-of select="$class-key"/>
+      <xsl:text> </xsl:text>
+      <xsl:value-of select="@name"/>
+      <xsl:apply-templates select="specialization"/>
+      <xsl:text>;</xsl:text>
+    </xsl:variable>
+
+    <xsl:choose>
+      <xsl:when test="(string-length($full-decl-string) +
+                       string-length($indentation)) &lt; $max-columns">
+        <xsl:call-template name="indent">
+          <xsl:with-param name="indentation" select="$indentation"/>
+        </xsl:call-template>
+        <xsl:apply-templates select="template" mode="synopsis">
+          <xsl:with-param name="indentation" select="$indentation"/>
+        </xsl:apply-templates>
+
+        <xsl:call-template name="highlight-keyword">
+          <xsl:with-param name="keyword" select="$class-key"/>
+        </xsl:call-template>
+        <xsl:text> </xsl:text>
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to">
+            <xsl:call-template name="generate.id"/>
+          </xsl:with-param>
+          <xsl:with-param name="text">
+            <xsl:value-of select="@name"/>
+          </xsl:with-param>
+        </xsl:call-template>
+        <xsl:apply-templates select="specialization"/>
+        <xsl:text>;</xsl:text>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <!-- Template header -->
+        <xsl:if test="template">
+          <xsl:call-template name="indent">
+            <xsl:with-param name="indentation" select="$indentation"/>
+          </xsl:call-template>
+          <xsl:apply-templates select="template" mode="synopsis">
+            <xsl:with-param name="indentation" select="$indentation"/>
+          </xsl:apply-templates>
+          <xsl:text>&#10;</xsl:text>
+
+          <!-- Indent class templates' names in the synopsis -->
+          <xsl:text>  </xsl:text>
+        </xsl:if>
+
+        <!-- Class name -->
+        <xsl:call-template name="indent">
+          <xsl:with-param name="indentation" select="$indentation"/>
+        </xsl:call-template>
+        <xsl:call-template name="highlight-keyword">
+          <xsl:with-param name="keyword" select="$class-key"/>
+        </xsl:call-template>
+        <xsl:text> </xsl:text>
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to">
+            <xsl:call-template name="generate.id">
+              <xsl:with-param name="node" select="."/>
+            </xsl:call-template>
+          </xsl:with-param>
+          <xsl:with-param name="text" select="string(@name)"/>
+        </xsl:call-template>
+        <xsl:apply-templates select="specialization"/>
+        <xsl:text>;</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+
+    <!-- Free functions associated with the class -->
+    <xsl:apply-templates select="free-function-group" mode="header-synopsis">
+      <xsl:with-param name="indentation" select="$indentation"/>
+      <xsl:with-param name="class" select="@name"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <!-- Emit a typedef synopsis -->
+  <xsl:template name="type.typedef.display.aligned">
+    <xsl:param name="compact"/>
+    <xsl:param name="indentation"/>
+    <xsl:param name="is-reference"/>
+    <xsl:param name="max-type-length"/>
+    <xsl:param name="max-name-length"/>
+
+    <!-- What type of link the typedef name should have. This shall
+         be one of 'anchor' (the typedef output will be the target of
+         links), 'link' (the typedef output will link to a definition), or
+         'none' (the typedef output will not be either a link or a link
+         target) -->
+    <xsl:param name="link-type">
+      <xsl:choose>
+        <xsl:when test="$is-reference">
+          <xsl:text>anchor</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>link</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:param>
+
+    <!-- The id we should link to or anchor as -->
+    <xsl:param name="link-to">
+      <xsl:call-template name="generate.id"/>
+    </xsl:param>
+
+    <!-- The id we should link to or anchor as -->
+    <xsl:param name="typedef-name">
+      <xsl:value-of select="@name"/>
+    </xsl:param>
+
+    <!-- Padding for the typedef types -->
+    <xsl:variable name="type-padding">
+      <xsl:call-template name="indent">
+        <xsl:with-param name="indentation" select="$max-type-length"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <!-- Padding for the typedef names -->
+    <xsl:variable name="name-padding">
+      <xsl:call-template name="indent">
+        <xsl:with-param name="indentation" select="$max-name-length"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:text>&#10;</xsl:text>
+    <xsl:choose>
+      <!-- Create a vertical ellipsis -->
+      <xsl:when test="@name = '...'">
+        <xsl:call-template name="indent">
+          <xsl:with-param name="indentation" select="$indentation + 3"/>
+        </xsl:call-template>
+        <xsl:text>.&#10;</xsl:text>
+        <xsl:call-template name="indent">
+          <xsl:with-param name="indentation" select="$indentation + 3"/>
+        </xsl:call-template>
+        <xsl:text>.&#10;</xsl:text>
+        <xsl:call-template name="indent">
+          <xsl:with-param name="indentation" select="$indentation + 3"/>
+        </xsl:call-template>
+        <xsl:text>.</xsl:text>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="indent">
+          <xsl:with-param name="indentation" select="$indentation"/>
+        </xsl:call-template>
+        <xsl:call-template name="highlight-keyword">
+          <xsl:with-param name="keyword" select="'typedef'"/>
+        </xsl:call-template>
+        <xsl:text> </xsl:text>
+
+        <!-- Length of the type -->
+        <xsl:variable name="type-length">
+          <xsl:choose>
+            <xsl:when test="@type">
+              <xsl:message>
+                <xsl:text>Warning: `type' attribute of `typedef' element is deprecated. Use 'type' element instead.</xsl:text>
+              </xsl:message>
+              <xsl:call-template name="print.warning.context"/>
+              <xsl:value-of select="string-length(@type)"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="string-length(type)"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+
+        <!-- Emit the type -->
+        <xsl:choose>
+          <xsl:when test="@type">
+            <xsl:value-of select="@type"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates select="type/*|type/text()"
+              mode="highlight"/>
+            <!--
+            <xsl:call-template name="source-highlight">
+              <xsl:with-param name="text">
+                <xsl:apply-templates select="type/*|type/text()"/>
+              </xsl:with-param>
+            </xsl:call-template>
+            -->
+          </xsl:otherwise>
+        </xsl:choose>
+
+        <xsl:choose>
+          <xsl:when test="$max-type-length &gt; 0">
+            <xsl:value-of select="substring($type-padding, 1,
+                                            $max-type-length - $type-length)"/>
+            <xsl:text> </xsl:text>
+            <xsl:variable name="truncated-typedef-name" select="substring(@name,
+              1, $max-name-length)"/>
+            <xsl:call-template name="link-or-anchor">
+              <xsl:with-param name="to" select="$link-to"/>
+              <xsl:with-param name="text" select="$truncated-typedef-name"/>
+              <xsl:with-param name="link-type" select="$link-type"/>
+              <xsl:with-param name="highlight" select="true()"/>
+            </xsl:call-template>
+            <xsl:value-of select="substring(concat(';', $name-padding),
+              1, $max-name-length - string-length($truncated-typedef-name))"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text> </xsl:text>
+            <xsl:call-template name="link-or-anchor">
+              <xsl:with-param name="to" select="$link-to"/>
+              <xsl:with-param name="text" select="$typedef-name"/>
+              <xsl:with-param name="link-type" select="$link-type"/>
+              <xsl:with-param name="highlight" select="true()"/>
+            </xsl:call-template>
+            <xsl:text>;</xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+
+        <xsl:if test="$compact and purpose">
+          <xsl:text>  </xsl:text>
+          <xsl:call-template name="highlight-comment">
+            <xsl:with-param name="text">
+              <xsl:text>// </xsl:text>
+              <xsl:apply-templates select="purpose" mode="comment"/>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="typedef" mode="synopsis">
+    <xsl:param name="indentation"/>
+    <xsl:param name="max-type-length" select="0"/>
+    <xsl:param name="max-name-length" select="0"/>
+    <xsl:param name="allow-anchor" select="true()"/>
+
+    <!-- True if we should compact this typedef -->
+    <xsl:variable name="compact"
+      select="not (para|description) and ($boost.compact.typedef='1')"/>
+
+    <xsl:choose>
+      <xsl:when test="$compact">
+        <!-- Spacing -->
+        <xsl:if test="not (local-name(preceding-sibling::*[position()=1])=local-name(.)) and (position() &gt; 1)">
+          <xsl:text>&#10;</xsl:text>
+        </xsl:if>
+
+        <xsl:call-template name="type.typedef.display.aligned">
+          <xsl:with-param name="compact" select="$compact"/>
+          <xsl:with-param name="indentation" select="$indentation"/>
+          <xsl:with-param name="is-reference" select="$allow-anchor"/>
+          <xsl:with-param name="max-type-length" select="$max-type-length"/>
+          <xsl:with-param name="max-name-length" select="$max-name-length"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="type.typedef.display.aligned">
+          <xsl:with-param name="compact" select="$compact"/>
+          <xsl:with-param name="indentation" select="$indentation"/>
+          <xsl:with-param name="is-reference" select="false()"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Emit a typedef reference entry -->
+  <xsl:template match="typedef" mode="namespace-reference">
+    <!-- True if this typedef was compacted -->
+    <xsl:variable name="compact"
+      select="not (para|description) and ($boost.compact.typedef='1')"/>
+
+    <xsl:if test="not ($compact)">
+      <xsl:call-template name="reference-documentation">
+        <xsl:with-param name="refname" select="@name"/>
+        <xsl:with-param name="purpose" select="purpose/*|purpose/text()"/>
+        <xsl:with-param name="anchor">
+          <xsl:call-template name="generate.id"/>
+        </xsl:with-param>
+        <xsl:with-param name="name">
+          <xsl:text>Type definition </xsl:text>
+          <xsl:call-template name="monospaced">
+            <xsl:with-param name="text" select="@name"/>
+          </xsl:call-template>
+        </xsl:with-param>
+        <xsl:with-param name="synopsis">
+          <xsl:call-template name="header-link"/>
+          <xsl:call-template name="type.typedef.display.aligned">
+            <xsl:with-param name="compact" select="false()"/>
+            <xsl:with-param name="indentation" select="0"/>
+            <xsl:with-param name="is-reference" select="true()"/>
+            <xsl:with-param name="link-type" select="'none'"/>
+          </xsl:call-template>
+        </xsl:with-param>
+        <xsl:with-param name="text">
+          <xsl:apply-templates select="description"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="typedef" mode="reference">
+    <!-- True if this typedef was compacted -->
+    <xsl:variable name="compact"
+      select="not (para|description) and ($boost.compact.typedef='1')"/>
+
+    <xsl:if test="not ($compact)">
+      <listitem>
+        <para>
+          <xsl:call-template name="type.typedef.display.aligned">
+            <xsl:with-param name="compact" select="false()"/>
+            <xsl:with-param name="indentation" select="0"/>
+            <xsl:with-param name="is-reference" select="true()"/>
+            <xsl:with-param name="link-type" select="'anchor'"/>
+          </xsl:call-template>
+        </para>
+        <xsl:apply-templates select="description"/>
+      </listitem>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Emit a list of static constants -->
+  <xsl:template match="static-constant" mode="synopsis">
+    <xsl:param name="indentation"/>
+    <xsl:text>&#10;</xsl:text>
+
+    <xsl:call-template name="indent">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:call-template>
+    <xsl:call-template name="source-highlight">
+      <xsl:with-param name="text" select="'static const '"/>
+    </xsl:call-template>
+
+    <xsl:apply-templates select="type" mode="highlight"/>
+
+    <xsl:if test="not(@name = '')">
+      <xsl:text> </xsl:text>
+      <xsl:value-of select="@name"/>
+    </xsl:if>
+
+    <xsl:text> = </xsl:text>
+
+    <xsl:call-template name="source-highlight">
+      <xsl:with-param name="text">
+        <xsl:apply-templates select="default/*|default/text()"/>
+      </xsl:with-param>
+    </xsl:call-template>
+    <xsl:text>;</xsl:text>
+
+    <xsl:if test="purpose">
+      <xsl:text>  </xsl:text>
+      <xsl:call-template name="highlight-comment">
+        <xsl:with-param name="text">
+          <xsl:text>// </xsl:text>
+          <xsl:apply-templates select="purpose" mode="comment"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Format base classes on a single line -->
+  <xsl:template name="print.base.classes.single">
+    <xsl:apply-templates select="inherit"/>
+  </xsl:template>
+
+  <xsl:template name="print.base.classes.multi">
+    <xsl:param name="indentation"/>
+
+    <xsl:variable name="n" select="count(inherit)"/>
+    <xsl:for-each select="inherit">
+      <!-- Indentation -->
+      <xsl:if test="position() &gt; 1">
+        <xsl:call-template name="indent">
+          <xsl:with-param name="indentation" select="$indentation"/>
+        </xsl:call-template>
+      </xsl:if>
+
+      <!-- Output the access specifier -->
+      <xsl:variable name="access">
+        <xsl:choose>
+          <xsl:when test="@access">
+            <xsl:value-of select="@access"/>
+          </xsl:when>
+          <xsl:when test="parent::class|parent::class-specialization">
+            <xsl:text>private</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>public</xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+      <xsl:call-template name="highlight-keyword">
+        <xsl:with-param name="keyword" select="@access"/>
+      </xsl:call-template>
+      <xsl:text> </xsl:text>
+
+      <!-- Output the type -->
+      <xsl:choose>
+        <xsl:when test="type">
+          <xsl:apply-templates select="type/*|type/text()" mode="annotation"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>
+            <xsl:text>Warning: missing 'type' element inside 'inherit'</xsl:text>
+          </xsl:message>
+          <xsl:call-template name="print.warning.context"/>
+          <xsl:apply-templates mode="annotation"/>
+        </xsl:otherwise>
+      </xsl:choose>
+
+      <xsl:if test="@pack=1"><xsl:text>...</xsl:text></xsl:if>
+
+      <!-- Output a comma if not at the end -->
+      <xsl:if test="position() &lt; $n">
+        <xsl:text>,</xsl:text>
+      </xsl:if>
+
+      <!-- Output a comment if we have one -->
+      <xsl:if test="purpose">
+        <xsl:choose>
+          <xsl:when test="position() &lt; $n">
+            <xsl:text>  </xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>   </xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+        <xsl:call-template name="highlight-comment">
+          <xsl:with-param name="text">
+            <xsl:text>// </xsl:text>
+            <xsl:apply-templates select="purpose"
+              mode="comment"/>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+
+      <xsl:if test="position() &lt; $n">
+        <xsl:text>&#10;</xsl:text>
+      </xsl:if>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template name="print.base.classes">
+    <xsl:param name="indentation" select="0"/>
+    <xsl:param name="base-indentation" select="0"/>
+
+    <xsl:variable name="single-line-candidate" select="not(inherit/purpose)"/>
+    <xsl:variable name="single-line">
+      <xsl:if test="$single-line-candidate">
+        <xsl:call-template name="print.base.classes.single"/>
+      </xsl:if>
+    </xsl:variable>
+
+    <xsl:choose>
+      <xsl:when test="$single-line-candidate and
+                      (string-length($single-line) + $indentation + 3
+                        &lt; $max-columns)">
+        <xsl:text> : </xsl:text>
+        <xsl:call-template name="print.base.classes.single"/>
+        <xsl:text> {</xsl:text>
+      </xsl:when>
+      <xsl:when test="$single-line-candidate and
+                      (string-length($single-line) + $base-indentation + 2
+                        &lt; $max-columns)">
+        <xsl:text> :&#10;</xsl:text>
+        <xsl:call-template name="indent">
+          <xsl:with-param name="indentation" select="$base-indentation + 2"/>
+        </xsl:call-template>
+        <xsl:call-template name="print.base.classes.single"/>
+        <xsl:text>&#10;</xsl:text>
+        <xsl:call-template name="indent">
+          <xsl:with-param name="indentation" select="$base-indentation"/>
+        </xsl:call-template>
+        <xsl:text>{</xsl:text>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text> : </xsl:text>
+        <xsl:call-template name="print.base.classes.multi">
+          <xsl:with-param name="indentation" select="$indentation + 3"/>
+        </xsl:call-template>
+        <xsl:text>&#10;</xsl:text>
+        <xsl:call-template name="indent">
+          <xsl:with-param name="indentation" select="$base-indentation"/>
+        </xsl:call-template>
+        <xsl:text>{</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Emit a list of base classes without comments and on a single line -->
+  <xsl:template match="inherit">
+    <xsl:choose>
+      <xsl:when test="position()=1">
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text>, </xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:call-template name="highlight-keyword">
+      <xsl:with-param name="keyword" select="@access"/>
+    </xsl:call-template>
+    <xsl:text> </xsl:text>
+    <xsl:apply-templates mode="annotation">
+      <xsl:with-param name="highlight" select="true()"/>
+    </xsl:apply-templates>
+    <xsl:if test="@pack=1"><xsl:text>...</xsl:text></xsl:if>
+  </xsl:template>
+
+  <!-- Find the maximum length of the types in typedefs -->
+  <xsl:template name="find-max-type-length">
+    <xsl:param name="typedefs" select="typedef"/>
+    <xsl:param name="max-length" select="0"/>
+    <xsl:param name="want-name" select="false()"/>
+
+    <xsl:choose>
+      <xsl:when test="$typedefs">
+        <xsl:variable name="typedef" select="$typedefs[position()=1]"/>
+        <xsl:variable name="rest" select="$typedefs[position()!=1]"/>
+
+        <!-- Find the length of the type -->
+        <xsl:variable name="length">
+          <xsl:choose>
+            <xsl:when test="$typedef/@name != '...'">
+              <xsl:choose>
+                <xsl:when test="$want-name">
+                  <xsl:value-of select="string-length($typedef/@name) + 1"/>
+                </xsl:when>
+                <xsl:when test="$typedef/@type">
+                  <xsl:value-of select="string-length($typedef/@type)"/>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:value-of select="string-length($typedef/type)"/>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:when>
+            <xsl:otherwise>
+              0
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+
+        <!-- Pass on the larger length -->
+        <xsl:choose>
+          <xsl:when test="$length &gt; $max-length">
+            <xsl:call-template name="find-max-type-length">
+              <xsl:with-param name="typedefs" select="$rest"/>
+              <xsl:with-param name="max-length" select="$length"/>
+              <xsl:with-param name="want-name" select="$want-name"/>
+            </xsl:call-template>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="find-max-type-length">
+              <xsl:with-param name="typedefs" select="$rest"/>
+              <xsl:with-param name="max-length" select="$max-length"/>
+              <xsl:with-param name="want-name" select="$want-name"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$max-length"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="constructor" mode="synopsis">
+    <xsl:param name="indentation"/>
+    <xsl:call-template name="function">
+      <xsl:with-param name="indentation" select="$indentation"/>
+      <xsl:with-param name="context" select="../@name"/>
+      <xsl:with-param name="is-reference" select="false()"/>
+      <xsl:with-param name="constructor-for">
+        <xsl:call-template name="object-name"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="copy-assignment" mode="synopsis">
+    <xsl:param name="indentation"/>
+    <xsl:call-template name="function">
+      <xsl:with-param name="indentation" select="$indentation"/>
+      <xsl:with-param name="context" select="../@name"/>
+      <xsl:with-param name="is-reference" select="false()"/>
+      <xsl:with-param name="copy-assign-for">
+        <xsl:call-template name="object-name"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template match="destructor" mode="synopsis">
+    <xsl:param name="indentation"/>
+    <xsl:call-template name="function">
+      <xsl:with-param name="indentation" select="$indentation"/>
+      <xsl:with-param name="context" select="../@name"/>
+      <xsl:with-param name="is-reference" select="false()"/>
+      <xsl:with-param name="destructor-for">
+        <xsl:call-template name="object-name"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="class-members-synopsis">
+    <xsl:param name="indentation" select="0"/>
+    <!-- Used to suppress anchors in nested synopsis, so we don't get multiple anchors -->
+    <xsl:param name="allow-synopsis-anchors" select="false()"/>
+
+    <!-- Typedefs -->
+    <xsl:if test="typedef">
+      <xsl:text>&#10;</xsl:text>
+      <xsl:call-template name="indent">
+        <xsl:with-param name="indentation" select="$indentation + 2"/>
+      </xsl:call-template>
+      <emphasis>
+        <xsl:text>// </xsl:text>
+        <!-- True if there are any non-compacted typedefs -->
+        <xsl:variable name="have-typedef-references"
+          select="typedef and ((typedef/para|typedef/description) or ($boost.compact.typedef='0'))"/>
+        <xsl:choose>
+          <xsl:when test="$have-typedef-references">
+            <xsl:call-template name="internal-link">
+              <xsl:with-param name="to">
+                <xsl:call-template name="generate.id"/>
+                <xsl:text>types</xsl:text>
+              </xsl:with-param>
+              <xsl:with-param name="text" select="'types'"/>
+            </xsl:call-template>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>types</xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </emphasis>
+
+      <xsl:variable name="max-type-length">
+        <xsl:call-template name="find-max-type-length"/>
+      </xsl:variable>
+      <xsl:variable name="max-name-length">
+        <xsl:call-template name="find-max-type-length">
+          <xsl:with-param name="want-name" select="true()"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:apply-templates select="typedef" mode="synopsis">
+        <xsl:with-param name="indentation" select="$indentation + 2"/>
+        <xsl:with-param name="max-type-length"
+          select="$max-type-length"/>
+        <xsl:with-param name="max-name-length"
+          select="$max-name-length"/>
+        <xsl:with-param name="allow-anchor" select="$allow-synopsis-anchors"/>
+      </xsl:apply-templates>
+    </xsl:if>
+
+    <!-- Static constants -->
+    <xsl:if test="static-constant">
+      <xsl:text>&#10;</xsl:text>
+      <xsl:if test="typedef">
+        <xsl:text>&#10;</xsl:text>
+      </xsl:if>
+      <xsl:call-template name="indent">
+        <xsl:with-param name="indentation" select="$indentation + 2"/>
+      </xsl:call-template>
+      <xsl:call-template name="highlight-comment">
+        <xsl:with-param name="text" select="'// static constants'"/>
+      </xsl:call-template>
+      <xsl:apply-templates select="static-constant" mode="synopsis">
+        <xsl:with-param name="indentation" select="$indentation + 2"/>
+      </xsl:apply-templates>
+    </xsl:if>
+
+    <!-- Nested classes/structs/unions -->
+    <xsl:if test="class|class-specialization|struct|struct-specialization|union|union-specialization">
+      <xsl:text>&#10;</xsl:text>
+      <xsl:if test="typedef|static-constant">
+        <xsl:text>&#10;</xsl:text>
+      </xsl:if>
+      <xsl:call-template name="indent">
+        <xsl:with-param name="indentation" select="$indentation + 2"/>
+      </xsl:call-template>
+      <xsl:call-template name="highlight-comment">
+        <xsl:with-param name="text" select="'// member classes/structs/unions'"/>
+      </xsl:call-template>
+      <xsl:apply-templates select="class|class-specialization|
+                                 struct|struct-specialization|
+                                 union|union-specialization"
+        mode="reference">
+        <xsl:with-param name="indentation" select="$indentation + 2"/>
+      </xsl:apply-templates>
+    </xsl:if>
+
+    <!-- Enums -->
+    <xsl:apply-templates select="enum" mode="synopsis">
+      <xsl:with-param name="indentation" select="$indentation + 2"/>
+    </xsl:apply-templates>
+
+    <!-- Construct/Copy/Destruct -->
+    <xsl:call-template name="construct-copy-destruct-synopsis">
+      <xsl:with-param name="indentation" select="$indentation + 2"/>
+    </xsl:call-template>
+
+    <!-- Member functions -->
+    <xsl:apply-templates
+      select="method-group|method|overloaded-method"
+      mode="synopsis">
+      <xsl:with-param name="indentation" select="$indentation + 2"/>
+    </xsl:apply-templates>
+
+    <!-- Data members -->
+    <xsl:apply-templates select="data-member" mode="synopsis">
+      <xsl:with-param name="indentation" select="$indentation + 2"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <xsl:template name="print-access-specification">
+    <xsl:param name="indentation" select="0"/>
+    <xsl:param name="specification" select="'public'"/>
+
+    <xsl:text>&#10;</xsl:text>
+    <xsl:call-template name="indent">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:call-template>
+    <xsl:call-template name="highlight-keyword">
+      <xsl:with-param name="keyword" select="$specification"/>
+    </xsl:call-template>
+    <xsl:text>:</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="access" mode="synopsis">
+    <xsl:param name="indentation" select="0"/>
+    <xsl:param name="allow-synopsis-anchors" select="false()"/>
+
+    <xsl:call-template name="print-access-specification">
+      <xsl:with-param name="indentation" select="$indentation"/>
+      <xsl:with-param name="specification" select="@name"/>
+    </xsl:call-template>
+    <xsl:call-template name="class-members-synopsis">
+      <xsl:with-param name="indentation" select="$indentation"/>
+      <xsl:with-param name="allow-synopsis-anchors" select="$allow-synopsis-anchors"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="class-type-synopsis">
+    <xsl:param name="indentation" select="0"/>
+    <xsl:param name="allow-synopsis-anchors" select="false()"/>
+
+    <!-- The keyword used to declare this class type, e.g., class,
+         struct, or union. -->
+    <xsl:variable name="class-key">
+      <xsl:call-template name="type.class.key"/>
+    </xsl:variable>
+
+    <xsl:if test="ancestor::class|ancestor::class-specialization|
+                  ancestor::struct|ancestor::struct-specialization|
+                  ancestor::union|ancestor::union-specialization">
+      <xsl:text>&#10;</xsl:text>
+
+      <!-- If this nested class has a "purpose" element, use it as a
+           comment. -->
+      <xsl:if test="purpose">
+        <xsl:text>&#10;</xsl:text>
+        <xsl:call-template name="indent">
+          <xsl:with-param name="indentation" select="$indentation"/>
+        </xsl:call-template>
+        <xsl:call-template name="highlight-comment">
+          <xsl:with-param name="text">
+            <xsl:text>// </xsl:text>
+            <xsl:apply-templates select="purpose" mode="comment"/>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:if>
+
+    <!-- Template header -->
+    <xsl:if test="template">
+      <xsl:call-template name="indent">
+        <xsl:with-param name="indentation" select="$indentation"/>
+      </xsl:call-template>
+      <xsl:apply-templates select="template" mode="reference">
+        <xsl:with-param name="indentation" select="$indentation"/>
+      </xsl:apply-templates>
+    </xsl:if>
+    <xsl:text>&#10;</xsl:text>
+
+    <!-- Class name -->
+    <xsl:call-template name="indent">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:call-template>
+    <xsl:call-template name="highlight-keyword">
+      <xsl:with-param name="keyword" select="$class-key"/>
+    </xsl:call-template>
+    <xsl:text> </xsl:text>
+
+    <!--  Make the class name a link to the class reference page (useful for nested classes) -->
+    <xsl:call-template name="internal-link">
+      <xsl:with-param name="to">
+        <xsl:call-template name="generate.id">
+          <xsl:with-param name="node" select="."/>
+        </xsl:call-template>
+      </xsl:with-param>
+      <xsl:with-param name="text">
+        <xsl:value-of select="@name"/>
+      </xsl:with-param>
+    </xsl:call-template>
+
+    <xsl:apply-templates select="specialization"/>
+
+    <xsl:choose>
+      <xsl:when test="inherit">
+        <!-- Base class list (with opening brace) -->
+        <xsl:call-template name="print.base.classes">
+          <xsl:with-param name="indentation"
+            select="string-length($class-key) + string-length(@name)
+                    + $indentation + 1"/>
+          <xsl:with-param name="base-indentation" select="$indentation"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- Opening brace -->
+        <xsl:text> {</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+
+    <!-- Default public designator for members not inside explicit <access> elements -->
+    <xsl:if test="contains(local-name(.), 'class')">
+      <xsl:if test="count(static-constant|typedef|enum|
+        copy-assignment|constructor|destructor|method-group|
+        method|overloaded-method|data-member|
+        class|class-specialization|
+        struct|struct-specialization|
+        union|union-specialization) &gt; 0">
+        <xsl:call-template name="print-access-specification">
+          <xsl:with-param name="indentation" select="$indentation"/>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:if>
+
+    <xsl:call-template name="class-members-synopsis">
+      <xsl:with-param name="indentation" select="$indentation"/>
+      <xsl:with-param name="allow-synopsis-anchors" select="$allow-synopsis-anchors"/>
+    </xsl:call-template>
+
+    <xsl:apply-templates select="access" mode="synopsis">
+      <xsl:with-param name="indentation" select="$indentation"/>
+      <xsl:with-param name="allow-synopsis-anchors" select="$allow-synopsis-anchors"/>
+    </xsl:apply-templates>
+
+    <!-- Closing brace -->
+    <xsl:text>&#10;</xsl:text>
+    <xsl:call-template name="indent">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:call-template>
+    <xsl:text>};</xsl:text>
+  </xsl:template>
+
+  <!-- Emit nested class reference documentation -->
+  <xsl:template match="class|class-specialization|
+                       struct|struct-specialization|
+                       union|union-specialization" mode="reference">
+    <xsl:param name="indentation"/>
+
+    <xsl:call-template name="class-type-synopsis">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="member-typedefs-reference">
+    <!-- True if there are any non-compacted typedefs -->
+    <xsl:variable name="have-typedef-references"
+      select="typedef and ((typedef/para|typedef/description) or ($boost.compact.typedef='0'))"/>
+    <xsl:if test="$have-typedef-references">
+      <xsl:call-template name="member-documentation">
+        <xsl:with-param name="name">
+          <xsl:call-template name="anchor">
+            <xsl:with-param name="to">
+              <xsl:call-template name="generate.id"/>
+              <xsl:text>types</xsl:text>
+            </xsl:with-param>
+            <xsl:with-param name="text" select="''"/>
+          </xsl:call-template>
+          <xsl:call-template name="monospaced">
+            <xsl:with-param name="text">
+              <xsl:call-template name="object-name"/>
+            </xsl:with-param>
+          </xsl:call-template>
+          <xsl:text> </xsl:text>
+          <xsl:call-template name="access-name"/>
+          <xsl:text> types</xsl:text>
+        </xsl:with-param>
+        <xsl:with-param name="text">
+          <orderedlist>
+            <xsl:apply-templates select="typedef" mode="reference"/>
+          </orderedlist>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+ </xsl:template>
+
+  <xsl:template name="class-members-reference">
+
+    <xsl:call-template name="member-typedefs-reference"/>
+
+    <xsl:call-template name="construct-copy-destruct-reference"/>
+
+    <xsl:apply-templates
+      select="method-group|method|overloaded-method"
+      mode="reference"/>
+
+    <!-- Emit reference docs for nested classes -->
+    <xsl:apply-templates
+      select="class|class-specialization|
+              struct|struct-specialization|
+              union|union-specialization"
+      mode="namespace-reference"/>
+
+    <!-- Emit reference docs for nested enums -->
+    <xsl:apply-templates
+      select="enum"
+      mode="namespace-reference"/>
+  </xsl:template>
+
+  <xsl:template match="access" mode="namespace-reference">
+    <xsl:call-template name="class-members-reference"/>
+  </xsl:template>
+
+  <!-- Emit namespace-level class reference documentation -->
+  <xsl:template match="class|class-specialization|
+                       struct|struct-specialization|
+                       union|union-specialization" mode="namespace-reference">
+    <xsl:param name="indentation" select="0"/>
+
+    <xsl:call-template name="separator"/>
+    <xsl:call-template name="reference-documentation">
+      <xsl:with-param name="refname">
+        <xsl:call-template name="fully-qualified-name">
+          <xsl:with-param name="node" select="."/>
+        </xsl:call-template>
+      </xsl:with-param>
+      <xsl:with-param name="purpose" select="purpose/*|purpose/text()"/>
+      <xsl:with-param name="anchor">
+        <xsl:call-template name="generate.id">
+          <xsl:with-param name="node" select="."/>
+        </xsl:call-template>
+      </xsl:with-param>
+      <xsl:with-param name="name">
+        <xsl:call-template name="type.display.name"/>
+      </xsl:with-param>
+      <xsl:with-param name="synopsis">
+        <xsl:call-template name="header-link"/>
+        <xsl:call-template name="class-type-synopsis">
+          <xsl:with-param name="indentation" select="$indentation"/>
+          <xsl:with-param name="allow-synopsis-anchors" select="true()"/>
+        </xsl:call-template>
+        <!-- Associated free functions -->
+        <xsl:apply-templates select="free-function-group"
+          mode="synopsis">
+          <xsl:with-param name="indentation" select="$indentation"/>
+          <xsl:with-param name="class" select="@name"/>
+        </xsl:apply-templates>
+      </xsl:with-param>
+      <xsl:with-param name="text">
+        <!-- Paragraphs go into the top of the "Description" section. -->
+        <xsl:if test="para">
+          <xsl:message>
+            <xsl:text>Warning: Use of 'para' elements in 'class' element is deprecated.&#10;Wrap them in a 'description' element.</xsl:text>
+          </xsl:message>
+          <xsl:call-template name="print.warning.context"/>
+          <xsl:apply-templates select="para" mode="annotation"/>
+        </xsl:if>
+        <xsl:apply-templates select="description"/>
+
+        <xsl:call-template name="class-members-reference"/>
+        <xsl:apply-templates select="access" mode="namespace-reference"/>
+
+        <xsl:apply-templates select="free-function-group" mode="reference">
+          <xsl:with-param name="class" select="@name"/>
+        </xsl:apply-templates>
+
+        <!-- Specializations of this class -->
+        <!-- TBD: fix this. We should key off the class name and match
+             fully-qualified names -->
+        <xsl:variable name="name" select="@name"/>
+        <xsl:if test="local-name(.)='class' and
+                      ../class-specialization[@name=$name]">
+          <refsect2>
+            <title>Specializations</title>
+            <itemizedlist>
+              <xsl:apply-templates
+                select="../class-specialization[@name=$name]"
+                mode="specialization-list"/>
+            </itemizedlist>
+          </refsect2>
+        </xsl:if>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- Output a link to a specialization -->
+  <xsl:template match="class-specialization|
+                       struct-specialization|
+                       union-specialization" mode="specialization-list">
+    <listitem>
+      <para>
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to">
+            <xsl:call-template name="generate.id">
+              <xsl:with-param name="node" select="."/>
+            </xsl:call-template>
+          </xsl:with-param>
+          <xsl:with-param name="text">
+            <xsl:call-template name="type.display.name"/>
+          </xsl:with-param>
+        </xsl:call-template>
+      </para>
+    </listitem>
+  </xsl:template>
+
+  <!-- Data member synopsis -->
+  <xsl:template match="data-member" mode="synopsis">
+    <xsl:param name="indentation"/>
+
+    <xsl:choose>
+      <xsl:when test="ancestor::class|ancestor::class-specialization|
+                      ancestor::struct|ancestor::struct-specialization|
+                      ancestor::union|ancestor::union-specialization">
+
+        <!-- Spacing -->
+        <xsl:if
+          test="not(local-name(preceding-sibling::*[position()=1])=local-name(.)) and (position() &gt; 1)">
+          <xsl:text>&#10;</xsl:text>
+        </xsl:if>
+
+        <!-- Indent -->
+        <xsl:text>&#10;</xsl:text>
+        <xsl:call-template name="indent">
+          <xsl:with-param name="indentation" select="$indentation"/>
+        </xsl:call-template>
+
+        <xsl:if test="@specifiers">
+          <xsl:call-template name="highlight-keyword">
+            <xsl:with-param name="keyword" select="@specifiers"/>
+          </xsl:call-template>
+          <xsl:text> </xsl:text>
+        </xsl:if>
+
+        <xsl:apply-templates select="type" mode="highlight"/>
+        <xsl:text> </xsl:text>
+        <xsl:value-of select="@name"/>
+        <xsl:text>;</xsl:text>
+
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:call-template name="global-synopsis">
+         <xsl:with-param name="indentation" select="$indentation"/>
+       </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+
+    <!-- If there is a <purpose>, then add it as an
+         inline comment immediately following the data
+         member definition in the synopsis -->
+    <xsl:if test="purpose">
+      <xsl:call-template name="indent">
+        <xsl:with-param name="indentation" select="$indentation"/>
+      </xsl:call-template>
+      <xsl:call-template name="highlight-comment">
+        <xsl:with-param name="text">
+          <xsl:text>// </xsl:text>
+          <xsl:apply-templates select="purpose/*|purpose/text()"
+            mode="purpose"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Data member reference -->
+  <xsl:template match="data-member" mode="reference">
+    <xsl:choose>
+      <xsl:when test="ancestor::class|ancestor::class-specialization|
+                      ancestor::struct|ancestor::struct-specialization|
+                      ancestor::union|ancestor::union-specialization"/>
+      <xsl:otherwise>
+        <xsl:call-template name="global-reference"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!-- Enumeration synopsis -->
+  <xsl:template match="enum" mode="synopsis">
+    <xsl:param name="indentation"/>
+
+    <!-- Spacing -->
+    <xsl:if
+      test="(not (local-name(preceding-sibling::*[position()=1])=local-name(.))
+             and (position() &gt; 1)) or
+            not (para or description or not ($boost.compact.enum=1))">
+      <xsl:text>&#10;</xsl:text>
+    </xsl:if>
+
+    <!-- Indent -->
+    <xsl:text>&#10;</xsl:text>
+    <xsl:call-template name="indent">
+      <xsl:with-param name="indentation" select="$indentation"/>
+    </xsl:call-template>
+
+    <xsl:choose>
+      <!-- When there is a detailed description, we only put the
+           declaration in the synopsis and will put detailed documentation
+           in either a <refentry/> or in class documentation. -->
+      <xsl:when test="para or description or not ($boost.compact.enum=1)">
+        <xsl:call-template name="highlight-keyword">
+          <xsl:with-param name="keyword" select="'enum'"/>
+        </xsl:call-template>
+
+        <xsl:text> </xsl:text>
+
+        <xsl:call-template name="internal-link">
+          <xsl:with-param name="to">
+            <xsl:call-template name="generate.id">
+              <xsl:with-param name="node" select="."/>
+            </xsl:call-template>
+          </xsl:with-param>
+          <xsl:with-param name="text" select="string(@name)"/>
+          <xsl:with-param name="higlhight" select="false()"/>
+        </xsl:call-template>
+      </xsl:when>
+      <!-- When there is no detailed description, we put the enum
+           definition within the synopsis. The purpose of the enum (if
+           available) is formatted as a comment prior to the
+           definition. This way, we do not create a separate block of text
+           for what is generally a very small amount of information. -->
+      <xsl:otherwise>
+        <xsl:if test="purpose">
+          <xsl:call-template name="highlight-comment">
+            <xsl:with-param name="text">
+              <xsl:text>// </xsl:text>
+              <xsl:apply-templates select="purpose" mode="comment"/>
+            </xsl:with-param>
+          </xsl:call-template>
+
+          <xsl:text>&#10;</xsl:text>
+          <xsl:call-template name="indent">
+            <xsl:with-param name="indentation" select="$indentation"/>
+          </xsl:call-template>
+        </xsl:if>
+
+        <xsl:call-template name="highlight-keyword">
+          <xsl:with-param name="keyword" select="'enum'"/>
+        </xsl:call-template>
+
+        <xsl:text> </xsl:text>
+
+        <xsl:call-template name="anchor">
+          <xsl:with-param name="to">
+            <xsl:call-template name="generate.id">
+              <xsl:with-param name="node" select="."/>
+            </xsl:call-template>
+          </xsl:with-param>
+          <xsl:with-param name="text" select="@name"/>
+          <xsl:with-param name="higlhight" select="false()"/>
+        </xsl:call-template>
+
+        <xsl:text> { </xsl:text>
+        <xsl:call-template name="type.enum.list.compact">
+          <xsl:with-param name="indentation"
+            select="$indentation + string-length(@name) + 8"/>
+          <xsl:with-param name="compact" select="true()"/>
+        </xsl:call-template>
+        <xsl:text> }</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:text>;</xsl:text>
+  </xsl:template>
+
+  <!-- Enumeration reference at namespace level -->
+  <xsl:template match="enum" mode="namespace-reference">
+    <xsl:if test="para or description or not ($boost.compact.enum=1)">
+      <xsl:call-template name="reference-documentation">
+        <xsl:with-param name="name">
+          <xsl:call-template name="type.display.name"/>
+        </xsl:with-param>
+        <xsl:with-param name="refname">
+          <xsl:call-template name="fully-qualified-name">
+            <xsl:with-param name="node" select="."/>
+          </xsl:call-template>
+        </xsl:with-param>
+        <xsl:with-param name="purpose" select="purpose/*|purpose/text()"/>
+        <xsl:with-param name="anchor">
+          <xsl:call-template name="generate.id">
+            <xsl:with-param name="node" select="."/>
+          </xsl:call-template>
+        </xsl:with-param>
+        <xsl:with-param name="synopsis">
+          <xsl:call-template name="header-link"/>
+          <xsl:call-template name="type.enum.display"/>
+        </xsl:with-param>
+
+        <xsl:with-param name="text">
+          <!-- Paragraphs go into the top of the "Description" section. -->
+          <xsl:if test="para">
+            <xsl:message>
+              <xsl:text>Warning: Use of 'para' elements in 'enum' element is deprecated.&#10;Wrap them in a 'description' element.</xsl:text>
+            </xsl:message>
+            <xsl:call-template name="print.warning.context"/>
+            <xsl:apply-templates select="para" mode="annotation"/>
+          </xsl:if>
+          <xsl:apply-templates select="description"/>
+          <xsl:if test="enumvalue/purpose | enumvalue/description">
+            <variablelist spacing="compact">
+              <xsl:apply-templates select="enumvalue" mode="reference"/>
+            </variablelist>
+          </xsl:if>
+        </xsl:with-param>
+
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Output an enumeration along with its values -->
+  <xsl:template name="type.enum.display">
+    <!-- Spacing -->
+    <xsl:if test="position() &gt; 1">
+      <xsl:text>&#10;</xsl:text>
+    </xsl:if>
+
+    <xsl:text>&#10;</xsl:text>
+
+    <xsl:call-template name="highlight-keyword">
+      <xsl:with-param name="keyword" select="'enum'"/>
+    </xsl:call-template>
+
+    <!-- Header -->
+    <xsl:variable name="header" select="concat(' ', @name, ' { ')"/>
+    <xsl:value-of select="$header"/>
+
+    <!-- Print the enumeration values -->
+    <xsl:call-template name="type.enum.list.compact">
+      <xsl:with-param name="indentation" select="4 + string-length($header)"/>
+    </xsl:call-template>
+
+    <xsl:text> };</xsl:text>
+  </xsl:template>
+
+  <!-- List enumeration values in a compact form e.g.,
+       enum Name { value1 = foo, value2 = bar, ... };
+       This routine prints only the enumeration values; the caller is
+       responsible for printing everything outside the braces
+       (inclusive). -->
+  <xsl:template name="type.enum.list.compact">
+    <xsl:param name="indentation"/>
+    <xsl:param name="compact" select="false()"/>
+
+    <!-- Internal: The column we are on -->
+    <xsl:param name="column" select="$indentation"/>
+
+    <!-- Internal: The index of the current enumvalue
+         we're processing -->
+    <xsl:param name="pos" select="1"/>
+
+    <!-- Internal: a prefix that we need to print prior to printing
+         this value. -->
+    <xsl:param name="prefix" select="''"/>
+
+    <xsl:if test="not($pos &gt; count(enumvalue))">
+      <xsl:variable name="value" select="enumvalue[position()=$pos]"/>
+
+      <!-- Compute the string to be printed for this value -->
+      <xsl:variable name="result">
+        <xsl:value-of select="$prefix"/>
+        <xsl:value-of select="$value/attribute::name"/>
+
+        <xsl:if test="$value/default">
+          <xsl:text> = </xsl:text>
+          <xsl:value-of select="$value/default/*|$value/default/text()"/>
+        </xsl:if>
+      </xsl:variable>
+
+      <!-- The column we will end on, assuming that this value fits on
+           this line -->
+      <xsl:variable name="end" select="$column + string-length($result)"/>
+
+      <!-- The column we will actually end on -->
+      <xsl:variable name="end2">
+        <xsl:choose>
+          <!-- If the enumeration value fits on this line, put it there -->
+          <xsl:when test="$end &lt; $max-columns">
+            <xsl:value-of select="$end"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$indentation
+                                + string-length($result)
+                                - string-length($prefix)"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:value-of select="$prefix"/>
+
+      <!-- If the enumeration value doesn't fit on this line,
+           put it on a new line -->
+      <xsl:if test="not($end &lt; $max-columns)">
+        <xsl:text>&#10;</xsl:text>
+        <xsl:call-template name="indent">
+          <xsl:with-param name="indentation" select="$indentation"/>
+        </xsl:call-template>
+      </xsl:if>
+
+      <!-- If the enumeration value has a description, link it
+           to its description. -->
+      <xsl:choose>
+        <xsl:when test="($value/purpose or $value/description) and not($compact)">
+          <xsl:call-template name="internal-link">
+            <xsl:with-param name="to">
+              <xsl:call-template name="generate.id">
+                <xsl:with-param name="node" select="$value"/>
+              </xsl:call-template>
+            </xsl:with-param>
+            <xsl:with-param name="text" select="$value/attribute::name"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$value/attribute::name"/>
+        </xsl:otherwise>
+      </xsl:choose>
+
+      <!-- If the enumeration value has a default,
+           print it. -->
+      <xsl:if test="$value/default">
+        <xsl:text> = </xsl:text>
+        <xsl:apply-templates
+          select="$value/default/*|$value/default/text()"/>
+      </xsl:if>
+
+      <!-- Recursively generate the rest of the enumeration list -->
+      <xsl:call-template name="type.enum.list.compact">
+        <xsl:with-param name="indentation" select="$indentation"/>
+        <xsl:with-param name="compact" select="$compact"/>
+        <xsl:with-param name="column" select="$end2"/>
+        <xsl:with-param name="pos" select="$pos + 1"/>
+        <xsl:with-param name="prefix" select="', '"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <!-- Enumeration reference at namespace level -->
+  <xsl:template match="enumvalue" mode="reference">
+    <xsl:if test="purpose or description">
+      <varlistentry>
+        <term>
+          <xsl:call-template name="monospaced">
+            <xsl:with-param name="text" select="@name"/>
+          </xsl:call-template>
+          <!-- Note: the anchor must come after the text here, and not
+               before it; otherwise, FOP goes into an infinite loop. -->
+          <xsl:call-template name="anchor">
+            <xsl:with-param name="to">
+              <xsl:call-template name="generate.id"/>
+            </xsl:with-param>
+            <xsl:with-param name="text" select="''"/>
+          </xsl:call-template>
+        </term>
+        <listitem>
+          <xsl:apply-templates select="purpose|description" mode="comment"/>
+        </listitem>
+      </varlistentry>
+    </xsl:if>
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/xsl/api/utility.xsl b/xsl/api/utility.xsl
new file mode 100644 (file)
index 0000000..75ae1ca
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+  <!-- Indent the current line-->
+  <xsl:template name="indent">
+    <xsl:param name="indentation"/>
+    <xsl:if test="$indentation > 0">
+      <xsl:text> </xsl:text>
+      <xsl:call-template name="indent">
+        <xsl:with-param name="indentation" select="$indentation - 1"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+
+  <!--   get name of first ancestor-or-self which is a class, struct or union -->
+  <xsl:template name="object-name">
+    <xsl:variable name="ancestors" select="ancestor-or-self::class |
+      ancestor-or-self::class-specialization |
+      ancestor-or-self::struct |
+      ancestor-or-self::struct-specialization |
+      ancestor-or-self::union |
+      ancestor-or-self::union-specialization"/>
+    <xsl:value-of select="$ancestors[last()]/@name"/>
+  </xsl:template>
+
+  <!--   get name of access specification that we are inside -->
+  <xsl:template name="access-name">
+    <xsl:variable name="ancestors" select="ancestor-or-self::access |
+      ancestor-or-self::class |
+      ancestor-or-self::class-specialization |
+      ancestor-or-self::struct |
+      ancestor-or-self::struct-specialization |
+      ancestor-or-self::union |
+      ancestor-or-self::union-specialization"/>
+    <xsl:choose>
+      <xsl:when test="name($ancestors[last()])='access'">
+        <xsl:value-of select="$ancestors[last()]/@name"/>
+      </xsl:when>
+      <xsl:otherwise>
+        public
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/xsl/api/xhtml.xsl b/xsl/api/xhtml.xsl
new file mode 100644 (file)
index 0000000..cc8e210
--- /dev/null
@@ -0,0 +1,322 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"
+                version="1.0">
+
+  <!-- Import the HTML chunking stylesheet -->
+  <xsl:import
+    href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/>
+  <xsl:import
+    href="http://docbook.sourceforge.net/release/xsl/current/xhtml/math.xsl"/>
+
+  <xsl:include href="chunk-common.xsl"/>
+  <xsl:include href="docbook-layout.xsl"/>
+  <xsl:include href="navbar.xsl"/>
+  <xsl:include href="admon.xsl"/>
+  <xsl:include href="xref.xsl"/>
+  <xsl:include href="relative-href.xsl"/>
+  <xsl:include href="callout.xsl"/>
+
+  <xsl:param name="html.stylesheet">
+    <xsl:choose>
+      <xsl:when test = "$boost.defaults = 'Boost'">
+        <xsl:value-of select = "concat($boost.root, '/doc/src/boostbook.css')"/>
+      </xsl:when>
+      <xsl:otherwise>
+        boostbook.css
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:param>
+
+  <xsl:param name="admon.style"/>
+  <xsl:param name="admon.graphics">1</xsl:param>
+  <xsl:param name="boostbook.verbose" select="0"/>
+  <xsl:param name="navig.graphics" select="1"/>
+  <xsl:param name="navig.graphics.extension" select="'.png'"/>
+  <xsl:param name="chapter.autolabel" select="1"/>
+  <xsl:param name="use.id.as.filename" select="1"/>
+  <xsl:param name="refentry.generate.name" select="0"/>
+  <xsl:param name="refentry.generate.title" select="1"/>
+  <xsl:param name="make.year.ranges" select="1"/>
+  <xsl:param name="generate.manifest" select="1"/>
+  <xsl:param name="generate.section.toc.level" select="3"/>
+  <xsl:param name="doc.standalone">false</xsl:param>
+  <xsl:param name="chunker.output.indent">yes</xsl:param>
+  <xsl:param name="chunk.quietly" select="not(number($boostbook.verbose))"/>
+  <xsl:param name="toc.max.depth">2</xsl:param>
+  <xsl:param name="callout.graphics.number.limit">15</xsl:param>
+  <xsl:param name = "admon.graphics.path"
+            select = "concat($boost.root, '/doc/xhtml/images/')"/>
+  <xsl:param name = "navig.graphics.path"
+            select = "concat($boost.root, '/doc/xhtml/images/')"/>
+  <xsl:param name = "callout.graphics.path"
+            select = "concat($boost.root, '/doc/src/images/callouts/')"/>
+
+
+  <xsl:param name="admon.style">
+    <!-- Remove the style. Let the CSS do the styling -->
+</xsl:param>
+
+<!-- Always have graphics -->
+<xsl:param name="admon.graphics" select="1"/>
+
+  <xsl:param name="generate.toc">
+appendix  toc,title
+article/appendix  nop
+article   toc,title
+book      toc,title
+chapter   toc,title
+part      toc,title
+preface   toc,title
+qandadiv  toc
+qandaset  toc
+reference toc,title
+sect1     toc
+sect2     toc
+sect3     toc
+sect4     toc
+sect5     toc
+section   toc
+set       toc,title
+  </xsl:param>
+
+
+  <xsl:template name="format.cvs.revision">
+    <xsl:param name="text"/>
+
+    <!-- Remove the "$Date: " -->
+    <xsl:variable name="text.noprefix"
+      select="substring-after($text, '$Date: ')"/>
+
+    <!-- Grab the year -->
+    <xsl:variable name="year" select="substring-before($text.noprefix, '/')"/>
+    <xsl:variable name="text.noyear"
+      select="substring-after($text.noprefix, '/')"/>
+
+    <!-- Grab the month -->
+    <xsl:variable name="month" select="substring-before($text.noyear, '/')"/>
+    <xsl:variable name="text.nomonth"
+      select="substring-after($text.noyear, '/')"/>
+
+    <!-- Grab the year -->
+    <xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
+    <xsl:variable name="text.noday"
+      select="substring-after($text.nomonth, ' ')"/>
+
+    <!-- Get the time -->
+    <xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
+
+    <xsl:variable name="month.name">
+      <xsl:choose>
+        <xsl:when test="$month=1">January</xsl:when>
+        <xsl:when test="$month=2">February</xsl:when>
+        <xsl:when test="$month=3">March</xsl:when>
+        <xsl:when test="$month=4">April</xsl:when>
+        <xsl:when test="$month=5">May</xsl:when>
+        <xsl:when test="$month=6">June</xsl:when>
+        <xsl:when test="$month=7">July</xsl:when>
+        <xsl:when test="$month=8">August</xsl:when>
+        <xsl:when test="$month=9">September</xsl:when>
+        <xsl:when test="$month=10">October</xsl:when>
+        <xsl:when test="$month=11">November</xsl:when>
+        <xsl:when test="$month=12">December</xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
+                                 $time, ' GMT')"/>
+  </xsl:template>
+
+
+  <xsl:template name="format.svn.revision">
+    <xsl:param name="text"/>
+
+    <!-- Remove the "$Date: " -->
+    <xsl:variable name="text.noprefix"
+      select="substring-after($text, '$Date: ')"/>
+
+    <!-- Grab the year -->
+    <xsl:variable name="year" select="substring-before($text.noprefix, '-')"/>
+    <xsl:variable name="text.noyear"
+      select="substring-after($text.noprefix, '-')"/>
+
+    <!-- Grab the month -->
+    <xsl:variable name="month" select="substring-before($text.noyear, '-')"/>
+    <xsl:variable name="text.nomonth"
+      select="substring-after($text.noyear, '-')"/>
+
+    <!-- Grab the year -->
+    <xsl:variable name="day" select="substring-before($text.nomonth, ' ')"/>
+    <xsl:variable name="text.noday"
+      select="substring-after($text.nomonth, ' ')"/>
+
+    <!-- Get the time -->
+    <xsl:variable name="time" select="substring-before($text.noday, ' ')"/>
+    <xsl:variable name="text.notime"
+      select="substring-after($text.noday, ' ')"/>
+
+    <!-- Get the timezone -->
+    <xsl:variable name="timezone" select="substring-before($text.notime, ' ')"/>
+
+    <xsl:variable name="month.name">
+      <xsl:choose>
+        <xsl:when test="$month=1">January</xsl:when>
+        <xsl:when test="$month=2">February</xsl:when>
+        <xsl:when test="$month=3">March</xsl:when>
+        <xsl:when test="$month=4">April</xsl:when>
+        <xsl:when test="$month=5">May</xsl:when>
+        <xsl:when test="$month=6">June</xsl:when>
+        <xsl:when test="$month=7">July</xsl:when>
+        <xsl:when test="$month=8">August</xsl:when>
+        <xsl:when test="$month=9">September</xsl:when>
+        <xsl:when test="$month=10">October</xsl:when>
+        <xsl:when test="$month=11">November</xsl:when>
+        <xsl:when test="$month=12">December</xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:value-of select="concat($month.name, ' ', $day, ', ', $year, ' at ',
+                                 $time, ' ', $timezone)"/>
+  </xsl:template>
+
+  <!-- Footer Copyright -->
+  <xsl:template match="copyright" mode="boost.footer">
+    <xsl:if test="position() &gt; 1">
+      <br/>
+    </xsl:if>
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="'Copyright'"/>
+    </xsl:call-template>
+    <xsl:call-template name="gentext.space"/>
+    <xsl:call-template name="dingbat">
+      <xsl:with-param name="dingbat">copyright</xsl:with-param>
+    </xsl:call-template>
+    <xsl:call-template name="gentext.space"/>
+    <xsl:call-template name="copyright.years">
+      <xsl:with-param name="years" select="year"/>
+      <xsl:with-param name="print.ranges" select="$make.year.ranges"/>
+      <xsl:with-param name="single.year.ranges"
+        select="$make.single.year.ranges"/>
+    </xsl:call-template>
+    <xsl:call-template name="gentext.space"/>
+    <xsl:apply-templates select="holder" mode="titlepage.mode"/>
+  </xsl:template>
+
+  <!-- Footer License -->
+  <xsl:template match="legalnotice" mode="boost.footer">
+    <xsl:apply-templates select="para" mode="titlepage.mode" />
+  </xsl:template>
+
+  <xsl:template name="user.footer.content">
+    <table width="100%">
+      <tr>
+        <td align="left">
+          <xsl:variable name="revision-nodes"
+            select="ancestor-or-self::*
+                    [not (attribute::rev:last-revision='')]"/>
+          <xsl:if test="count($revision-nodes) &gt; 0">
+            <xsl:variable name="revision-node"
+              select="$revision-nodes[last()]"/>
+            <xsl:variable name="revision-text">
+              <xsl:value-of
+                select="normalize-space($revision-node/attribute::rev:last-revision)"/>
+            </xsl:variable>
+            <xsl:if test="string-length($revision-text) &gt; 0">
+              <p>
+                <small>
+                  <xsl:text>Last revised: </xsl:text>
+                  <xsl:choose>
+                    <xsl:when test="contains($revision-text, '/')">
+                      <xsl:call-template name="format.cvs.revision">
+                        <xsl:with-param name="text" select="$revision-text"/>
+                      </xsl:call-template>
+                    </xsl:when>
+                    <xsl:otherwise>
+                      <xsl:call-template name="format.svn.revision">
+                        <xsl:with-param name="text" select="$revision-text"/>
+                      </xsl:call-template>
+                    </xsl:otherwise>
+                  </xsl:choose>
+                </small>
+              </p>
+            </xsl:if>
+          </xsl:if>
+        </td>
+        <td align="right">
+          <div class = "copyright-footer">
+            <xsl:apply-templates select="ancestor::*/*/copyright"
+              mode="boost.footer"/>
+            <xsl:apply-templates select="ancestor::*/*/legalnotice"
+              mode="boost.footer"/>
+          </div>
+        </td>
+      </tr>
+    </table>
+  </xsl:template>
+
+  <!-- We don't want refentry's to show up in the TOC because they
+       will merely be redundant with the synopsis. -->
+  <xsl:template match="refentry" mode="toc"/>
+
+  <!-- override the behaviour of some DocBook elements for better
+       rendering facilities -->
+
+  <xsl:template match = "programlisting[ancestor::informaltable]">
+     <pre class = "table-{name(.)}"><xsl:apply-templates/></pre>
+  </xsl:template>
+
+  <xsl:template match = "refsynopsisdiv">
+     <h2 class = "{name(.)}-title">Synopsis</h2>
+     <div class = "{name(.)}">
+        <xsl:apply-templates/>
+     </div>
+  </xsl:template>
+
+<!-- ============================================================ -->
+
+<xsl:template name="output.html.stylesheets">
+    <xsl:param name="stylesheets" select="''"/>
+
+    <xsl:choose>
+        <xsl:when test="contains($stylesheets, ' ')">
+            <link rel="stylesheet">
+                <xsl:attribute name="href">
+                    <xsl:call-template name="href.target.relative">
+                        <xsl:with-param name="target" select="substring-before($stylesheets, ' ')"/>
+                    </xsl:call-template>
+                </xsl:attribute>
+                <xsl:if test="$html.stylesheet.type != ''">
+                    <xsl:attribute name="type">
+                        <xsl:value-of select="$html.stylesheet.type"/>
+                    </xsl:attribute>
+                </xsl:if>
+            </link>
+            <xsl:call-template name="output.html.stylesheets">
+                <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
+            </xsl:call-template>
+        </xsl:when>
+        <xsl:when test="$stylesheets != ''">
+            <link rel="stylesheet">
+                <xsl:attribute name="href">
+                    <xsl:call-template name="href.target.relative">
+                        <xsl:with-param name="target" select="$stylesheets"/>
+                    </xsl:call-template>
+                </xsl:attribute>
+                <xsl:if test="$html.stylesheet.type != ''">
+                    <xsl:attribute name="type">
+                        <xsl:value-of select="$html.stylesheet.type"/>
+                    </xsl:attribute>
+                </xsl:if>
+            </link>
+        </xsl:when>
+    </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/xsl/api/xref.xsl b/xsl/api/xref.xsl
new file mode 100644 (file)
index 0000000..e78783d
--- /dev/null
@@ -0,0 +1,79 @@
+<?xml version="1.0"?>
+<!--
+   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
+  
+   Distributed under the Boost Software License, Version 1.0.
+   (See accompanying file LICENSE_1_0.txt or copy at
+   http://www.boost.org/LICENSE_1_0.txt)
+  -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:suwl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.UnwrapLinks"
+                xmlns:d="http://docbook.org/ns/docbook"
+                               xmlns:exsl="http://exslt.org/common"
+                               exclude-result-prefixes="suwl exsl d"
+                version="1.0">
+
+<!-- Import the HTML chunking stylesheet -->
+<xsl:import
+    href="http://docbook.sourceforge.net/release/xsl-ns/current/html/xref.xsl"/>
+
+
+<xsl:template name="adjust-url">
+    <xsl:param name="target"/>
+    <xsl:param name="context" select="."/>
+
+    <xsl:choose>
+        <xsl:when test="contains($target, ':')">
+          <xsl:value-of select="$target"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="href.target.relative">
+            <xsl:with-param name="target" select="$target"/>
+          </xsl:call-template>
+        </xsl:otherwise>
+    </xsl:choose>
+
+</xsl:template>
+
+
+<xsl:template match="ulink" name="ulink">
+  <xsl:variable name="link">
+    <a>
+      <xsl:if test="@id">
+        <xsl:attribute name="name">
+          <xsl:value-of select="@id"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:attribute name="href">
+        <xsl:call-template name="adjust-url">
+          <xsl:with-param name="target" select="@url"/>
+        </xsl:call-template>
+      </xsl:attribute>
+      <xsl:if test="$ulink.target != ''">
+        <xsl:attribute name="target">
+          <xsl:value-of select="$ulink.target"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:choose>
+        <xsl:when test="count(child::node())=0">
+          <xsl:value-of select="@url"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </a>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="function-available('suwl:unwrapLinks')">
+      <xsl:copy-of select="suwl:unwrapLinks($link)"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:copy-of select="$link"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+
+</xsl:stylesheet>