Boost logo

Boost-Commit :

From: fmhess_at_[hidden]
Date: 2007-10-14 00:20:04


Author: fmhess
Date: 2007-10-14 00:20:02 EDT (Sun, 14 Oct 2007)
New Revision: 40000
URL: http://svn.boost.org/trac/boost/changeset/40000

Log:
Blah, docbook <type> doesn't allow <link> or <emphasis> children.
The best solution seems to be just to drop it from docbook output.

Text files modified:
   sandbox/boost_docs/trunk/tools/boostbook/xsl/annotation.xsl | 25 ++++++++++++++++---------
   sandbox/boost_docs/trunk/tools/boostbook/xsl/source-highlight.xsl | 22 ++++------------------
   sandbox/boost_docs/trunk/tools/boostbook/xsl/type.xsl | 9 +--------
   3 files changed, 21 insertions(+), 35 deletions(-)

Modified: sandbox/boost_docs/trunk/tools/boostbook/xsl/annotation.xsl
==============================================================================
--- sandbox/boost_docs/trunk/tools/boostbook/xsl/annotation.xsl (original)
+++ sandbox/boost_docs/trunk/tools/boostbook/xsl/annotation.xsl 2007-10-14 00:20:02 EDT (Sun, 14 Oct 2007)
@@ -1,7 +1,7 @@
 <?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)
@@ -22,10 +22,10 @@
   <xsl:template match="function|overloaded-function" mode="generate.id">
     <xsl:variable name="name" select="normalize-space(@name)"/>
     <xsl:variable name="translated-name"
- select="translate($name,
- '~!%^&amp;*()[].,&lt;&gt;|/ +-=',
+ select="translate($name,
+ '~!%^&amp;*()[].,&lt;&gt;|/ +-=',
                                     'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')"/>
-
+
     <xsl:choose>
       <xsl:when test="count(key('named-entities', $name))=1
                       and ($translated-name=$name)">
@@ -164,7 +164,7 @@
       <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"
+ <xsl:with-param name="nodes"
         select="key('functions', $unqualified-name)"/>
     </xsl:call-template>
   </xsl:template>
@@ -208,7 +208,7 @@
       <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"
+ <xsl:with-param name="nodes"
         select="key('enums', $unqualified-name)"/>
     </xsl:call-template>
   </xsl:template>
@@ -226,7 +226,7 @@
     </xsl:variable>
 
     <xsl:variable name="node" select="key('libraries', $name)"/>
-
+
     <xsl:choose>
       <xsl:when test="count($node)=0">
         <xsl:message>
@@ -255,7 +255,7 @@
 
   <xsl:template match="macroname" mode="annotation">
     <xsl:param name="name" select="text()"/>
-
+
     <xsl:variable name="node" select="key('macros', $name)"/>
     <xsl:choose>
       <xsl:when test="count($node) = 0">
@@ -291,7 +291,7 @@
 
   <xsl:template match="headername" mode="annotation">
     <xsl:param name="name" select="text()"/>
-
+
     <xsl:variable name="node" select="key('headers', $name)"/>
     <xsl:choose>
       <xsl:when test="count($node) = 0">
@@ -383,4 +383,11 @@
   <xsl:template match="text()" mode="purpose">
     <xsl:apply-templates select="." mode="annotation"/>
   </xsl:template>
+
+<!-- docbook doesn't allow <type> to have <link> children,
+ so drop it from the output-->
+ <xsl:template match="type" mode="annotation">
+ <xsl:apply-templates mode="annotation"/>
+ </xsl:template>
+
 </xsl:stylesheet>

Modified: sandbox/boost_docs/trunk/tools/boostbook/xsl/source-highlight.xsl
==============================================================================
--- sandbox/boost_docs/trunk/tools/boostbook/xsl/source-highlight.xsl (original)
+++ sandbox/boost_docs/trunk/tools/boostbook/xsl/source-highlight.xsl 2007-10-14 00:20:02 EDT (Sun, 14 Oct 2007)
@@ -163,25 +163,11 @@
     <xsl:apply-templates select="." mode="annotation"/>
   </xsl:template>
 
- <!-- docbook does not allow <type> elements to have <emphasis> children,
- so put the type inside the emphasis. -->
- <xsl:template match="type/text()" mode="highlight">
- </xsl:template>
+ <!-- docbook does not allow <type> elements to have <emphasis> or <link>
+ children. The easiest solution seems to be just to discard the <type> element
+ from the output. -->
   <xsl:template match="type" mode="highlight">
- <xsl:choose>
- <xsl:when test="$boost.syntax.highlight='1'">
- <emphasis role="bold">
- <xsl:copy>
- <xsl:apply-templates mode="annotation"/>
- </xsl:copy>
- </emphasis>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy>
- <xsl:apply-templates mode="annotation"/>
- </xsl:copy>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:apply-templates mode="highlight"/>
   </xsl:template>
 
 </xsl:stylesheet>

Modified: sandbox/boost_docs/trunk/tools/boostbook/xsl/type.xsl
==============================================================================
--- sandbox/boost_docs/trunk/tools/boostbook/xsl/type.xsl (original)
+++ sandbox/boost_docs/trunk/tools/boostbook/xsl/type.xsl 2007-10-14 00:20:02 EDT (Sun, 14 Oct 2007)
@@ -523,14 +523,7 @@
       <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:apply-templates mode="annotation"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:apply-templates mode="annotation"/>
 
       <!-- Output a comma if not at the end -->
       <xsl:if test="position() &lt; $n">


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk