diff options
author | Shaun McCance <shaunm@src.gnome.org> | 2008-12-15 19:29:02 +0000 |
---|---|---|
committer | Shaun McCance <shaunm@src.gnome.org> | 2008-12-15 19:29:02 +0000 |
commit | 305e23ea11d0bf29aedbb5d67e44128e66b225f3 (patch) | |
tree | 029db3e4f8413b830321de0f6c2f671f0964647e | |
parent | f5f2e85c3989d1ea34fe972869da98d5c91639ae (diff) | |
download | gnome-doc-utils-305e23ea11d0bf29aedbb5d67e44128e66b225f3.tar.gz |
- More dir attributes
* 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
svn path=/trunk/; revision=1134
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-block.xsl | 6 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-classsynopsis.xsl | 14 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-cmdsynopsis.xsl | 27 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-css.xsl | 5 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-division.xsl | 18 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-list.xsl | 144 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-qanda.xsl | 34 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-table.xsl | 37 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-title.xsl | 18 |
10 files changed, 296 insertions, 20 deletions
@@ -1,3 +1,16 @@ +2008-12-15 Shaun McCance <shaunm@gnome.org> + + * 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 + 2008-12-08 Shaun McCance <shaunm@gnome.org> * xslt/docbook/html/db2html-inline.xsl: diff --git a/xslt/docbook/html/db2html-block.xsl b/xslt/docbook/html/db2html-block.xsl index c60e8c2..c8ad957 100644 --- a/xslt/docbook/html/db2html-block.xsl +++ b/xslt/docbook/html/db2html-block.xsl @@ -197,7 +197,7 @@ element. 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 @@ This template creates an HTML #{p} element for the given DocBook element. 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 @@ template. 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()"/> diff --git a/xslt/docbook/html/db2html-classsynopsis.xsl b/xslt/docbook/html/db2html-classsynopsis.xsl index fd3e4f9..88eb506 100644 --- a/xslt/docbook/html/db2html-classsynopsis.xsl +++ b/xslt/docbook/html/db2html-classsynopsis.xsl @@ -74,6 +74,20 @@ REMARK: Describe this param 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(.)"/> diff --git a/xslt/docbook/html/db2html-cmdsynopsis.xsl b/xslt/docbook/html/db2html-cmdsynopsis.xsl index 723bd30..2688e4e 100644 --- a/xslt/docbook/html/db2html-cmdsynopsis.xsl +++ b/xslt/docbook/html/db2html-cmdsynopsis.xsl @@ -68,19 +68,6 @@ REMARK: Describe this param <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 @@ div.cmdsynopsis { font-family: monospace; } </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::* diff --git a/xslt/docbook/html/db2html-css.xsl b/xslt/docbook/html/db2html-css.xsl index 9e71aa5..1dc6037 100644 --- a/xslt/docbook/html/db2html-css.xsl +++ b/xslt/docbook/html/db2html-css.xsl @@ -23,7 +23,7 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA <!--!!========================================================================== 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.synopsis { } 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 @@ span.wordasword { font-style: italic; } </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> diff --git a/xslt/docbook/html/db2html-division.xsl b/xslt/docbook/html/db2html-division.xsl index 5e4f031..68c7e9a 100644 --- a/xslt/docbook/html/db2html-division.xsl +++ b/xslt/docbook/html/db2html-division.xsl @@ -263,6 +263,8 @@ $depth_of_chunk: The depth of the containing chunk in the document $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 @@ REMARK: Talk about some of the parameters 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> diff --git a/xslt/docbook/html/db2html-list.xsl b/xslt/docbook/html/db2html-list.xsl index ac0217a..fdd9eae 100644 --- a/xslt/docbook/html/db2html-list.xsl +++ b/xslt/docbook/html/db2html-list.xsl @@ -33,6 +33,13 @@ REMARK: Describe this module <!-- = 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 @@ REMARK: Describe this module <!-- = 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 @@ REMARK: Describe this module 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 @@ REMARK: Describe this module </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 @@ REMARK: Describe this module 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 @@ REMARK: Describe this module <!-- = 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 @@ REMARK: Describe this module <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 @@ REMARK: Describe this module <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 @@ REMARK: Describe this module <!-- = 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 @@ REMARK: Describe this module <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 @@ REMARK: Describe this module <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 @@ REMARK: Describe this module </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 @@ REMARK: Describe this module </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 @@ REMARK: Describe this module 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 @@ REMARK: Describe this module <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 @@ REMARK: Describe this module <!-- = 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 @@ REMARK: Describe this module <!-- = 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 @@ REMARK: Describe this module <!-- = 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> diff --git a/xslt/docbook/html/db2html-qanda.xsl b/xslt/docbook/html/db2html-qanda.xsl index aab3b67..3060d0c 100644 --- a/xslt/docbook/html/db2html-qanda.xsl +++ b/xslt/docbook/html/db2html-qanda.xsl @@ -54,6 +54,22 @@ dd.answer div.label { float: left; } <!-- = 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 @@ dd.answer div.label { float: left; } </xsl:call-template> </xsl:template> -<!-- = entry = --> +<!-- = qandaentry = --> <xsl:template match="qandaentry"> <xsl:apply-templates/> </xsl:template> @@ -112,6 +128,22 @@ dd.answer div.label { float: left; } <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'"/> diff --git a/xslt/docbook/html/db2html-table.xsl b/xslt/docbook/html/db2html-table.xsl index 08b05ce..5f2adba 100644 --- a/xslt/docbook/html/db2html-table.xsl +++ b/xslt/docbook/html/db2html-table.xsl @@ -413,6 +413,22 @@ element to output the next #{td}. </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 @@ REMARK: This template needs to be explained in detail, but I forgot how it works <!-- = 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 @@ REMARK: This template needs to be explained in detail, but I forgot how it works </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 @@ REMARK: This template needs to be explained in detail, but I forgot how it works <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"/> diff --git a/xslt/docbook/html/db2html-title.xsl b/xslt/docbook/html/db2html-title.xsl index f33c186..47621ae 100644 --- a/xslt/docbook/html/db2html-title.xsl +++ b/xslt/docbook/html/db2html-title.xsl @@ -33,18 +33,36 @@ db2html.title.block 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"/> |