[xml/sgml-pkgs] Bug#289183: db2latex-xsl: Duplicate entries for question.answer.label
Nikolai Prokoschenko
Nikolai Prokoschenko <nikolai@prokoschenko.de>, 289183@bugs.debian.org
Fri, 07 Jan 2005 18:40:59 +0100
This is a multi-part MIME message sent by reportbug.
--===============1010609508==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Package: db2latex-xsl
Version: 0.8pre1-2
Severity: important
Tags: patch
Either nobody is using the package, or I am the only one to experience
this bug: using db2latex with xsltproc results in an error message:
compilation error: file file:///usr/share/xml/docbook/stylesheet/db2latex/latex/qandaset.mod.xsl line 366 element template
xsl:template: error duplicate name 'question.answer.label'
The attached patch fixed that for me.
-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.9-1-k7
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
-- no debconf information
--===============1010609508==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="db2latex-xsl.diff"
diff -ur latex/common/common.xsl /usr/share/xml/docbook/stylesheet/db2latex/latex/common/common.xsl
--- latex/common/common.xsl 2004-11-21 04:47:11 +0100
+++ /usr/share/xml/docbook/stylesheet/db2latex/latex/common/common.xsl 2005-01-03 23:48:18 +0100
@@ -356,88 +356,6 @@
<xsl:value-of select="count($anc.divs) + number($section.level)"/>
</xsl:template>
-<xsl:template name="question.answer.label">
- <xsl:variable name="deflabel">
- <xsl:choose>
- <xsl:when test="ancestor-or-self::*[@defaultlabel]">
- <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]
- /@defaultlabel"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$qanda.defaultlabel"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="label" select="@label"/>
-
-<!--
- (hnr (hierarchical-number-recursive (normalize "qandadiv") node))
-
- (parsect (ancestor-member node (section-element-list)))
-
- (defnum (if (and %qanda-inherit-numeration%
- %section-autolabel%)
- (if (node-list-empty? parsect)
- (section-autolabel-prefix node)
- (section-autolabel parsect))
- ""))
-
- (hnumber (let loop ((numlist hnr) (number defnum)
- (sep (if (equal? defnum "") "" ".")))
- (if (null? numlist)
- number
- (loop (cdr numlist)
- (string-append number
- sep
- (number->string (car numlist)))
- "."))))
- (cnumber (child-number (parent node)))
- (number (string-append hnumber
- (if (equal? hnumber "")
- ""
- ".")
- (number->string cnumber))))
--->
-
- <xsl:choose>
- <xsl:when test="$deflabel = 'qanda'">
- <xsl:call-template name="gentext">
- <xsl:with-param name="key">
- <xsl:choose>
- <xsl:when test="local-name(.) = 'question'">question</xsl:when>
- <xsl:when test="local-name(.) = 'answer'">answer</xsl:when>
- <xsl:when test="local-name(.) = 'qandadiv'">qandadiv</xsl:when>
- <xsl:otherwise>qandaset</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$deflabel = 'label'">
- <xsl:value-of select="$label"/>
- </xsl:when>
- <xsl:when test="$deflabel = 'number'
- and local-name(.) = 'question'">
- <xsl:apply-templates select="ancestor::qandaset[1]"
- mode="number"/>
- <xsl:choose>
- <xsl:when test="ancestor::qandadiv">
- <xsl:apply-templates select="ancestor::qandadiv[1]"
- mode="number"/>
- <xsl:apply-templates select="ancestor::qandaentry"
- mode="number"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="ancestor::qandaentry"
- mode="number"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <!-- nothing -->
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
<xsl:template match="qandaset" mode="number">
<!-- FIXME: -->
--===============1010609508==--