$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r62294 - trunk/tools/boostbook/xsl
From: steven_at_[hidden]
Date: 2010-05-28 10:40:52
Author: steven_watanabe
Date: 2010-05-28 10:40:48 EDT (Fri, 28 May 2010)
New Revision: 62294
URL: http://svn.boost.org/trac/boost/changeset/62294
Log:
Make sure that every bit of C++ code that we output goes through the syntax highlighter
Text files modified: 
   trunk/tools/boostbook/xsl/function.xsl  |    79 +++++++++++++++---                      
   trunk/tools/boostbook/xsl/global.xsl    |     8 +                                       
   trunk/tools/boostbook/xsl/reference.xsl |     7                                         
   trunk/tools/boostbook/xsl/template.xsl  |   161 ++++++++++++++++++++++++++++++++++++--- 
   trunk/tools/boostbook/xsl/type.xsl      |    88 ++++++++++++++++-----                   
   5 files changed, 286 insertions(+), 57 deletions(-)
Modified: trunk/tools/boostbook/xsl/function.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/function.xsl	(original)
+++ trunk/tools/boostbook/xsl/function.xsl	2010-05-28 10:40:48 EDT (Fri, 28 May 2010)
@@ -161,7 +161,7 @@
 
     <!-- Build the text that follows the declarator-->
     <xsl:variable name="postdeclarator">
-      <xsl:if test="@cv">
+      <xsl:if test="@cv and @cv != ''">
         <xsl:text> </xsl:text>
         <xsl:value-of select="@cv"/>
       </xsl:if>
@@ -246,7 +246,9 @@
           <xsl:with-param name="highlight" select="true()"/>
         </xsl:call-template>
 
-        <xsl:text>(</xsl:text>
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="'('"/>
+        </xsl:call-template>
         <xsl:call-template name="function-parameters">
           <xsl:with-param name="include-names" select="$include-names"/>
           <xsl:with-param name="indentation"
@@ -254,12 +256,16 @@
                     + string-length($function-name) + 1"/>
           <xsl:with-param name="final" select="true()"/>
         </xsl:call-template>
-        <xsl:text>)</xsl:text>
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="')'"/>
+        </xsl:call-template>
 
         <xsl:call-template name="source-highlight">
           <xsl:with-param name="text" select="$postdeclarator"/>
         </xsl:call-template>
-        <xsl:text>;</xsl:text>
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="';'"/>
+        </xsl:call-template>
       </xsl:when>
 
       <!-- This declaration will take multiple lines -->
@@ -317,7 +323,9 @@
           <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="highlight-text">
+          <xsl:with-param name="text" select="'('"/>
+        </xsl:call-template>
         <xsl:call-template name="function-parameters">
           <xsl:with-param name="include-names" select="$include-names"/>
           <xsl:with-param name="indentation"
@@ -325,11 +333,15 @@
                     + string-length($function-name) + 1"/>
           <xsl:with-param name="final" select="true()"/>
         </xsl:call-template>
-        <xsl:text>)</xsl:text>
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="')'"/>
+        </xsl:call-template>
         <xsl:call-template name="source-highlight">
           <xsl:with-param name="text" select="$postdeclarator"/>
         </xsl:call-template>
-        <xsl:text>;</xsl:text>
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="';'"/>
+        </xsl:call-template>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
@@ -364,7 +376,18 @@
       <!-- 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:if test="$parameter/@pack=1">
+          <xsl:choose>
+            <xsl:when test="$final">
+              <xsl:call-template name="highlight-text">
+                <xsl:with-param name="text" select="'...'"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:text>...</xsl:text>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:if>
       </xsl:variable>
       <xsl:variable name="name">
         <xsl:if test="$include-names and $parameter/@name != ''">
@@ -377,18 +400,32 @@
       <xsl:variable name="default">
         <xsl:choose>
           <xsl:when test="$parameter/@default">
-            <xsl:text> = </xsl:text>
-            <xsl:value-of select="$parameter/@default"/>
+            <xsl:choose>
+              <xsl:when test="$final">
+                <xsl:call-template name="highlight-text">
+                  <xsl:with-param name="text" select="concat(' = ', $parameter/@default)"/>
+                </xsl:call-template>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text> = </xsl:text>
+                <xsl:value-of select="$parameter/@default"/>
+              </xsl:otherwise>
+            </xsl:choose>
           </xsl:when>
           <xsl:when test="$parameter/default">
-            <xsl:text> = </xsl:text>
             <xsl:choose>
               <xsl:when test="$final">
+                <xsl:call-template name="highlight-text">
+                  <xsl:with-param name="text" select="' = '"/>
+                </xsl:call-template>
                 <xsl:apply-templates
                   select="$parameter/default/*|$parameter/default/text()"
-                  mode="annotation"/>
+                  mode="annotation">
+                  <xsl:with-param name="highlight" select="true()"/>
+                </xsl:apply-templates>
               </xsl:when>
               <xsl:otherwise>
+                <xsl:text> = </xsl:text>
                 <xsl:value-of select="string($parameter/default)"/>
               </xsl:otherwise>
             </xsl:choose>
@@ -407,13 +444,15 @@
                         or not($wrap)">
           <xsl:choose>
             <xsl:when test="$final">
-              <xsl:value-of select="$prefix"/>
+              <xsl:call-template name="highlight-text">
+                <xsl:with-param name="text" select="$prefix"/>
+              </xsl:call-template>
               <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:copy-of select="$pack"/>
               <xsl:value-of select="$name"/>
               <xsl:copy-of select="$default"/>
             </xsl:when>
@@ -437,7 +476,17 @@
         <!-- Parameter goes on next line -->
         <xsl:otherwise>
           <!-- The comma goes on this line -->
-          <xsl:value-of select="$prefix"/><xsl:text>
</xsl:text>
+          <xsl:choose>
+            <xsl:when test="$final">
+              <xsl:call-template name="highlight-text">
+                <xsl:with-param name="text" select="$prefix"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="$prefix"/>
+            </xsl:otherwise>
+          </xsl:choose>
+          <xsl:text>
</xsl:text>
 
           <!-- Indent and print the parameter -->
           <xsl:call-template name="indent">
Modified: trunk/tools/boostbook/xsl/global.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/global.xsl	(original)
+++ trunk/tools/boostbook/xsl/global.xsl	2010-05-28 10:40:48 EDT (Fri, 28 May 2010)
@@ -57,7 +57,9 @@
       </xsl:call-template>
       <xsl:text> </xsl:text>
     </xsl:if>
-    <xsl:apply-templates select="type/*|type/text()" mode="annotation" />
+    <xsl:apply-templates select="type/*|type/text()" mode="annotation">
+      <xsl:with-param name="highlight" select="true()"/>
+    </xsl:apply-templates>
     <xsl:text> </xsl:text>
     <xsl:call-template name="link-or-anchor">
       <xsl:with-param name="to">
@@ -66,7 +68,9 @@
       <xsl:with-param name="text" select="@name" />
       <xsl:with-param name="link-type" select="$link-type" />
     </xsl:call-template>
-    <xsl:text>;</xsl:text>
+    <xsl:call-template name="highlight-text">
+      <xsl:with-param name="text" select="';'"/>
+    </xsl:call-template>
   </xsl:template>
   <xsl:template match="data-member" mode="generate.id">
     <xsl:call-template name="fully-qualified-id">
Modified: trunk/tools/boostbook/xsl/reference.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/reference.xsl	(original)
+++ trunk/tools/boostbook/xsl/reference.xsl	2010-05-28 10:40:48 EDT (Fri, 28 May 2010)
@@ -29,9 +29,8 @@
       <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: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|
@@ -58,7 +57,9 @@
     <xsl:call-template name="indent">
       <xsl:with-param name="indentation" select="$indentation"/>
     </xsl:call-template>
-    <xsl:text>}</xsl:text>
+    <xsl:call-template name="highlight-text">
+      <xsl:with-param name="text" select="'}'"/>
+    </xsl:call-template>
   </xsl:template>
 
   <!-- Emit namespace synopsis -->
Modified: trunk/tools/boostbook/xsl/template.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/template.xsl	(original)
+++ trunk/tools/boostbook/xsl/template.xsl	2010-05-28 10:40:48 EDT (Fri, 28 May 2010)
@@ -72,18 +72,31 @@
         <xsl:call-template name="highlight-keyword">
           <xsl:with-param name="keyword" select="'template'"/>
         </xsl:call-template>
+        <xsl:call-template name="highlight-special">
+          <xsl:with-param name="text" select="'<'"/>
+        </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
         <xsl:text>template</xsl:text>
+        <xsl:text><</xsl:text>
       </xsl:otherwise>
     </xsl:choose>
-    <xsl:text><</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>> </xsl:text>
+    <xsl:choose>
+      <xsl:when test="$highlight">
+        <xsl:call-template name="highlight-special">
+          <xsl:with-param name="text" select="'>'"/>
+        </xsl:call-template>
+        <xsl:text> </xsl:text>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text>> </xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
   </xsl:template>
 
   <!-- Display a list of template parameters for a synopsis (no comments) -->
@@ -100,7 +113,16 @@
     <xsl:if test="$parameters">
       <!-- Emit the prefix (either a comma-space, or empty if this is
            the first parameter) -->
-      <xsl:value-of select="$prefix"/>
+      <xsl:choose>
+        <xsl:when test="$highlight">
+          <xsl:call-template name="highlight-text">
+            <xsl:with-param name="text" select="$prefix"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$prefix"/>
+        </xsl:otherwise>
+      </xsl:choose>
 
       <!-- Get the actual parameter and its attributes -->
       <xsl:variable name="parameter" select="$parameters[position()=1]"/>
@@ -179,17 +201,30 @@
           <xsl:call-template name="highlight-keyword">
             <xsl:with-param name="keyword" select="'template'"/>
           </xsl:call-template>
+          <xsl:call-template name="highlight-special">
+            <xsl:with-param name="text" select="'<'"/>
+          </xsl:call-template>
         </xsl:when>
         <xsl:otherwise>
           <xsl:text>template</xsl:text>
+          <xsl:text><</xsl:text>
         </xsl:otherwise>
       </xsl:choose>
-      <xsl:text><</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>> </xsl:text>
+      <xsl:choose>
+        <xsl:when test="$highlight">
+          <xsl:call-template name="highlight-special">
+            <xsl:with-param name="text" select="'>'"/>
+          </xsl:call-template>
+          <xsl:text> </xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>> </xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:if>
   </xsl:template>
 
@@ -236,7 +271,16 @@
       </xsl:call-template>
 
       <xsl:if test="$rest">
-        <xsl:text>, </xsl:text>
+        <xsl:choose>
+          <xsl:when test="$highlight">
+            <xsl:call-template name="highlight-text">
+              <xsl:with-param name="text" select="', '"/>
+            </xsl:call-template>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>, </xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
       </xsl:if>
 
       <!-- Display the comment -->
@@ -314,7 +358,18 @@
         <xsl:text>typename</xsl:text>
       </xsl:otherwise>
     </xsl:choose>
-    <xsl:if test="$parameter/@pack=1"><xsl:text>...</xsl:text></xsl:if>
+    <xsl:if test="$parameter/@pack=1">
+      <xsl:choose>
+        <xsl:when test="$highlight">
+          <xsl:call-template name="highlight-text">
+            <xsl:with-param name="text" select="'...'"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>...</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
     <xsl:text> </xsl:text>
 
     <xsl:call-template name="template.parameter.name">
@@ -358,7 +413,16 @@
     </xsl:variable>
 
     <xsl:if test="not($def='')">
-      <xsl:text> = </xsl:text>
+      <xsl:choose>
+        <xsl:when test="$highlight">
+          <xsl:call-template name="highlight-text">
+            <xsl:with-param name="text" select="' = '"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text> = </xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
 
       <xsl:copy-of select="$def"/>
 
@@ -389,7 +453,18 @@
         <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:if test="$parameter/@pack=1">
+      <xsl:choose>
+        <xsl:when test="$highlight">
+          <xsl:call-template name="highlight-text">
+            <xsl:with-param name="text" select="'...'"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>...</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
     <xsl:text> </xsl:text>
 
     <xsl:call-template name="template.parameter.name">
@@ -402,7 +477,16 @@
     </xsl:variable>
 
     <xsl:if test="not($def='')">
-      <xsl:text> = </xsl:text>
+      <xsl:choose>
+        <xsl:when test="$highlight">
+          <xsl:call-template name="highlight-text">
+            <xsl:with-param name="text" select="' = '"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text> = </xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
 
       <xsl:choose>
         <xsl:when test="$highlight">
@@ -423,25 +507,72 @@
   </xsl:template>
 
   <xsl:template match="template-varargs" mode="print.parameter">
-    <xsl:text>...</xsl:text>
+    <xsl:param name="highlight" select="true()"/>
+    <xsl:choose>
+      <xsl:when test="$highlight">
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="'...'"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text>...</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
   </xsl:template>
 
   <xsl:template match="specialization">
     <xsl:param name="highlight" select="true()"/>
-    <xsl:text><</xsl:text>
+    <xsl:choose>
+      <xsl:when test="$highlight">
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="'<'"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text><</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
     <xsl:apply-templates select="template-arg">
       <xsl:with-param name="highlight" select="$highlight"/>
     </xsl:apply-templates>
-    <xsl:text>></xsl:text>
+    <xsl:choose>
+      <xsl:when test="$highlight">
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="'>'"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text>></xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
   </xsl:template>
 
   <xsl:template match="template-arg">
+    <xsl:param name="highlight" select="true()"/>
     <xsl:if test="position() > 1">
-      <xsl:text>, </xsl:text>
+      <xsl:choose>
+        <xsl:when test="$highlight">
+          <xsl:call-template name="highlight-text">
+            <xsl:with-param name="text" select="', '"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>, </xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:if>
     <xsl:apply-templates mode="highlight"/>
     <xsl:if test="@pack=1">
-      <xsl:text>...</xsl:text>
+      <xsl:choose>
+        <xsl:when test="$highlight">
+          <xsl:call-template name="highlight-text">
+            <xsl:with-param name="text" select="'...'"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>...</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:if>
   </xsl:template>
 </xsl:stylesheet>
Modified: trunk/tools/boostbook/xsl/type.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/type.xsl	(original)
+++ trunk/tools/boostbook/xsl/type.xsl	2010-05-28 10:40:48 EDT (Fri, 28 May 2010)
@@ -134,7 +134,9 @@
       <xsl:text> </xsl:text>
       <xsl:value-of select="@name"/>
       <xsl:apply-templates select="specialization"/>
-      <xsl:text>;</xsl:text>
+      <xsl:call-template name="highlight-text">
+        <xsl:with-param name="text" select="';'"/>
+      </xsl:call-template>
     </xsl:variable>
 
     <xsl:choose>
@@ -160,7 +162,9 @@
           </xsl:with-param>
         </xsl:call-template>
         <xsl:apply-templates select="specialization"/>
-        <xsl:text>;</xsl:text>
+        <xsl:call-template name="highlight-special">
+          <xsl:with-param name="text" select="';'"/>
+        </xsl:call-template>
       </xsl:when>
 
       <xsl:otherwise>
@@ -195,7 +199,9 @@
           <xsl:with-param name="text" select="string(@name)"/>
         </xsl:call-template>
         <xsl:apply-templates select="specialization"/>
-        <xsl:text>;</xsl:text>
+        <xsl:call-template name="highlight-special">
+          <xsl:with-param name="text" select="';'"/>
+        </xsl:call-template>
       </xsl:otherwise>
     </xsl:choose>
 
@@ -338,7 +344,9 @@
               <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="highlight-special">
+              <xsl:with-param name="text" select="';'"/>
+            </xsl:call-template>
           </xsl:otherwise>
         </xsl:choose>
 
@@ -461,7 +469,9 @@
 
     <xsl:if test="not(@name = '')">
       <xsl:text> </xsl:text>
-      <xsl:value-of select="@name"/>
+      <xsl:call-template name="source-highlight">
+        <xsl:with-param name="text" select="@name"/>
+      </xsl:call-template>
     </xsl:if>
 
     <xsl:text> = </xsl:text>
@@ -471,7 +481,9 @@
         <xsl:apply-templates select="default/*|default/text()"/>
       </xsl:with-param>
     </xsl:call-template>
-    <xsl:text>;</xsl:text>
+    <xsl:call-template name="highlight-special">
+      <xsl:with-param name="text" select="';'"/>
+    </xsl:call-template>
 
     <xsl:if test="purpose">
       <xsl:text>  </xsl:text>
@@ -523,7 +535,9 @@
       <!-- Output the type -->
       <xsl:choose>
         <xsl:when test="type">
-          <xsl:apply-templates select="type/*|type/text()" mode="annotation"/>
+          <xsl:apply-templates select="type/*|type/text()" mode="annotation">
+            <xsl:with-param name="highlight" select="true()"/>
+          </xsl:apply-templates>
         </xsl:when>
         <xsl:otherwise>
           <xsl:message>
@@ -581,14 +595,20 @@
       <xsl:when test="$single-line-candidate and
                       (string-length($single-line) + $indentation + 3
                         < $max-columns)">
-        <xsl:text> : </xsl:text>
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="' : '"/>
+        </xsl:call-template>
         <xsl:call-template name="print.base.classes.single"/>
-        <xsl:text> {</xsl:text>
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="' {'"/>
+        </xsl:call-template>
       </xsl:when>
       <xsl:when test="$single-line-candidate and
                       (string-length($single-line) + $base-indentation + 2
                         < $max-columns)">
-        <xsl:text> :
</xsl:text>
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="' :
'"/>
+        </xsl:call-template>
         <xsl:call-template name="indent">
           <xsl:with-param name="indentation" select="$base-indentation + 2"/>
         </xsl:call-template>
@@ -597,10 +617,14 @@
         <xsl:call-template name="indent">
           <xsl:with-param name="indentation" select="$base-indentation"/>
         </xsl:call-template>
-        <xsl:text>{</xsl:text>
+        <xsl:call-template name="highlight-special">
+          <xsl:with-param name="text" select="'{'"/>
+        </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
-        <xsl:text> : </xsl:text>
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="' : '"/>
+        </xsl:call-template>
         <xsl:call-template name="print.base.classes.multi">
           <xsl:with-param name="indentation" select="$indentation + 3"/>
         </xsl:call-template>
@@ -608,7 +632,9 @@
         <xsl:call-template name="indent">
           <xsl:with-param name="indentation" select="$base-indentation"/>
         </xsl:call-template>
-        <xsl:text>{</xsl:text>
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="'{'"/>
+        </xsl:call-template>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
@@ -846,7 +872,9 @@
     <xsl:call-template name="highlight-keyword">
       <xsl:with-param name="keyword" select="$specification"/>
     </xsl:call-template>
-    <xsl:text>:</xsl:text>
+    <xsl:call-template name="highlight-special">
+      <xsl:with-param name="text" select="':'"/>
+    </xsl:call-template>
   </xsl:template>
 
   <xsl:template match="access" mode="synopsis">
@@ -940,7 +968,9 @@
       </xsl:when>
       <xsl:otherwise>
         <!-- Opening brace -->
-        <xsl:text> {</xsl:text>
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="' {'"/>
+        </xsl:call-template>
       </xsl:otherwise>
     </xsl:choose>
 
@@ -973,7 +1003,9 @@
     <xsl:call-template name="indent">
       <xsl:with-param name="indentation" select="$indentation"/>
     </xsl:call-template>
-    <xsl:text>};</xsl:text>
+    <xsl:call-template name="highlight-text">
+      <xsl:with-param name="text" select="'};'"/>
+    </xsl:call-template>
   </xsl:template>
 
   <!-- Emit nested class reference documentation -->
@@ -1169,7 +1201,9 @@
         <xsl:apply-templates select="type" mode="highlight"/>
         <xsl:text> </xsl:text>
         <xsl:value-of select="@name"/>
-        <xsl:text>;</xsl:text>
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="';'"/>
+        </xsl:call-template>
 
       </xsl:when>
       <xsl:otherwise>
@@ -1283,16 +1317,22 @@
           <xsl:with-param name="higlhight" select="false()"/>
         </xsl:call-template>
 
-        <xsl:text> { </xsl:text>
+        <xsl:call-template name="highlight-text">
+          <xsl:with-param name="text" select="' { '"/>
+        </xsl:call-template>
         <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:call-template name="highlight-text">
+          <xsl:with-param name="text" select="' }'"/>
+        </xsl:call-template>
       </xsl:otherwise>
     </xsl:choose>
-    <xsl:text>;</xsl:text>
+    <xsl:call-template name="highlight-text">
+      <xsl:with-param name="text" select="';'"/>
+    </xsl:call-template>
   </xsl:template>
 
   <!-- Enumeration reference at namespace level -->
@@ -1354,14 +1394,18 @@
 
     <!-- Header -->
     <xsl:variable name="header" select="concat(' ', @name, ' { ')"/>
-    <xsl:value-of select="$header"/>
+    <xsl:call-template name="highlight-text">
+      <xsl:with-param name="text" select="$header"/>
+    </xsl:call-template>
 
     <!-- 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:call-template name="highlight-text">
+      <xsl:with-param name="text" select="' };'"/>
+    </xsl:call-template>
   </xsl:template>
 
   <!-- List enumeration values in a compact form e.g.,