gnome-doc-utils r1134 - in trunk: . xslt/docbook/html



Author: shaunm
Date: Mon Dec 15 19:29:02 2008
New Revision: 1134
URL: http://svn.gnome.org/viewvc/gnome-doc-utils?rev=1134&view=rev

Log:
* xslt/docbook/html/db2html-title.xsl:
* xslt/docbook/html/db2html-list.xsl:
* xslt/docbook/html/db2html-cmdsynopsis.xsl:
* xslt/docbook/html/db2html-division.xsl:
* xslt/docbook/html/db2html-qanda.xsl:
* xslt/docbook/html/db2html-table.xsl:
* xslt/docbook/html/db2html-css.xsl:
* xslt/docbook/html/db2html-block.xsl:
* xslt/docbook/html/db2html-classsynopsis.xsl:
- More dir attributes


Modified:
   trunk/ChangeLog
   trunk/xslt/docbook/html/db2html-block.xsl
   trunk/xslt/docbook/html/db2html-classsynopsis.xsl
   trunk/xslt/docbook/html/db2html-cmdsynopsis.xsl
   trunk/xslt/docbook/html/db2html-css.xsl
   trunk/xslt/docbook/html/db2html-division.xsl
   trunk/xslt/docbook/html/db2html-list.xsl
   trunk/xslt/docbook/html/db2html-qanda.xsl
   trunk/xslt/docbook/html/db2html-table.xsl
   trunk/xslt/docbook/html/db2html-title.xsl

Modified: trunk/xslt/docbook/html/db2html-block.xsl
==============================================================================
--- trunk/xslt/docbook/html/db2html-block.xsl	(original)
+++ trunk/xslt/docbook/html/db2html-block.xsl	Mon Dec 15 19:29:02 2008
@@ -197,7 +197,7 @@
              select="not($node/preceding-sibling::*
                      [not(self::blockinfo) and not(self::title) and
                       not(self::titleabbrev) and not(self::attribution) ])"/>
-  <xsl:param name="lang" select="$title/@lang"/>
+  <xsl:param name="lang" select="$node/@lang"/>
   <xsl:param name="dir" select="false()"/>
   <xsl:param name="ltr" select="false()"/>
 
@@ -257,7 +257,7 @@
              select="not($node/preceding-sibling::*
                      [not(self::blockinfo) and not(self::title) and
                       not(self::titleabbrev) and not(self::attribution) ])"/>
-  <xsl:param name="lang" select="$title/@lang"/>
+  <xsl:param name="lang" select="$node/@lang"/>
   <xsl:param name="dir" select="false()"/>
   <xsl:param name="ltr" select="false()"/>
 
@@ -325,7 +325,7 @@
                       not(self::titleabbrev) and not(self::attribution) ])"/>
   <xsl:param name="indent" select="false()"/>
   <xsl:param name="children" select="$node/node()"/>
-  <xsl:param name="lang" select="$title/@lang"/>
+  <xsl:param name="lang" select="$node/@lang"/>
   <xsl:param name="dir" select="false()"/>
   <xsl:param name="ltr" select="true()"/>
 

Modified: trunk/xslt/docbook/html/db2html-classsynopsis.xsl
==============================================================================
--- trunk/xslt/docbook/html/db2html-classsynopsis.xsl	(original)
+++ trunk/xslt/docbook/html/db2html-classsynopsis.xsl	Mon Dec 15 19:29:02 2008
@@ -74,6 +74,20 @@
                          not(self::titleabbrev) and not(self::attribution) ])"/>
 
   <div>
+    <xsl:choose>
+      <xsl:when test="@lang">
+        <xsl:attribute name="dir">
+          <xsl:call-template name="l10n.direction">
+            <xsl:with-param name="lang" select="@lang"/>
+          </xsl:call-template>
+        </xsl:attribute>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:attribute name="dir">
+          <xsl:text>ltr</xsl:text>
+        </xsl:attribute>
+      </xsl:otherwise>
+    </xsl:choose>
     <xsl:attribute name="class">
       <xsl:text>block synopsis </xsl:text>
       <xsl:value-of select="local-name(.)"/>

Modified: trunk/xslt/docbook/html/db2html-cmdsynopsis.xsl
==============================================================================
--- trunk/xslt/docbook/html/db2html-cmdsynopsis.xsl	(original)
+++ trunk/xslt/docbook/html/db2html-cmdsynopsis.xsl	Mon Dec 15 19:29:02 2008
@@ -68,19 +68,6 @@
 <xsl:param name="db2html.group.rep" select="'norepeat'"/>
 
 
-<!--**==========================================================================
-db2html.cmdsynopsis.css
-Outputs CSS that controls the appearance of command synopsis elements
-
-REMARK: Describe this template
--->
-<xsl:template name="db2html.cmdsynopsis.css">
-<xsl:text>
-div.cmdsynopsis { font-family: monospace; }
-</xsl:text>
-</xsl:template>
-
-
 <!-- == Matched Templates == -->
 
 <!-- = arg = -->
@@ -173,6 +160,20 @@
     </xsl:choose>
   </xsl:param>
   <div>
+    <xsl:choose>
+      <xsl:when test="@lang">
+        <xsl:attribute name="dir">
+          <xsl:call-template name="l10n.direction">
+            <xsl:with-param name="lang" select="@lang"/>
+          </xsl:call-template>
+        </xsl:attribute>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:attribute name="dir">
+          <xsl:text>ltr</xsl:text>
+        </xsl:attribute>
+      </xsl:otherwise>
+    </xsl:choose>
     <xsl:attribute name="class">
       <xsl:text>synopsis cmdsynopsis block</xsl:text>
       <xsl:if test="not(preceding-sibling::*

Modified: trunk/xslt/docbook/html/db2html-css.xsl
==============================================================================
--- trunk/xslt/docbook/html/db2html-css.xsl	(original)
+++ trunk/xslt/docbook/html/db2html-css.xsl	Mon Dec 15 19:29:02 2008
@@ -23,7 +23,7 @@
 
 <!--!!==========================================================================
 DocBook to HTML - CSS
-:Requires: db2html-footnote db2html-callout db2html-cmdsynopsis db2html-qanda gettext theme
+:Requires: db2html-footnote db2html-callout db2html-qanda gettext theme
 
 REMARK: Describe this module
 -->
@@ -401,7 +401,7 @@
 }
 div.synopsis div.block { margin-top: 0.2em; }
 div.synopsis div.block-first { margin-top: 0; }
-
+div.cmdsynopsis { font-family: monospace; }
 
 span.accel { text-decoration: underline; }
 span.acronym { font-family: sans-serif; }
@@ -482,7 +482,6 @@
 </xsl:text>
   <xsl:call-template name="db2html.footnote.css"/>
   <xsl:call-template name="db2html.callout.css"/>
-  <xsl:call-template name="db2html.cmdsynopsis.css"/>
   <xsl:call-template name="db2html.qanda.css"/>
 <xsl:call-template name="db2html.css.custom"/>
 </xsl:template>

Modified: trunk/xslt/docbook/html/db2html-division.xsl
==============================================================================
--- trunk/xslt/docbook/html/db2html-division.xsl	(original)
+++ trunk/xslt/docbook/html/db2html-division.xsl	Mon Dec 15 19:29:02 2008
@@ -263,6 +263,8 @@
 $chunk_divisions: Whether to create new documents for ${divisions}
 $chunk_info: Whether to create a new document for a title page
 $autotoc_depth: How deep to create contents listings of ${divisions}
+$lang: The locale of the text in ${node}
+$dir: The text direction, either #{ltr} or #{rtl}
 
 REMARK: Talk about some of the parameters
 -->
@@ -296,8 +298,24 @@
              select="($depth_of_chunk = 0) and
                      ($depth_in_chunk = 0 and $info)"/>
   <xsl:param name="autotoc_depth" select="number(boolean($divisions))"/>
+  <xsl:param name="lang" select="$node/@lang"/>
+  <xsl:param name="dir" select="false()"/>
 
   <div class="division {local-name($node)}">
+    <xsl:choose>
+      <xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
+        <xsl:attribute name="dir">
+          <xsl:value-of select="$dir"/>
+        </xsl:attribute>
+      </xsl:when>
+      <xsl:when test="$lang">
+        <xsl:attribute name="dir">
+          <xsl:call-template name="l10n.direction">
+            <xsl:with-param name="lang" select="$lang"/>
+          </xsl:call-template>
+        </xsl:attribute>
+      </xsl:when>
+    </xsl:choose>
     <xsl:call-template name="db2html.anchor">
       <xsl:with-param name="node" select="$node"/>
     </xsl:call-template>

Modified: trunk/xslt/docbook/html/db2html-list.xsl
==============================================================================
--- trunk/xslt/docbook/html/db2html-list.xsl	(original)
+++ trunk/xslt/docbook/html/db2html-list.xsl	Mon Dec 15 19:29:02 2008
@@ -33,6 +33,13 @@
 <!-- = variablelist = -->
 <xsl:template match="glosslist">
   <div class="block list glosslist">
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:call-template name="db2html.anchor"/>
     <xsl:apply-templates select="title"/>
     <dl class="glosslist">
@@ -44,6 +51,13 @@
 <!-- = itemizedlist = -->
 <xsl:template match="itemizedlist">
   <div class="block list itemizedlist">
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:call-template name="db2html.anchor"/>
     <xsl:apply-templates select="*[not(self::listitem)]"/>
     <ul class="itemizedlist">
@@ -73,6 +87,13 @@
              select="not(preceding-sibling::*
                      [not(self::blockinfo) and not(self::title) and not(self::titleabbrev)])"/>
   <li>
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:if test="$first">
       <xsl:attribute name="class">
         <xsl:text>li-first</xsl:text>
@@ -111,6 +132,13 @@
   </xsl:variable>
   <!-- FIXME: auto-numeration for nested lists -->
   <div class="block list orderedlist">
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:call-template name="db2html.anchor"/>
     <xsl:apply-templates select="*[not(self::listitem)]"/>
     <ol class="orderedlist">
@@ -148,6 +176,13 @@
              select="not(preceding-sibling::*
                      [not(self::blockinfo) and not(self::title) and not(self::titleabbrev)])"/>
   <li>
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:if test="$first">
       <xsl:attribute name="class">
         <xsl:text>li-first</xsl:text>
@@ -166,6 +201,13 @@
 <!-- = procedure = -->
 <xsl:template match="procedure">
   <div class="block list procedure">
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:call-template name="db2html.anchor"/>
     <xsl:apply-templates select="*[not(self::step)]"/>
     <xsl:choose>
@@ -187,6 +229,13 @@
 <xsl:template match="seg">
   <xsl:variable name="position" select="count(preceding-sibling::seg) + 1"/>
   <p class="block seg">
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:if test="$position = 1">
       <xsl:attribute name="class">
         <xsl:text>segfirst</xsl:text>
@@ -201,6 +250,13 @@
 <xsl:template match="seglistitem">
   <xsl:param name="position" select="count(preceding-sibling::seglistitem) + 1"/>
   <div class="block seglistitem">
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <div>
       <xsl:attribute name="class">
         <xsl:choose>
@@ -221,6 +277,13 @@
 <!-- = segmentedlist = -->
 <xsl:template match="segmentedlist">
   <div class="block list segmentedlist">
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:call-template name="db2html.anchor"/>
     <xsl:apply-templates select="title"/>
     <xsl:apply-templates select="seglistitem"/>
@@ -231,6 +294,13 @@
 <xsl:template match="segtitle">
   <!-- FIXME: no style tags -->
   <b>
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:apply-templates/>
     <!-- FIXME: i18n -->
     <xsl:text>: </xsl:text>
@@ -252,6 +322,13 @@
   <xsl:choose>
     <xsl:when test="@type = 'inline'">
       <span class="simplelist">
+        <xsl:if test="@lang">
+          <xsl:attribute name="dir">
+            <xsl:call-template name="l10n.direction">
+              <xsl:with-param name="lang" select="@lang"/>
+            </xsl:call-template>
+          </xsl:attribute>
+        </xsl:if>
         <xsl:call-template name="db2html.anchor"/>
         <xsl:for-each select="member">
           <xsl:if test="position() != 1">
@@ -265,6 +342,13 @@
     </xsl:when>
     <xsl:when test="@type = 'horiz'">
       <div class="block list simplelist">
+        <xsl:if test="@lang">
+          <xsl:attribute name="dir">
+            <xsl:call-template name="l10n.direction">
+              <xsl:with-param name="lang" select="@lang"/>
+            </xsl:call-template>
+          </xsl:attribute>
+        </xsl:if>
         <xsl:call-template name="db2html.anchor"/>
         <table class="simplelist">
           <xsl:for-each select="member[$columns = 1 or position() mod $columns = 1]">
@@ -289,6 +373,13 @@
     </xsl:when>
     <xsl:otherwise>
       <div class="block list simplelist">
+        <xsl:if test="@lang">
+          <xsl:attribute name="dir">
+            <xsl:call-template name="l10n.direction">
+              <xsl:with-param name="lang" select="@lang"/>
+            </xsl:call-template>
+          </xsl:attribute>
+        </xsl:if>
         <xsl:call-template name="db2html.anchor"/>
         <xsl:variable name="rows" select="ceiling(count(member) div $columns)"/>
         <table class="simplelist">
@@ -325,6 +416,13 @@
              select="not(preceding-sibling::*
                      [not(self::blockinfo) and not(self::title) and not(self::titleabbrev)])"/>
   <li>
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:if test="$first">
       <xsl:attribute name="class">
         <xsl:text>li-first</xsl:text>
@@ -339,6 +437,13 @@
 <xsl:template match="substeps">
   <xsl:variable name="depth" select="count(ancestor::substeps)"/>
   <div class="block list substeps">
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:call-template name="db2html.anchor"/>
     <ol class="substeps">
       <xsl:attribute name="type">
@@ -356,6 +461,22 @@
 <!-- = term = -->
 <xsl:template match="term">
   <dt>
+    <xsl:choose>
+      <xsl:when test="@lang">
+        <xsl:attribute name="dir">
+          <xsl:call-template name="l10n.direction">
+            <xsl:with-param name="lang" select="@lang"/>
+          </xsl:call-template>
+        </xsl:attribute>
+      </xsl:when>
+      <xsl:when test="../@lang">
+        <xsl:attribute name="dir">
+          <xsl:call-template name="l10n.direction">
+            <xsl:with-param name="lang" select="../@lang"/>
+          </xsl:call-template>
+        </xsl:attribute>
+      </xsl:when>
+    </xsl:choose>
     <xsl:attribute name="class">
       <xsl:text>term</xsl:text>
       <xsl:if test="not(../preceding-sibling::varlistentry)">
@@ -374,6 +495,13 @@
 <!-- = variablelist = -->
 <xsl:template match="variablelist">
   <div class="block list variablelist">
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:call-template name="db2html.anchor"/>
     <xsl:apply-templates select="*[not(self::varlistentry)]"/>
     <dl class="variablelist">
@@ -391,6 +519,22 @@
 <!-- = varlistentry/listitem = -->
 <xsl:template match="varlistentry/listitem">
   <dd>
+    <xsl:choose>
+      <xsl:when test="@lang">
+        <xsl:attribute name="dir">
+          <xsl:call-template name="l10n.direction">
+            <xsl:with-param name="lang" select="@lang"/>
+          </xsl:call-template>
+        </xsl:attribute>
+      </xsl:when>
+      <xsl:when test="../@lang">
+        <xsl:attribute name="dir">
+          <xsl:call-template name="l10n.direction">
+            <xsl:with-param name="lang" select="../@lang"/>
+          </xsl:call-template>
+        </xsl:attribute>
+      </xsl:when>
+    </xsl:choose>
     <xsl:call-template name="db2html.anchor"/>
     <xsl:apply-templates/>
   </dd>

Modified: trunk/xslt/docbook/html/db2html-qanda.xsl
==============================================================================
--- trunk/xslt/docbook/html/db2html-qanda.xsl	(original)
+++ trunk/xslt/docbook/html/db2html-qanda.xsl	Mon Dec 15 19:29:02 2008
@@ -54,6 +54,22 @@
 <!-- = answer = -->
 <xsl:template match="answer">
   <dd class="answer">
+    <xsl:choose>
+      <xsl:when test="@lang">
+        <xsl:attribute name="dir">
+          <xsl:call-template name="l10n.direction">
+            <xsl:with-param name="lang" select="@lang"/>
+          </xsl:call-template>
+        </xsl:attribute>
+      </xsl:when>
+      <xsl:when test="../@lang">
+        <xsl:attribute name="dir">
+          <xsl:call-template name="l10n.direction">
+            <xsl:with-param name="lang" select="../@lang"/>
+          </xsl:call-template>
+        </xsl:attribute>
+      </xsl:when>
+    </xsl:choose>
     <div class="label">
       <xsl:call-template name="db.label">
         <xsl:with-param name="role" select="'header'"/>
@@ -83,7 +99,7 @@
   </xsl:call-template>
 </xsl:template>
 
-<!-- = entry = -->
+<!-- = qandaentry = -->
 <xsl:template match="qandaentry">
   <xsl:apply-templates/>
 </xsl:template>
@@ -112,6 +128,22 @@
 <xsl:template match="question">
   <!-- FIXME: dt-first -->
   <dt class="question">
+    <xsl:choose>
+      <xsl:when test="@lang">
+        <xsl:attribute name="dir">
+          <xsl:call-template name="l10n.direction">
+            <xsl:with-param name="lang" select="@lang"/>
+          </xsl:call-template>
+        </xsl:attribute>
+      </xsl:when>
+      <xsl:when test="../@lang">
+        <xsl:attribute name="dir">
+          <xsl:call-template name="l10n.direction">
+            <xsl:with-param name="lang" select="../@lang"/>
+          </xsl:call-template>
+        </xsl:attribute>
+      </xsl:when>
+    </xsl:choose>
     <div class="label">
       <xsl:call-template name="db.label">
         <xsl:with-param name="role" select="'header'"/>

Modified: trunk/xslt/docbook/html/db2html-table.xsl
==============================================================================
--- trunk/xslt/docbook/html/db2html-table.xsl	(original)
+++ trunk/xslt/docbook/html/db2html-table.xsl	Mon Dec 15 19:29:02 2008
@@ -413,6 +413,22 @@
       </xsl:variable>
       <!-- Finally, output the td or th element -->
       <xsl:element name="{$element}" namespace="{$db2html.namespace}">
+        <xsl:choose>
+          <xsl:when test="@lang">
+            <xsl:attribute name="dir">
+              <xsl:call-template name="l10n.direction">
+                <xsl:with-param name="lang" select="@lang"/>
+              </xsl:call-template>
+            </xsl:attribute>
+          </xsl:when>
+          <xsl:when test="../@lang">
+            <xsl:attribute name="dir">
+              <xsl:call-template name="l10n.direction">
+                <xsl:with-param name="lang" select="../@lang"/>
+              </xsl:call-template>
+            </xsl:attribute>
+          </xsl:when>
+        </xsl:choose>
         <xsl:if test="$style != ''">
           <xsl:attribute name="style">
             <xsl:value-of select="normalize-space($style)"/>
@@ -929,6 +945,13 @@
 <!-- = table = -->
 <xsl:template match="table | informaltable">
   <div class="table block block-indent">
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:call-template name="db2html.anchor"/>
     <xsl:apply-templates select="title"/>
     <!-- FIXME: I have no idea what I'm supposed to do with textobject -->
@@ -1000,6 +1023,13 @@
     </xsl:if>
   </xsl:variable>
   <table>
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:if test="../title">
       <xsl:attribute name="summary">
         <xsl:value-of select="../title"/>
@@ -1043,6 +1073,13 @@
   <xsl:param name="colsep" select="''"/>
   <xsl:param name="rowsep" select="''"/>
   <xsl:element name="{local-name(.)}" namespace="{$db2html.namespace}">
+    <xsl:if test="@lang">
+      <xsl:attribute name="dir">
+        <xsl:call-template name="l10n.direction">
+          <xsl:with-param name="lang" select="@lang"/>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:if test="@valign">
       <xsl:attribute name="valign">
         <xsl:value-of select="@valign"/>

Modified: trunk/xslt/docbook/html/db2html-title.xsl
==============================================================================
--- trunk/xslt/docbook/html/db2html-title.xsl	(original)
+++ trunk/xslt/docbook/html/db2html-title.xsl	Mon Dec 15 19:29:02 2008
@@ -33,18 +33,36 @@
 Generates a labeled block title
 $node: The element to generate a title for
 $referent: The element that ${node} is a title for
+$lang: The locale of the text in ${node}
+$dir: The text direction, either #{ltr} or #{rtl}
 
 REMARK: Talk about the different kinds of title blocks
 -->
 <xsl:template name="db2html.title.block">
   <xsl:param name="node" select="."/>
   <xsl:param name="referent" select="$node/.."/>
+  <xsl:param name="lang" select="$node/@lang"/>
+  <xsl:param name="dir" select="false()"/>
   <xsl:variable name="depth_in_chunk">
     <xsl:call-template name="db.chunk.depth-in-chunk">
       <xsl:with-param name="node" select="$referent"/>
     </xsl:call-template>
   </xsl:variable>
   <div class="block block-first {local-name($node)}">
+    <xsl:choose>
+      <xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
+        <xsl:attribute name="dir">
+          <xsl:value-of select="$dir"/>
+        </xsl:attribute>
+      </xsl:when>
+      <xsl:when test="$lang">
+        <xsl:attribute name="dir">
+          <xsl:call-template name="l10n.direction">
+            <xsl:with-param name="lang" select="$lang"/>
+          </xsl:call-template>
+        </xsl:attribute>
+      </xsl:when>
+    </xsl:choose>
     <span class="{local-name($node)}">
       <xsl:call-template name="db2html.anchor">
         <xsl:with-param name="node" select="$node"/>



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