[yelp-xsl] db2html-block: Cleaning up block output routines



commit 8961c1cd6d07b33baceb3049d56f332db17ca3ba
Author: Shaun McCance <shaunm gnome org>
Date:   Sat Nov 12 19:59:57 2011 -0500

    db2html-block: Cleaning up block output routines

 xslt/docbook/html/db2html-bibliography.xsl |    3 +-
 xslt/docbook/html/db2html-block.xsl        |  317 ++++++++++------------------
 xslt/docbook/html/db2html-callout.xsl      |    4 +-
 xslt/docbook/html/db2html-css.xsl          |    3 +-
 xslt/docbook/html/db2html-list.xsl         |   85 ++++++++-
 xslt/docbook/html/db2html-media.xsl        |    5 -
 xslt/docbook/html/db2html-table.xsl        |   26 ---
 7 files changed, 198 insertions(+), 245 deletions(-)
---
diff --git a/xslt/docbook/html/db2html-bibliography.xsl b/xslt/docbook/html/db2html-bibliography.xsl
index eaa6f2a..bfad367 100644
--- a/xslt/docbook/html/db2html-bibliography.xsl
+++ b/xslt/docbook/html/db2html-bibliography.xsl
@@ -640,9 +640,8 @@ a bibliography entry.
 
 <!-- = bibliolist = -->
 <xsl:template match="bibliolist | db:bibliolist">
-  <xsl:call-template name="db2html.block">
+  <xsl:call-template name="db2html.block.formal">
     <xsl:with-param name="class" select="'list'"/>
-    <xsl:with-param name="formal" select="true()"/>
   </xsl:call-template>
 </xsl:template>
 
diff --git a/xslt/docbook/html/db2html-block.xsl b/xslt/docbook/html/db2html-block.xsl
index bd53a47..5ce3777 100644
--- a/xslt/docbook/html/db2html-block.xsl
+++ b/xslt/docbook/html/db2html-block.xsl
@@ -26,56 +26,65 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
 <!--!!==========================================================================
 DocBook to HTML - Block Elements
-:Requires: db-chunk db-common db-xref db2html-xref gettext html utils
-:Revision:version="1.0" date="2011-05-12" status="final"
+:Revision:version="3.4" date="2011-11-12" status="final"
 
-This module handles most simple block-level elements, turning them into the
-appropriate HTML tags.  It does not handle tables, lists, and various other
+This stylesheet handles most simple block-level elements, turning them into
+the appropriate HTML tags. It does not handle tables, lists, and various other
 complex block-level elements.
 -->
 
 
 <!--**==========================================================================
 db2html.block
-Output an HTML #{div} elements for a block-level element.
-:Revision:version="1.0" date="2011-05-12" status="final"
+Output an HTML #{div} element for a block-level element.
+:Revision:version="3.4" date="2011-11-12" status="final"
 $node: The block-level element to render.
-$class: An extra string to insert in the #{class} attribute.
-$verbatim: Whether to maintain whitespace as written.
-$formal: Whether this is a formal block element.
-$title: When ${formal} is true, an element to use for the title.
-$caption: When ${formal} is true, an element to use for the caption.
-$titleattr: An optional value for the HTML #{title} attribute.
+$class: The value of the HTML #{class} attribute.
 
 This template creates an HTML #{div} element for the given DocBook element.
-This template uses the parameters to construct the #{class} attribute, which
-is then used by the CSS for styling.
+If the ${class} parameter is not provided, it uses the local name of ${node}.
+-->
+<xsl:template name="db2html.block">
+  <xsl:param name="node" select="."/>
+  <xsl:param name="class" select="local-name($node)"/>
+  <div class="{$class}">
+    <xsl:call-template name="html.lang.attrs">
+      <xsl:with-param name="node" select="$node"/>
+    </xsl:call-template>
+    <xsl:call-template name="db2html.anchor">
+      <xsl:with-param name="node" select="$node"/>
+    </xsl:call-template>
+    <xsl:apply-templates select="$node/node()"/>
+  </div>
+</xsl:template>
 
-If ${formal} is #{true}, the ${title} and ${caption} parameters are processed,
-and extra container #{div} elements are output for styling.
 
-If ${verbatim} is #{true}, the #{div} is marked with the #{verbatim} class,
-which maintains whitespace. This is not the same as outputting a #{pre} tag,
-which is what *{db2html.pre} does. Verbatim text from this template is not
-formatted with a fixed-width font.
+<!--**==========================================================================
+db2html.block.formal
+Output HTML for a block-level element with an optional title and caption.
+:Revision:version="3.4" date="2011-11-12" status="final"
+$node: The block-level element to render.
+$class: The value of the HTML #{class} attribute.
+$title: An element to use for the title.
+$caption: An element to use for the caption.
+$titleattr: An optional value for the HTML #{title} attribute.
+
+This template outputs HTML for a formal DocBook element, one that can have
+a title or caption. If the ${class} parameter is not provided, it uses the
+local name of ${node}. Even if ${title} and ${caption} are both empty, this
+template still outputs the extra wrapper elements for formal elements. If
+${titleattr} is provided, it is used for the value of the HTML #{title}
+attribute on the outermost #{div} element.
 -->
-<xsl:template name="db2html.block">
+<xsl:template name="db2html.block.formal">
   <xsl:param name="node" select="."/>
-  <xsl:param name="class" select="''"/>
-	<xsl:param name="verbatim" select="$node[ xml:space = 'preserve']"/>
-  <xsl:param name="formal" select="false()"/>
-  <xsl:param name="title" select="$node/title | $node/db:title |
-                                  $node/db:info/db:title"/>
+  <xsl:param name="class" select="local-name($node)"/>
+  <xsl:param name="title" select="$node/title | $node/blockinfo/title |
+                                  $node/db:title | $node/db:info/db:title"/>
   <xsl:param name="caption" select="$node/caption | $node/db:caption"/>
   <xsl:param name="titleattr" select="''"/>
 
-  <div>
-    <xsl:attribute name="class">
-      <xsl:value-of select="concat($class, ' ', local-name($node))"/>
-      <xsl:if test="$verbatim">
-        <xsl:text> verbatim</xsl:text>
-      </xsl:if>
-    </xsl:attribute>
+  <div class="{$class}">
     <xsl:if test="$titleattr != ''">
       <xsl:attribute name="title">
         <xsl:value-of select="$titleattr"/>
@@ -87,54 +96,47 @@ formatted with a fixed-width font.
     <xsl:call-template name="db2html.anchor">
       <xsl:with-param name="node" select="$node"/>
     </xsl:call-template>
-    <xsl:choose>
-      <xsl:when test="$formal">
-        <div class="inner">
-          <xsl:if test="$node/self::figure or $node/self::db:figure">
-            <a href="#" class="zoom">
-              <xsl:attribute name="data-zoom-in-title">
-                <xsl:call-template name="l10n.gettext">
-                  <xsl:with-param name="msgid" select="'View images at normal size'"/>
-                </xsl:call-template>
-              </xsl:attribute>
-              <xsl:attribute name="data-zoom-out-title">
-                <xsl:call-template name="l10n.gettext">
-                  <xsl:with-param name="msgid" select="'Scale images down'"/>
-                </xsl:call-template>
-              </xsl:attribute>
-            </a>
-          </xsl:if>
-          <xsl:if test="$title">
-            <xsl:call-template name="db2html.block.title">
-              <xsl:with-param name="node" select="$node"/>
-              <xsl:with-param name="title" select="$title"/>
+    <div class="inner">
+      <xsl:if test="$node/self::figure or $node/self::db:figure">
+        <a href="#" class="zoom">
+          <xsl:attribute name="data-zoom-in-title">
+            <xsl:call-template name="l10n.gettext">
+              <xsl:with-param name="msgid" select="'View images at normal size'"/>
             </xsl:call-template>
-          </xsl:if>
-          <div class="region">
-            <div class="contents">
-              <xsl:apply-templates select="$node/node()[not(set:has-same-node(., $title | $caption))]"/>
-            </div>
-            <xsl:apply-templates select="$caption"/>
-          </div>
+          </xsl:attribute>
+          <xsl:attribute name="data-zoom-out-title">
+            <xsl:call-template name="l10n.gettext">
+              <xsl:with-param name="msgid" select="'Scale images down'"/>
+            </xsl:call-template>
+          </xsl:attribute>
+        </a>
+      </xsl:if>
+      <xsl:if test="$title">
+        <xsl:call-template name="db2html.block.title">
+          <xsl:with-param name="node" select="$node"/>
+          <xsl:with-param name="title" select="$title"/>
+        </xsl:call-template>
+      </xsl:if>
+      <div class="region">
+        <div class="contents">
+          <xsl:apply-templates select="$node/node()[not(set:has-same-node(., $title | $caption))]"/>
         </div>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:apply-templates select="$node/node()"/>
-      </xsl:otherwise>
-    </xsl:choose>
+        <xsl:apply-templates select="$caption"/>
+      </div>
+    </div>
   </div>
 </xsl:template>
 
 
 <!--**==========================================================================
 db2html.block.title
-Render a formal title for a block-level element.
-:Revision:version="1.0" date="2011-05-12" status="final"
+Output a formal title for a block-level element.
+:Revision:version="3.4" date="2011-11-12" status="final"
 $node: The block-level element being processed.
 $title: The element containing the title.
 
 This template formats the contents of ${title} as a title for a block-level
-element.  It is called by *{db2html.block} for formal block elements.
+element.  It is called by *{db2html.block.formal}.
 -->
 <xsl:template name="db2html.block.title">
   <xsl:param name="node" select="."/>
@@ -173,11 +175,11 @@ element.  It is called by *{db2html.block} for formal block elements.
 <!--**==========================================================================
 db2html.blockquote
 Output an HTML #{blockquote} element.
-:Revision:version="1.0" date="2011-05-12" status="final"
-$node: The #{blockquote} element to render.
+:Revision:version="3.4" date="2011-11-12" status="final"
+$node: The DocBook element ot render as a quote.
 
 This template creates an HTML #{blockquote} element for the given DocBook
-element.
+element. It's used for the DocBook #{blockquote} and #{epigraph} elements.
 -->
 <xsl:template name="db2html.blockquote">
   <xsl:param name="node" select="."/>
@@ -197,7 +199,8 @@ element.
                                    $node/db:info/db:title"/>
       <div class="region">
         <blockquote class="{local-name($node)}">
-          <xsl:apply-templates select="$node/node()[not(self::title) and not(self::attribution) and not(self::db:title) and not(self::db:attribution)]"/>
+          <xsl:apply-templates select="$node/node()[not(self::title) and not(self::attribution) and
+                                                    not(self::db:title) and not(self::db:attribution)]"/>
         </blockquote>
         <xsl:apply-templates select="$node/attribution | $node/db:attribution"/>
       </div>
@@ -209,19 +212,17 @@ element.
 <!--**==========================================================================
 db2html.para
 Output an HTML #{p} element for a block-level element.
-:Revision:version="1.0" date="2011-05-12" status="final"
+:Revision:version="3.4" date="2011-11-12" status="final"
 $node: The block-level element to render.
-$class: The value of the HTMl #{class} attribute.
+$class: The value of the HTML #{class} attribute.
 
 This template creates an HTML #{p} element for the given DocBook element.
+If the ${class} parameter is not provided, it uses the local name of ${node}.
 -->
 <xsl:template name="db2html.para">
   <xsl:param name="node" select="."/>
   <xsl:param name="class" select="local-name($node)"/>
-  <p>
-    <xsl:attribute name="class">
-      <xsl:value-of select="$class"/>
-    </xsl:attribute>
+  <p class="{$class}">
     <xsl:call-template name="html.lang.attrs">
       <xsl:with-param name="node" select="$node"/>
     </xsl:call-template>
@@ -235,14 +236,14 @@ This template creates an HTML #{p} element for the given DocBook element.
 
 <!--**==========================================================================
 db2html.pre
-Output and HTML #{pre} elements for a block-level element.
+Output an HTML #{pre} element for a block-level element.
+:Revision:version="3.4" date="2011-11-12" status="final"
 $node: The block-level element to render.
-$class: An extra string to insert in the #{class} attribute.
+$class: The value of the HTML #{class} attribute.
 $children: The child elements to process.
 
 This template creates an HTML #{pre} element for the given DocBook element.
-This template uses the parameters to construct the #{class} attribute, which
-is then used by the CSS for styling.
+If the ${class} parameter is not provided, it uses the local name of ${node}.
 
 If ${node} has the #{linenumbering} attribute set to #{"numbered"}, then this
 template will create line numbers for each line, using the *{utils.linenumbering}
@@ -256,13 +257,9 @@ syntax highlighting support based on the #{language} attribute of ${node}.
 -->
 <xsl:template name="db2html.pre">
   <xsl:param name="node" select="."/>
-  <xsl:param name="class" select="''"/>
+  <xsl:param name="class" select="local-name($node)"/>
   <xsl:param name="children" select="$node/node()"/>
-
-  <div>
-    <xsl:attribute name="class">
-      <xsl:value-of select="concat($class, ' ', local-name($node))"/>
-    </xsl:attribute>
+  <div class="{$class}">
     <xsl:call-template name="html.lang.attrs">
       <xsl:with-param name="node" select="$node"/>
     </xsl:call-template>
@@ -372,17 +369,18 @@ syntax highlighting support based on the #{language} attribute of ${node}.
 </xsl:template>
 
 <!-- = ackno = -->
-<xsl:template match="ackno | db:acknowledgements/db:para">
-  <xsl:call-template name="db2html.para">
-    <xsl:with-param name="class" select="'ackno'"/>
-  </xsl:call-template>
+<xsl:template match="ackno">
+  <xsl:call-template name="db2html.para"/>
+</xsl:template>
+
+<!-- = acknowledgements = -->
+<xsl:template match="db:acknowledgements">
+  <xsl:call-template name="db2html.block"/>
 </xsl:template>
 
 <!-- = address = -->
 <xsl:template match="address | db:address">
-  <xsl:call-template name="db2html.block">
-    <xsl:with-param name="verbatim" select="true()"/>
-  </xsl:call-template>
+  <xsl:call-template name="db2html.block"/>
 </xsl:template>
 
 <!-- = attribution = -->
@@ -406,9 +404,8 @@ syntax highlighting support based on the #{language} attribute of ${node}.
 
 <!-- = caution = -->
 <xsl:template match="caution | db:caution">
-  <xsl:call-template name="db2html.block">
+  <xsl:call-template name="db2html.block.formal">
     <xsl:with-param name="class" select="'note note-warning'"/>
-    <xsl:with-param name="formal" select="true()"/>
     <xsl:with-param name="titleattr">
       <xsl:call-template name="l10n.gettext">
         <xsl:with-param name="msgid" select="'Warning'"/>
@@ -424,27 +421,18 @@ syntax highlighting support based on the #{language} attribute of ${node}.
 
 <!-- = equation = -->
 <xsl:template match="equation | db:equation">
-  <xsl:call-template name="db2html.block">
-    <xsl:with-param name="formal" select="true()"/>
-  </xsl:call-template>
+  <xsl:call-template name="db2html.block.formal"/>
 </xsl:template>
 
 <!-- = example = -->
 <xsl:template match="example | db:example">
-  <xsl:call-template name="db2html.block">
-    <xsl:with-param name="formal" select="true()"/>
-  </xsl:call-template>
+  <xsl:call-template name="db2html.block.formal"/>
 </xsl:template>
 
 <!-- = figure = -->
 <xsl:template match="figure | informalfigure | db:figure | db:informalfigure">
-  <xsl:call-template name="db2html.block">
-    <xsl:with-param name="class">
-      <xsl:if test="self::informalfigure | self::db:informalfigure">
-        <xsl:text>figure</xsl:text>
-      </xsl:if>
-    </xsl:with-param>
-    <xsl:with-param name="formal" select="true()"/>
+  <xsl:call-template name="db2html.block.formal">
+    <xsl:with-param name="class" select="'figure'"/>
     <!-- When a figure contains only a single mediaobject, it eats the caption -->
     <xsl:with-param name="caption"
                     select="*[not(self::blockinfo) and not(self::title) and not(self::titleabbrev)]
@@ -456,91 +444,7 @@ syntax highlighting support based on the #{language} attribute of ${node}.
 
 <!-- = formalpara = -->
 <xsl:template match="formalpara | db:formalpara">
-  <xsl:call-template name="db2html.block">
-    <xsl:with-param name="formal" select="true()"/>
-  </xsl:call-template>
-</xsl:template>
-
-<!-- = glossdef = -->
-<xsl:template match="glossdef | db:glossdef">
-  <dd class="glossdef">
-    <xsl:apply-templates select="*[not(self::glossseealso) and not(self::db:glossseealso)]"/>
-  </dd>
-  <xsl:apply-templates select="glossseealso[1] | db:glossseealso[1]"/>
-</xsl:template>
-
-<!-- = glossentry = -->
-<xsl:template match="glossentry | db:glossentry">
-  <dt>
-    <xsl:attribute name="class">
-      <xsl:text>glossterm</xsl:text>
-    </xsl:attribute>
-    <xsl:call-template name="html.lang.attrs"/>
-    <xsl:call-template name="db2html.anchor"/>
-    <xsl:apply-templates select="glossterm | db:glossterm"/>
-    <xsl:if test="acronym or abbrev or db:acronym or db:abbrev">
-      <xsl:text> (</xsl:text>
-      <xsl:apply-templates select="(acronym | abbrev | db:acronym | db:abbrev)[1]"/>
-      <xsl:text>)</xsl:text>
-    </xsl:if>
-  </dt>
-  <xsl:apply-templates select="glossdef | glosssee[1] | db:glossdef | db:glosssee[1]"/>
-</xsl:template>
-
-<!-- = glosssee(also) = -->
-<xsl:template match="glosssee | glossseealso | db:glosssee | db:glossseealso">
-  <dd class="{local-name(.)}">
-    <p>
-      <xsl:call-template name="l10n.gettext">
-        <xsl:with-param name="msgid" select="concat(local-name(.), '.format')"/>
-        <xsl:with-param name="node" select="."/>
-        <xsl:with-param name="format" select="true()"/>
-      </xsl:call-template>
-    </p>
-  </dd>
-</xsl:template>
-
-<!--#% l10n.format.mode -->
-<xsl:template mode="l10n.format.mode" match="msg:glosssee">
-  <xsl:param name="node"/>
-  <xsl:for-each select="$node |
-                        $node/following-sibling::*[name(.) = name($node)]">
-    <xsl:if test="position() != 1">
-      <xsl:call-template name="l10n.gettext">
-        <xsl:with-param name="msgid" select="', '"/>
-      </xsl:call-template>
-    </xsl:if>
-    <xsl:choose>
-      <xsl:when test="@otherterm">
-        <a>
-          <xsl:attribute name="href">
-            <xsl:call-template name="db.xref.target">
-              <xsl:with-param name="linkend" select="@otherterm"/>
-            </xsl:call-template>
-          </xsl:attribute>
-          <xsl:attribute name="title">
-            <xsl:call-template name="db.xref.tooltip">
-              <xsl:with-param name="linkend" select="@otherterm"/>
-            </xsl:call-template>
-          </xsl:attribute>
-          <xsl:choose>
-            <xsl:when test="normalize-space(.) != ''">
-              <xsl:apply-templates/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:call-template name="db.xref.content">
-                <xsl:with-param name="linkend" select="@otherterm"/>
-                <xsl:with-param name="role" select="'glosssee'"/>
-              </xsl:call-template>
-            </xsl:otherwise>
-          </xsl:choose>
-        </a>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:apply-templates/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:for-each>
+  <xsl:call-template name="db2html.block.formal"/>
 </xsl:template>
 
 <!-- = highlights = -->
@@ -550,9 +454,8 @@ syntax highlighting support based on the #{language} attribute of ${node}.
 
 <!-- = important = -->
 <xsl:template match="important | db:important">
-  <xsl:call-template name="db2html.block">
+  <xsl:call-template name="db2html.block.formal">
     <xsl:with-param name="class" select="'note note-important'"/>
-    <xsl:with-param name="formal" select="true()"/>
     <xsl:with-param name="titleattr">
       <xsl:call-template name="l10n.gettext">
         <xsl:with-param name="msgid" select="'Important'"/>
@@ -573,21 +476,18 @@ syntax highlighting support based on the #{language} attribute of ${node}.
 
 <!-- = literallayout = -->
 <xsl:template match="literallayout | db:literallayout">
-  <xsl:call-template name="db2html.block">
-    <xsl:with-param name="verbatim" select="true()"/>
-  </xsl:call-template>
+  <xsl:call-template name="db2html.block"/>
 </xsl:template>
 
 <!-- = note = -->
 <xsl:template match="note | db:note">
-  <xsl:call-template name="db2html.block">
+  <xsl:call-template name="db2html.block.formal">
     <xsl:with-param name="class">
       <xsl:text>note</xsl:text>
       <xsl:if test="@role = 'bug'">
         <xsl:text> note-bug</xsl:text>
       </xsl:if>
     </xsl:with-param>
-    <xsl:with-param name="formal" select="true()"/>
     <xsl:with-param name="titleattr">
       <xsl:choose>
         <xsl:when test="@role = 'bug'">
@@ -622,6 +522,11 @@ syntax highlighting support based on the #{language} attribute of ${node}.
   <xsl:call-template name="db2html.pre"/>
 </xsl:template>
 
+<!-- = screenshot = -->
+<xsl:template match="screenshot | db:screenshot">
+  <xsl:call-template name="db2html.block"/>
+</xsl:template>
+
 <!-- = simpara = -->
 <xsl:template match="simpara | db:simpara">
   <xsl:call-template name="db2html.para"/>
@@ -634,9 +539,8 @@ syntax highlighting support based on the #{language} attribute of ${node}.
 
 <!-- = tip = -->
 <xsl:template match="tip | db:tip">
-  <xsl:call-template name="db2html.block">
+  <xsl:call-template name="db2html.block.formal">
     <xsl:with-param name="class" select="'note note-tip'"/>
-    <xsl:with-param name="formal" select="true()"/>
     <xsl:with-param name="titleattr">
       <xsl:call-template name="l10n.gettext">
         <xsl:with-param name="msgid" select="'Tip'"/>
@@ -655,9 +559,8 @@ syntax highlighting support based on the #{language} attribute of ${node}.
 
 <!-- = warning = -->
 <xsl:template match="warning | db:warning">
-  <xsl:call-template name="db2html.block">
+  <xsl:call-template name="db2html.block.formal">
     <xsl:with-param name="class" select="'note note-warning'"/>
-    <xsl:with-param name="formal" select="true()"/>
     <xsl:with-param name="titleattr">
       <xsl:call-template name="l10n.gettext">
         <xsl:with-param name="msgid" select="'Warning'"/>
diff --git a/xslt/docbook/html/db2html-callout.xsl b/xslt/docbook/html/db2html-callout.xsl
index 8bd5ed7..45e1ba2 100644
--- a/xslt/docbook/html/db2html-callout.xsl
+++ b/xslt/docbook/html/db2html-callout.xsl
@@ -65,9 +65,7 @@ element, locate the corresponding #{co} element and call this template on it.
 
 <!-- = calloutlist = -->
 <xsl:template match="calloutlist | db:calloutlist">
-  <xsl:call-template name="db2html.block">
-    <xsl:with-param name="formal" select="true()"/>
-  </xsl:call-template>
+  <xsl:call-template name="db2html.block.formal"/>
 </xsl:template>
 
 <!-- = callout == -->
diff --git a/xslt/docbook/html/db2html-css.xsl b/xslt/docbook/html/db2html-css.xsl
index ac73352..13dcbc1 100644
--- a/xslt/docbook/html/db2html-css.xsl
+++ b/xslt/docbook/html/db2html-css.xsl
@@ -77,7 +77,8 @@ div.programlisting .userinput {
   font-weight: bold;
   color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
 }
-div.verbatim { white-space: pre; }
+div.address, div.literallayout { white-space: pre; }
+
 
 <!-- == footnotes == -->
 div.footnotes {
diff --git a/xslt/docbook/html/db2html-list.xsl b/xslt/docbook/html/db2html-list.xsl
index a0dd3ab..57b3648 100644
--- a/xslt/docbook/html/db2html-list.xsl
+++ b/xslt/docbook/html/db2html-list.xsl
@@ -18,8 +18,9 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                 xmlns:db="http://docbook.org/ns/docbook";
+                xmlns:msg="http://projects.gnome.org/yelp/gettext/";
                 xmlns="http://www.w3.org/1999/xhtml";
-                exclude-result-prefixes="db"
+                exclude-result-prefixes="db msg"
                 version="1.0">
 
 <!--!!==========================================================================
@@ -44,6 +45,88 @@ REMARK: Describe this module
   </div>
 </xsl:template>
 
+<!-- = glossdef = -->
+<xsl:template match="glossdef | db:glossdef">
+  <dd class="glossdef">
+    <xsl:apply-templates select="*[not(self::glossseealso) and not(self::db:glossseealso)]"/>
+  </dd>
+  <xsl:apply-templates select="glossseealso[1] | db:glossseealso[1]"/>
+</xsl:template>
+
+<!-- = glossentry = -->
+<xsl:template match="glossentry | db:glossentry">
+  <dt>
+    <xsl:attribute name="class">
+      <xsl:text>glossterm</xsl:text>
+    </xsl:attribute>
+    <xsl:call-template name="html.lang.attrs"/>
+    <xsl:call-template name="db2html.anchor"/>
+    <xsl:apply-templates select="glossterm | db:glossterm"/>
+    <xsl:if test="acronym or abbrev or db:acronym or db:abbrev">
+      <xsl:text> (</xsl:text>
+      <xsl:apply-templates select="(acronym | abbrev | db:acronym | db:abbrev)[1]"/>
+      <xsl:text>)</xsl:text>
+    </xsl:if>
+  </dt>
+  <xsl:apply-templates select="glossdef | glosssee[1] | db:glossdef | db:glosssee[1]"/>
+</xsl:template>
+
+<!-- = glosssee(also) = -->
+<xsl:template match="glosssee | glossseealso | db:glosssee | db:glossseealso">
+  <dd class="{local-name(.)}">
+    <p>
+      <xsl:call-template name="l10n.gettext">
+        <xsl:with-param name="msgid" select="concat(local-name(.), '.format')"/>
+        <xsl:with-param name="node" select="."/>
+        <xsl:with-param name="format" select="true()"/>
+      </xsl:call-template>
+    </p>
+  </dd>
+</xsl:template>
+
+<!--#% l10n.format.mode -->
+<xsl:template mode="l10n.format.mode" match="msg:glosssee">
+  <xsl:param name="node"/>
+  <xsl:for-each select="$node |
+                        $node/following-sibling::*[name(.) = name($node)]">
+    <xsl:if test="position() != 1">
+      <xsl:call-template name="l10n.gettext">
+        <xsl:with-param name="msgid" select="', '"/>
+      </xsl:call-template>
+    </xsl:if>
+    <xsl:choose>
+      <xsl:when test="@otherterm">
+        <a>
+          <xsl:attribute name="href">
+            <xsl:call-template name="db.xref.target">
+              <xsl:with-param name="linkend" select="@otherterm"/>
+            </xsl:call-template>
+          </xsl:attribute>
+          <xsl:attribute name="title">
+            <xsl:call-template name="db.xref.tooltip">
+              <xsl:with-param name="linkend" select="@otherterm"/>
+            </xsl:call-template>
+          </xsl:attribute>
+          <xsl:choose>
+            <xsl:when test="normalize-space(.) != ''">
+              <xsl:apply-templates/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:call-template name="db.xref.content">
+                <xsl:with-param name="linkend" select="@otherterm"/>
+                <xsl:with-param name="role" select="'glosssee'"/>
+              </xsl:call-template>
+            </xsl:otherwise>
+          </xsl:choose>
+        </a>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:for-each>
+</xsl:template>
+
 <!-- = itemizedlist = -->
 <xsl:template match="itemizedlist | db:itemizedlist">
   <div class="list itemizedlist">
diff --git a/xslt/docbook/html/db2html-media.xsl b/xslt/docbook/html/db2html-media.xsl
index 29e9772..6831c7c 100644
--- a/xslt/docbook/html/db2html-media.xsl
+++ b/xslt/docbook/html/db2html-media.xsl
@@ -224,9 +224,4 @@ as a text-only mode.
   </div>
 </xsl:template>
 
-<!-- = screenshot = -->
-<xsl:template match="screenshot | db:screenshot">
-  <xsl:call-template name="db2html.block"/>
-</xsl:template>
-
 </xsl:stylesheet>
diff --git a/xslt/docbook/html/db2html-table.xsl b/xslt/docbook/html/db2html-table.xsl
index 47610cc..4123410 100644
--- a/xslt/docbook/html/db2html-table.xsl
+++ b/xslt/docbook/html/db2html-table.xsl
@@ -1137,30 +1137,4 @@ REMARK: This template needs to be explained in detail, but I forgot how it works
   </xsl:element>
 </xsl:template>
 
-<!-- = table/info/title = -->
-<xsl:template match="db:table/db:info/db:title">
-  <xsl:call-template name="db2html.block.title">
-    <xsl:with-param name="node" select="../.."/>
-    <xsl:with-param name="title" select="."/>
-  </xsl:call-template>
-</xsl:template>
-
-<!-- = table/title = -->
-<xsl:template match="table/title | db:table/db:title">
-  <xsl:call-template name="db2html.block.title">
-    <xsl:with-param name="node" select=".."/>
-    <xsl:with-param name="title" select="."/>
-  </xsl:call-template>
-</xsl:template>
-
-<!--
-This template strips the p tag around single-paragraph table entries to avoid
-introducing extra spacing.
--->
-<xsl:template match="entry/para[
-              not(preceding-sibling::* or following-sibling::*)] |
-              db:entry/db:para[not(preceding-sibling::* or following-sibling::*)]">
-  <xsl:call-template name="db2html.inline"/>
-</xsl:template>
-
 </xsl:stylesheet>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]