diff options
author | Shaun McCance <shaunm@src.gnome.org> | 2004-10-19 03:42:00 +0000 |
---|---|---|
committer | Shaun McCance <shaunm@src.gnome.org> | 2004-10-19 03:42:00 +0000 |
commit | 82739df72e203bc26dd07c67172c5fc603c6b960 (patch) | |
tree | e76c775498e140c86c084aec6d1c4231c6300480 | |
parent | 0702b8bbf6b808a5fe5a9352fe33d616972459a2 (diff) | |
download | gnome-doc-utils-82739df72e203bc26dd07c67172c5fc603c6b960.tar.gz |
- Implemented some number formatters - Implemented citetitle as a format
* xslt/docbook/common/db-format.xml.in:
* xslt/docbook/common/db-label.xsl:
* xslt/docbook/common/db-xref.xsl:
* xslt/docbook/html/db2html-inline.xsl:
* xslt/docbook/html/db2html-title.xsl:
- Implemented some number formatters
- Implemented citetitle as a format template
* xslt/docbook/html/db2html-admon.xsl:
* xslt/docbook/html/db2html-css.xsl:
- Some CSS stuff
* xslt/docbook/html/db2html-block.xsl:
- Implemented literallayout
* xslt/docbook/html/db2html-table.xsl:
- Default to vertical-align: top
* xslt/gettext/format2xsl.xsl:
- Got the role stuff working right
-rw-r--r-- | ChangeLog | 23 | ||||
-rw-r--r-- | xslt/docbook/common/db-format.xml.in | 351 | ||||
-rw-r--r-- | xslt/docbook/common/db-label.xsl | 125 | ||||
-rw-r--r-- | xslt/docbook/common/db-xref.xsl | 54 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-admon.xsl | 21 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-block.xsl | 7 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-css.xsl | 2 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-inline.xsl | 7 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-table.xsl | 3 | ||||
-rw-r--r-- | xslt/docbook/html/db2html-title.xsl | 1 | ||||
-rw-r--r-- | xslt/gettext/format2xsl.xsl | 92 |
11 files changed, 523 insertions, 163 deletions
@@ -1,3 +1,26 @@ +2004-10-18 Shaun McCance <shaunm@gnome.org> + + * xslt/docbook/common/db-format.xml.in: + * xslt/docbook/common/db-label.xsl: + * xslt/docbook/common/db-xref.xsl: + * xslt/docbook/html/db2html-inline.xsl: + * xslt/docbook/html/db2html-title.xsl: + - Implemented some number formatters + - Implemented citetitle as a format template + + * xslt/docbook/html/db2html-admon.xsl: + * xslt/docbook/html/db2html-css.xsl: + - Some CSS stuff + + * xslt/docbook/html/db2html-block.xsl: + - Implemented literallayout + + * xslt/docbook/html/db2html-table.xsl: + - Default to vertical-align: top + + * xslt/gettext/format2xsl.xsl: + - Got the role stuff working right + 2004-10-15 Shaun McCance <shaunm@gnome.org> * xslt/docbook/common/db-format.xml.in: diff --git a/xslt/docbook/common/db-format.xml.in b/xslt/docbook/common/db-format.xml.in index 2b4d58b..186c587 100644 --- a/xslt/docbook/common/db-format.xml.in +++ b/xslt/docbook/common/db-format.xml.in @@ -5,6 +5,44 @@ xmlns:msg="http://www.gnome.org/~shaunm/gnome-doc-utils/xsl-format" xmlns:_msg="http://www.gnome.org/~shaunm/gnome-doc-utils/xsl-format"> +<!-- == format.citetitle =================================================== --> + +<template xmlns="http://www.gnome.org/~shaunm/xsldoc"> + <name>format.citetitle</name> + <description> + Format a <xmltag>citetitle</xmltag> element + </description> + <parameter> + <name>node</name> + <description> + The <xmltag>citetitle</xmltag> element to format + </description> + </parameter> + <parameter> + <name>role</name> + <description> + The role of the label + </description> + </parameter> +</template> + +<xsl:template name="format.citetitle"> + <xsl:param name="node" select="."/> + <xsl:param name="role"/> + <msg:msg id="format.citetitle"> + <!-- FIXME --> + <_msg:msgstr>format.citetitle</_msg:msgstr> + <msg:msgstr xml:lang="C"> + <msg:msgstr role="article">“%t{node}”</msg:msgstr> + <msg:msgstr><i>%t{node}</i></msg:msgstr> + </msg:msgstr> + </msg:msg> + <msg:arg name="node"> + <xsl:apply-templates select="$node/node()"/> + </msg:arg> +</xsl:template> + + <!-- == format.quote.outer ================================================= --> <template xmlns="http://www.gnome.org/~shaunm/xsldoc"> @@ -22,7 +60,7 @@ <xsl:template name="format.quote.outer"> <xsl:param name="node" select="."/> - <msg:msg id="format.quite.outer"> + <msg:msg id="format.quote.outer"> <!-- “%t{node}” --> <_msg:msgstr>format.quote.outer</_msg:msgstr> <msg:msgstr xml:lang="C">“%t{node}”</msg:msgstr> @@ -50,7 +88,7 @@ <xsl:template name="format.quote.inner"> <xsl:param name="node" select="."/> - <msg:msg id="format.quite.inner"> + <msg:msg id="format.quote.inner"> <!-- ‘%t{node}’ --> <_msg:msgstr>format.quote.outer</_msg:msgstr> <msg:msgstr xml:lang="C">‘%t{node}’</msg:msgstr> @@ -63,8 +101,33 @@ <!-- == format.chapter.label =============================================== --> +<template xmlns="http://www.gnome.org/~shaunm/xsldoc"> + <name>format.chapter.label</name> + <description> + Format the label for a <xmltag>chapter</xmltag> element + </description> + <parameter> + <name>node</name> + <description> + The <xmltag>chapter</xmltag> element to format + </description> + </parameter> + <parameter> + <name>role</name> + <description> + The role of the label + </description> + </parameter> + <parameter> + <name>depth_in_chunk</name> + <description> + The depth of the element in the containing chunk + </description> + </parameter> +</template> + <xsl:template name="format.chapter.label"> - <xsl:param name="node"/> + <xsl:param name="node" select="."/> <xsl:param name="role"/> <xsl:param name="depth_in_chunk"> <xsl:call-template name="db.chunk.depth-in-chunk"> @@ -82,13 +145,41 @@ <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/> </xsl:call-template> </msg:arg> + <msg:arg name="title"> + <xsl:apply-templates select="$node/title/node()"/> + </msg:arg> </xsl:template> <!-- == format.figure.label ================================================ --> +<template xmlns="http://www.gnome.org/~shaunm/xsldoc"> + <name>format.figure.label</name> + <description> + Format the label for a <xmltag>figure</xmltag> element + </description> + <parameter> + <name>node</name> + <description> + The <xmltag>figure</xmltag> element to format + </description> + </parameter> + <parameter> + <name>role</name> + <description> + The role of the label + </description> + </parameter> + <parameter> + <name>depth_in_chunk</name> + <description> + The depth of the element in the containing chunk + </description> + </parameter> +</template> + <xsl:template name="format.figure.label"> - <xsl:param name="node"/> + <xsl:param name="node" select="."/> <xsl:param name="role"/> <xsl:param name="depth_in_chunk"> <xsl:call-template name="db.chunk.depth-in-chunk"> @@ -106,13 +197,41 @@ <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/> </xsl:call-template> </msg:arg> + <msg:arg name="title"> + <xsl:apply-templates select="$node/title/node()"/> + </msg:arg> </xsl:template> <!-- == format.section.label =============================================== --> +<template xmlns="http://www.gnome.org/~shaunm/xsldoc"> + <name>format.section.label</name> + <description> + Format the label for a <xmltag>section</xmltag> element + </description> + <parameter> + <name>node</name> + <description> + The <xmltag>section</xmltag> element to format + </description> + </parameter> + <parameter> + <name>role</name> + <description> + The role of the label + </description> + </parameter> + <parameter> + <name>depth_in_chunk</name> + <description> + The depth of the element in the containing chunk + </description> + </parameter> +</template> + <xsl:template name="format.section.label"> - <xsl:param name="node"/> + <xsl:param name="node" select="."/> <xsl:param name="role"/> <xsl:param name="depth_in_chunk"> <xsl:call-template name="db.chunk.depth-in-chunk"> @@ -130,13 +249,41 @@ <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/> </xsl:call-template> </msg:arg> + <msg:arg name="title"> + <xsl:apply-templates select="$node/title/node()"/> + </msg:arg> </xsl:template> <!-- == format.table.label ================================================= --> +<template xmlns="http://www.gnome.org/~shaunm/xsldoc"> + <name>format.table.label</name> + <description> + Format the label for a <xmltag>table</xmltag> element + </description> + <parameter> + <name>node</name> + <description> + The <xmltag>table</xmltag> element to format + </description> + </parameter> + <parameter> + <name>role</name> + <description> + The role of the label + </description> + </parameter> + <parameter> + <name>depth_in_chunk</name> + <description> + The depth of the element in the containing chunk + </description> + </parameter> +</template> + <xsl:template name="format.table.label"> - <xsl:param name="node"/> + <xsl:param name="node" select="."/> <xsl:param name="role"/> <xsl:param name="depth_in_chunk"> <xsl:call-template name="db.chunk.depth-in-chunk"> @@ -154,6 +301,198 @@ <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/> </xsl:call-template> </msg:arg> + <msg:arg name="title"> + <xsl:apply-templates select="$node/title/node()"/> + </msg:arg> +</xsl:template> + + +<!-- == format.example.number ============================================== --> + +<template xmlns="http://www.gnome.org/~shaunm/xsldoc"> + <name>format.example.number</name> + <description> + Format the number for a <xmltag>example</xmltag> element + </description> + <parameter> + <name>node</name> + <description> + The element for which to generate a number + </description> + </parameter> +</template> + +<xsl:template name="format.example.number"> + <xsl:param name="node" select="."/> + <msg:msg id="format.example.number"> + <!-- %t{parent}-%1{number} --> + <_msg:msgstr>format.example.number</_msg:msgstr> + <msg:msgstr xml:lang="C">%t{parent}-%1{number}</msg:msgstr> + </msg:msg> + <msg:arg name="parent"> + <xsl:call-template name="db.label.number"> + <xsl:with-param name="node" select=" + $node/ancestor::appendix | + $node/ancestor::chapter "/> + </xsl:call-template> + </msg:arg> + <msg:arg name="number"> + <xsl:number level="any" count="example" from="chapter | appendix"/> + </msg:arg> +</xsl:template> + + +<!-- == format.example.number.flat ========================================= --> + +<template xmlns="http://www.gnome.org/~shaunm/xsldoc"> + <name>format.example.number.flat</name> + <description> + Format the number for a <xmltag>example</xmltag> element in a flat document + </description> + <parameter> + <name>node</name> + <description> + The element for which to generate a number + </description> + </parameter> +</template> + +<xsl:template name="format.example.number.flat"> + <xsl:param name="node" select="."/> + <msg:msg id="format.example.number.flat"> + <!-- %1{number} --> + <_msg:msgstr>format.example.number.flat</_msg:msgstr> + <msg:msgstr xml:lang="C">%1{number}</msg:msgstr> + </msg:msg> + <msg:arg name="number"> + <xsl:number level="any" count="example" from="chapter | appendix"/> + </msg:arg> +</xsl:template> + + +<!-- == format.figure.number =============================================== --> + +<template xmlns="http://www.gnome.org/~shaunm/xsldoc"> + <name>format.figure.number</name> + <description> + Format the number for a <xmltag>figure</xmltag> element + </description> + <parameter> + <name>node</name> + <description> + The element for which to generate a number + </description> + </parameter> +</template> + +<xsl:template name="format.figure.number"> + <xsl:param name="node" select="."/> + <msg:msg id="format.figure.number"> + <!-- %t{parent}-%1{number} --> + <_msg:msgstr>format.figure.number</_msg:msgstr> + <msg:msgstr xml:lang="C">%t{parent}-%1{number}</msg:msgstr> + </msg:msg> + <msg:arg name="parent"> + <xsl:call-template name="db.label.number"> + <xsl:with-param name="node" select=" + $node/ancestor::appendix | + $node/ancestor::chapter "/> + </xsl:call-template> + </msg:arg> + <msg:arg name="number"> + <xsl:number level="any" count="figure" from="chapter | appendix"/> + </msg:arg> +</xsl:template> + + +<!-- == format.figure.number.flat ========================================== --> + +<template xmlns="http://www.gnome.org/~shaunm/xsldoc"> + <name>format.figure.number.flat</name> + <description> + Format the number for a <xmltag>figure</xmltag> element in a flat document + </description> + <parameter> + <name>node</name> + <description> + The element for which to generate a number + </description> + </parameter> +</template> + +<xsl:template name="format.figure.number.flat"> + <xsl:param name="node" select="."/> + <msg:msg id="format.figure.number.flat"> + <!-- %1{number} --> + <_msg:msgstr>format.figure.number.flat</_msg:msgstr> + <msg:msgstr xml:lang="C">%1{number}</msg:msgstr> + </msg:msg> + <msg:arg name="number"> + <xsl:number level="any" count="figure" from="chapter | appendix"/> + </msg:arg> +</xsl:template> + + +<!-- == format.table.number ================================================ --> + +<template xmlns="http://www.gnome.org/~shaunm/xsldoc"> + <name>format.table.number</name> + <description> + Format the number for a <xmltag>table</xmltag> element + </description> + <parameter> + <name>node</name> + <description> + The element for which to generate a number + </description> + </parameter> +</template> + +<xsl:template name="format.table.number"> + <xsl:param name="node" select="."/> + <msg:msg id="format.table.number"> + <!-- %t{parent}-%1{number} --> + <_msg:msgstr>format.table.number</_msg:msgstr> + <msg:msgstr xml:lang="C">%t{parent}-%1{number}</msg:msgstr> + </msg:msg> + <msg:arg name="parent"> + <xsl:call-template name="db.label.number"> + <xsl:with-param name="node" select=" + $node/ancestor::appendix | + $node/ancestor::chapter "/> + </xsl:call-template> + </msg:arg> + <msg:arg name="number"> + <xsl:number level="any" count="table" from="chapter | appendix"/> + </msg:arg> +</xsl:template> + + +<!-- == format.table.number.flat =========================================== --> + +<template xmlns="http://www.gnome.org/~shaunm/xsldoc"> + <name>format.table.number.flat</name> + <description> + Format the number for a <xmltag>table</xmltag> element in a flat document + </description> + <parameter> + <name>node</name> + <description> + The element for which to generate a number + </description> + </parameter> +</template> + +<xsl:template name="format.table.number.flat"> + <xsl:param name="node" select="."/> + <msg:msg id="format.table.number.flat"> + <!-- %1{number} --> + <_msg:msgstr>format.table.number.flat</_msg:msgstr> + <msg:msgstr xml:lang="C">%1{number}</msg:msgstr> + </msg:msg> + <msg:arg name="number"> + <xsl:number level="any" count="table" from="chapter | appendix"/> + </msg:arg> </xsl:template> </xsl:stylesheet> diff --git a/xslt/docbook/common/db-label.xsl b/xslt/docbook/common/db-label.xsl index 09f613c..d1fede6 100644 --- a/xslt/docbook/common/db-label.xsl +++ b/xslt/docbook/common/db-label.xsl @@ -590,24 +590,18 @@ refentry | refsect1 | refsect2 | refsect3 | refsection | sect1 | sect2 | sect3 | sect4 | sect5 | section | simplesect "> - <xsl:choose> - <xsl:when test=" - local-name(..) = 'article' or - local-name(..) = 'partintro' or - local-name(..) = 'preface' "> - <xsl:number value=" - count(preceding-sibling::*[name(.) = name(current())]) + 1"/> - </xsl:when> - <xsl:otherwise> - <xsl:call-template name="db.label.number"> - <xsl:with-param name="node" select=".."/> - </xsl:call-template> - <xsl:text>.</xsl:text> - <xsl:number value=" - count(preceding-sibling::* - [local-name(.) = local-name(current())]) + 1"/> - </xsl:otherwise> - </xsl:choose> + <xsl:if test="local-name(..) != 'article' and + local-name(..) != 'partintro' and + local-name(..) != 'preface' "> + <xsl:call-template name="db.label.number"> + <xsl:with-param name="node" select=".."/> + </xsl:call-template> + <xsl:text>.</xsl:text> + </xsl:if> + <xsl:number level="single" format="1" count=" + refentry | refsect1 | refsect2 | refsect3 | refsection | + sect1 | sect2 | sect3 | sect4 | sect5 | + section | simplesect "/> </xsl:template> <xsl:template mode="db.label.number.mode" match=" @@ -630,69 +624,44 @@ </xsl:call-template> </xsl:template> -<xsl:template mode="db.label.number.mode" match="example | figure | table"> - <xsl:variable name="section" select=" - ancestor::*[parent::article][ - local-name(.) = 'refentry' or local-name(.) = 'sect1' or - local-name(.) = 'section' or local-name(.) = 'simplesect' - ]"/> - <xsl:variable name="parent"> - <xsl:choose> - <xsl:when test="$section"> - <xsl:call-template name="db.label.number"> - <xsl:with-param name="node" select="$section[last()]"/> - </xsl:call-template> - </xsl:when> - <xsl:otherwise> - <xsl:variable name="chapter" select=" - ancestor::*[ - local-name(.) = 'appendix' or local-name(.) = 'chapter' - ]"/> - <xsl:if test="$chapter"> - <xsl:call-template name="db.label.number"> - <xsl:with-param name="node" select="$chapter[1]"/> - </xsl:call-template> - </xsl:if> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:variable name="num"> - <xsl:choose> - <xsl:when test="$section"> - <xsl:value-of select="count( - ancestor-or-self::*[ - ancestor::refentry[parent::article] | - ancestor::sect1[parent::article] | - ancestor::section[parent::article] | - ancestor::simplesect[parent::article] - ]/preceding-sibling::*/descendant-or-self::*[ - name(.) = name(current()) - ]) + 1"/> - </xsl:when> - <xsl:when test=" - ancestor::*[ - local-name(.) = 'appendix' or local-name(.) = 'chapter' - ]"> - <xsl:value-of select="count( - ancestor-or-self::*[ - ancestor::appendix | ancestor::chapter - ]/preceding-sibling::*/descendant-or-self::*[ - name(.) = name(current()) - ]) + 1"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="count(preceding::*[name(.) = name(current())]) + 1"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> +<!-- = example = --> +<xsl:template mode="db.label.number.mode" match="example"> + <xsl:choose> + <xsl:when test="ancestor::appendix or ancestor::chapter"> + <xsl:call-template name="format.example.number"> + <xsl:with-param name="node" select="."/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="format.example.number.flat"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- = figure = --> +<xsl:template mode="db.label.number.mode" match="figure"> <xsl:choose> - <xsl:when test="not($parent)"> - <xsl:number value="$num"/> + <xsl:when test="ancestor::appendix or ancestor::chapter"> + <xsl:call-template name="format.figure.number"> + <xsl:with-param name="node" select="."/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="format.figure.number.flat"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- = table = --> +<xsl:template mode="db.label.number.mode" match="table"> + <xsl:choose> + <xsl:when test="ancestor::appendix or ancestor::chapter"> + <xsl:call-template name="format.table.number"> + <xsl:with-param name="node" select="."/> + </xsl:call-template> </xsl:when> <xsl:otherwise> - <xsl:value-of select="$parent"/> - <xsl:text>-</xsl:text> - <xsl:number value="$num"/> + <xsl:call-template name="format.table.number.flat"/> </xsl:otherwise> </xsl:choose> </xsl:template> diff --git a/xslt/docbook/common/db-xref.xsl b/xslt/docbook/common/db-xref.xsl index 0b0598d..0dcb9b9 100644 --- a/xslt/docbook/common/db-xref.xsl +++ b/xslt/docbook/common/db-xref.xsl @@ -26,58 +26,20 @@ <xsl:when test="$target/@xreflabel"> <xsl:value-of select="$target/@xreflabel"/> </xsl:when> - <xsl:when test="$xrefstyle"> - <!-- FIXME --> + <xsl:when test="$xrefstyle and starts-with($xrefstyle, 'role:')"> + <xsl:call-template name="db.label"> + <xsl:with-param name="node" select="$target"/> + <xsl:with-param name="role" select="substring-after($xrefstyle, 'role:')"/> + </xsl:call-template> </xsl:when> <xsl:otherwise> - <xsl:apply-templates mode="db.xref.content.mode" select="$target"/> + <xsl:call-template name="db.label"> + <xsl:with-param name="node" select="$target"/> + </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> -<!-- FIXME --> -<xsl:template mode="db.xref.content.mode" match="*"> - <xsl:call-template name="db.label"/> -</xsl:template> - -<!-- -<xsl:template mode="xref.content.mode" match="article | reference"> -<xsl:choose> -<xsl:when test=" -(preceding-sibling::*[name(.) = name(current())]) or -(following-sibling::*[name(.) = name(current())]) or -(parent::part/preceding-sibling::part/*[name(.) = name(current())]) or -(parent::part/following-sibling::part/*[name(.) = name(current())]) "> -<xsl:call-template name="header"/> -</xsl:when> -<xsl:otherwise> -<xsl:call-template name="gettext"> -<xsl:with-param name="msgid" select="'Table of Contents'"/> -</xsl:call-template> -</xsl:otherwise> -</xsl:choose> -</xsl:template> - -<xsl:template mode="xref.content.mode" match="book"> -<xsl:call-template name="gettext"> -<xsl:with-param name="msgid" select="'Table of Contents'"/> -</xsl:call-template> -</xsl:template> - -<xsl:template mode="xref.content.mode" match="glossentry"> -<xsl:apply-templates mode="xref.content.mode" select="glossterm[1]"/> -</xsl:template> - -<xsl:template mode="xref.content.mode" match="glossterm"> -<xsl:apply-templates/> -</xsl:template> - -<xsl:template mode="xref.content.mode" match="*"> -<xsl:call-template name="header"/> -</xsl:template> - ---> - <!-- == db.xref.target ===================================================== --> diff --git a/xslt/docbook/html/db2html-admon.xsl b/xslt/docbook/html/db2html-admon.xsl index c5150cf..7ee845a 100644 --- a/xslt/docbook/html/db2html-admon.xsl +++ b/xslt/docbook/html/db2html-admon.xsl @@ -29,7 +29,7 @@ </description> </parameter> -<xsl:param name="db2html.admon.graphics_extension" select="'png'"/> +<xsl:param name="db2html.admon.graphics_extension" select="'.png'"/> <!-- == db2html.admon.text_only ============================================ --> @@ -167,6 +167,25 @@ </xsl:template> +<!-- == db2html.admon.css ================================================ --> + +<template xmlns="http://www.gnome.org/~shaunm/xsldoc"> + <name>db2html.admon.css</name> + <description> + Create CSS for the admonition elements + </description> +</template> + +<xsl:template name="db2html.admon.css"> + <xsl:text> + div[class="admonition"] { + margin-left: 28px; + margin-right: 28px; + } + </xsl:text> +</xsl:template> + + <!-- == Matched Templates == --> <!-- = caution = --> diff --git a/xslt/docbook/html/db2html-block.xsl b/xslt/docbook/html/db2html-block.xsl index acdf6ed..39a71f6 100644 --- a/xslt/docbook/html/db2html-block.xsl +++ b/xslt/docbook/html/db2html-block.xsl @@ -223,6 +223,13 @@ <xsl:call-template name="db2html.block"/> </xsl:template> +<!-- = literallayout = --> +<xsl:template match="literallayout"> + <xsl:call-template name="db2html.block"> + <xsl:with-param name="verbatim" select="true()"/> + </xsl:call-template> +</xsl:template> + <!-- = para = --> <xsl:template match="para"> <xsl:call-template name="db2html.para"/> diff --git a/xslt/docbook/html/db2html-css.xsl b/xslt/docbook/html/db2html-css.xsl index ec73d9a..60556a0 100644 --- a/xslt/docbook/html/db2html-css.xsl +++ b/xslt/docbook/html/db2html-css.xsl @@ -16,6 +16,7 @@ <xsl:template name="db2html.css"> <style> + <xsl:call-template name="db2html.admon.css"/> <xsl:call-template name="db2html.block.css"/> <xsl:call-template name="db2html.callout.css"/> <xsl:call-template name="db2html.list.css"/> @@ -25,6 +26,7 @@ padding-left: 8px; padding-right: 12px; } + div + div { margin-top: 1em; } p { text-align: justify; } diff --git a/xslt/docbook/html/db2html-inline.xsl b/xslt/docbook/html/db2html-inline.xsl index a65020e..3bbd826 100644 --- a/xslt/docbook/html/db2html-inline.xsl +++ b/xslt/docbook/html/db2html-inline.xsl @@ -128,6 +128,13 @@ <xsl:call-template name="db2html.inline"/> </xsl:template> +<!-- = citetitle = --> +<xsl:template match="citetitle"> + <xsl:call-template name="format.citetitle"> + <xsl:with-param name="role" select="@pubwork"/> + </xsl:call-template> +</xsl:template> + <!-- = city = --> <xsl:template match="city"> <xsl:call-template name="db2html.inline"/> diff --git a/xslt/docbook/html/db2html-table.xsl b/xslt/docbook/html/db2html-table.xsl index 9cbe873..bc5978a 100644 --- a/xslt/docbook/html/db2html-table.xsl +++ b/xslt/docbook/html/db2html-table.xsl @@ -738,6 +738,9 @@ <xsl:value-of select="../../@valign"/> <xsl:text>; </xsl:text> </xsl:when> + <xsl:otherwise> + <xsl:text>vertical-align: top; </xsl:text> + </xsl:otherwise> </xsl:choose> </xsl:template> diff --git a/xslt/docbook/html/db2html-title.xsl b/xslt/docbook/html/db2html-title.xsl index aa373f1..78c7c33 100644 --- a/xslt/docbook/html/db2html-title.xsl +++ b/xslt/docbook/html/db2html-title.xsl @@ -221,6 +221,7 @@ <xsl:call-template name="db2html.anchor"> <xsl:with-param name="node" select="$node"/> </xsl:call-template> + <!-- FIXME: I don't quite like doing this --> <xsl:if test="$depth_in_chunk = 2"> <xsl:call-template name="db2html.title.label"> <xsl:with-param name="node" select="$title_for"/> diff --git a/xslt/gettext/format2xsl.xsl b/xslt/gettext/format2xsl.xsl index 13e03e3..15456d5 100644 --- a/xslt/gettext/format2xsl.xsl +++ b/xslt/gettext/format2xsl.xsl @@ -77,7 +77,23 @@ </xsl:if> <xsl:apply-templates select="$arg/*"/> </xsl:when> - <!-- FIXME: numbers --> + <xsl:when test="$type = 'a' or $type = 'A' or + $type = 'i' or $type = 'I' or + $type = '1' "> + <xsl:if test="not($arg/xsl:number)"> + <xsl:message terminate="yes"> + <xsl:value-of select="concat( + 'format2xsl: Error in template ', $template/@name, + ', format string for argument ', $name, + ' is type ', $type, + ' but template calls ', local-name($arg/*[1]) + )"/> + </xsl:message> + </xsl:if> + <xsl:apply-templates select="$arg/*"> + <xsl:with-param name="format" select="$type"/> + </xsl:apply-templates> + </xsl:when> </xsl:choose> <xsl:call-template name="format2xsl"> <xsl:with-param name="msgstr" select="$msgstr"/> @@ -103,10 +119,12 @@ <xsl:when test="msg:msgstr[@role]"> <xslt:choose> <xsl:for-each select="msg:msgstr[@role]"> - <xsl:apply-templates mode="format2xsl.mode" select="."> - <xsl:with-param name="template" select="$template"/> - <xsl:with-param name="lang" select="$lang"/> - </xsl:apply-templates> + <xslt:when test="$role = '{@role}'"> + <xsl:apply-templates mode="format2xsl.mode" select="."> + <xsl:with-param name="template" select="$template"/> + <xsl:with-param name="lang" select="$lang"/> + </xsl:apply-templates> + </xslt:when> </xsl:for-each> <xsl:choose> <xsl:when test="msg:msgstr[not(@role)]"> @@ -155,13 +173,14 @@ <!-- == msg:msg == --> <xsl:template match="msg:msg"> + <xsl:variable name="msg" select="."/> <xsl:choose> - <xsl:when test="(count(msg:msgstr[string(.) != current()/@id]) != 1) and - not(count(msg:msgstr[string(.) != current()/@id]) = 2 and + <xsl:when test="(count(msg:msgstr[string(.) != $msg/@id]) != 1) and + not(count(msg:msgstr[string(.) != $msg/@id]) = 2 and msg:msgstr[not(@xml:lang)] and msg:msgstr[@xml:lang = 'C'] )"> <xslt:choose> - <xsl:for-each select="msg:msgstr[string(.) != current()/@id]"> + <xsl:for-each select="msg:msgstr[string(.) != $msg/@id]"> <xsl:sort select="contains(@xml:lang, '@') and contains(@xml:lang, '.')" order="descending"/> <xsl:sort select="contains(@xml:lang, '.')" order="descending"/> @@ -294,7 +313,7 @@ <xsl:choose> <xsl:when test="msg:msgstr[@xml:lang = 'C']"> <xsl:for-each select="msg:msgstr[@xml:lang = 'C'][1]"> - <xsl:apply-templates mode="format2xsl.mode"> + <xsl:apply-templates mode="format2xsl.mode" select="."> <xsl:with-param name="template" select="../.."/> <xsl:with-param name="lang" select="'C'"/> </xsl:apply-templates> @@ -302,7 +321,7 @@ </xsl:when> <xsl:otherwise> <xsl:for-each select="msg:msgstr[1]"> - <xsl:apply-templates mode="format2xsl.mode"> + <xsl:apply-templates mode="format2xsl.mode" select="."> <xsl:with-param name="template" select="../.."/> <xsl:with-param name="lang" select="'C'"/> </xsl:apply-templates> @@ -344,35 +363,46 @@ <!-- == xsl:apply-templates == --> <xsl:template match="xsl:apply-templates"> <xslt:apply-templates> - <xsl:if test="@select"> - <xsl:attribute name="select"> - <xsl:value-of select="@select"/> - </xsl:attribute> - </xsl:if> - <xsl:if test="@mode"> - <xsl:attribute name="mode"> - <xsl:value-of select="@mode"/> - </xsl:attribute> - </xsl:if> + <xsl:for-each select="attribute::*"> + <xsl:copy/> + </xsl:for-each> <xsl:apply-templates/> </xslt:apply-templates> </xsl:template> <!-- == xsl:call-template == --> <xsl:template match="xsl:call-template"> - <xslt:call-template name="{@name}"> + <xslt:call-template> + <xsl:for-each select="attribute::*"> + <xsl:copy/> + </xsl:for-each> <xsl:apply-templates/> </xslt:call-template> </xsl:template> +<!-- == xsl:number == --> +<xsl:template match="xsl:number"> + <xsl:param name="format"/> + <xslt:number> + <xsl:if test="$format"> + <xsl:attribute name="format"> + <xsl:value-of select="$format"/> + </xsl:attribute> + </xsl:if> + <xsl:for-each select="attribute::*"> + <xsl:if test="not(self::format and $format)"> + <xsl:copy/> + </xsl:if> + </xsl:for-each> + </xslt:number> +</xsl:template> + <!-- == xsl:param == --> <xsl:template match="xsl:param"> <xslt:param name="{@name}"> - <xsl:if test="@select"> - <xsl:attribute name="select"> - <xsl:value-of select="@select"/> - </xsl:attribute> - </xsl:if> + <xsl:for-each select="attribute::*"> + <xsl:copy/> + </xsl:for-each> <xsl:apply-templates/> </xslt:param> </xsl:template> @@ -380,8 +410,8 @@ <!-- == xsl:template == --> <xsl:template match="xsl:template"> <xslt:template name="{@name}"> - <xslt:param name="lang" select="/*/@lang"/> <xsl:apply-templates select="xsl:param"/> + <xslt:param name="lang" select="$node/ancestor-or-self::*[@lang][1]/@lang"/> <xslt:variable name="lang_lang"> <xslt:choose> <xslt:when test="contains($lang, '_')"> @@ -480,11 +510,9 @@ <!-- == xsl:with-param == --> <xsl:template match="xsl:with-param"> <xslt:with-param name="{@name}"> - <xsl:if test="@select"> - <xsl:attribute name="select"> - <xsl:value-of select="@select"/> - </xsl:attribute> - </xsl:if> + <xsl:for-each select="attribute::*"> + <xsl:copy/> + </xsl:for-each> <xsl:apply-templates/> </xslt:with-param> </xsl:template> |