[yelp-xsl] Unify some DocBook 4/5 differences
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp-xsl] Unify some DocBook 4/5 differences
- Date: Fri, 21 May 2010 23:32:42 +0000 (UTC)
commit 3791019a429e1935ead7101075f3418172b63135
Author: brian m. carlson <sandals crustytoothpaste ath cx>
Date: Fri Mar 26 17:09:04 2010 +0000
Unify some DocBook 4/5 differences
In some cases, the output from a DocBook 4 file and the corresponding output for
the equivalent DocBook 5 file would be different. Fix this.
Signed-off-by: brian m. carlson <sandals crustytoothpaste ath cx>
xslt/docbook/html/db2html-block.xsl | 10 +++++++---
xslt/docbook/html/db2html-inline.xsl | 5 ++++-
2 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/xslt/docbook/html/db2html-block.xsl b/xslt/docbook/html/db2html-block.xsl
index 9521ecb..c6c31d6 100644
--- a/xslt/docbook/html/db2html-block.xsl
+++ b/xslt/docbook/html/db2html-block.xsl
@@ -232,6 +232,7 @@ $node: The block-level element to render
$lang: The locale of the text in ${node}
$dir: The text direction, either #{ltr} or #{rtl}
$ltr: Whether to default to #{ltr} if neither ${lang} nor ${dir} is specified
+$class: The value of the generated class attribute
This template creates an HTML #{p} element for the given DocBook element.
-->
@@ -240,10 +241,11 @@ This template creates an HTML #{p} element for the given DocBook element.
<xsl:param name="lang" select="$node/@lang|$node/@xml:lang"/>
<xsl:param name="dir" select="false()"/>
<xsl:param name="ltr" select="false()"/>
+ <xsl:param name="class" select="local-name($node)"/>
<p>
<xsl:attribute name="class">
- <xsl:value-of select="local-name($node)"/>
+ <xsl:value-of select="$class"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
@@ -369,8 +371,10 @@ template.
</xsl:template>
<!-- = ackno = -->
-<xsl:template match="ackno | db:acknowledgements">
- <xsl:call-template name="db2html.para"/>
+<xsl:template match="ackno | db:acknowledgements/db:para">
+ <xsl:call-template name="db2html.para">
+ <xsl:with-param name="class">ackno</xsl:with-param>
+ </xsl:call-template>
</xsl:template>
<!-- = address = -->
diff --git a/xslt/docbook/html/db2html-inline.xsl b/xslt/docbook/html/db2html-inline.xsl
index 95e6957..5e5cadc 100644
--- a/xslt/docbook/html/db2html-inline.xsl
+++ b/xslt/docbook/html/db2html-inline.xsl
@@ -64,6 +64,7 @@ $class: The value of the #{class} attribute on the #{span} tag
$lang: The locale of the text in ${node}
$dir: The text direction, either #{ltr} or #{rtl}
$ltr: Whether to default to #{ltr} if neither ${lang} nor ${dir} is specified
+$name-class: The class to use for the name of the element
REMARK: Document this template
-->
@@ -74,11 +75,12 @@ REMARK: Document this template
<xsl:param name="lang" select="$node/@lang|$node/@xml:lang"/>
<xsl:param name="dir" select="false()"/>
<xsl:param name="ltr" select="false()"/>
+ <xsl:param name="name-class" select="local-name($node)"/>
<xsl:variable name="xlink" select="$node/@xl:href"/>
<xsl:variable name="linkend" select="$node/@linkend"/>
<!-- FIXME: do CSS classes, rather than inline styles -->
- <span class="{$class} {local-name($node)}">
+ <span class="{$class} {$name-class}">
<xsl:choose>
<xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
<xsl:attribute name="dir">
@@ -1003,6 +1005,7 @@ FIXME
<!-- = sgmltag = -->
<xsl:template match="sgmltag | db:tag">
<xsl:call-template name="db2html.inline">
+ <xsl:with-param name="name-class">sgmltag</xsl:with-param>
<xsl:with-param name="class">
<xsl:text>code sgmltag</xsl:text>
<xsl:if test="@class">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]