Package: docbook-xsl
Version: 1.75.2+dfsg-5
Severity: normal
Tags: patch

  Docbook segmented lists are lists in which each element has one or
more "segments".  For instance, a synopsis of commands might look like
this:

Name: ls
Usage: ls [options] PATH ...
Description: List directory contents or file information

  The FO output template for docbook appears to generate tabular output
in this case, with one column per segment.  However, it is hardcoded to
generate two <fo:table-column> definitions regardless of the number of
segments.  This results in errors when the resulting .fo file is
processed with fop.

  The attached patch to fo/lists.xsl fixes this for me.

  Daniel

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages docbook-xsl depends on:
ii  xml-core                      0.13       XML infrastructure and XML catalog

Versions of packages docbook-xsl recommends:
ii  docbook-xml                   4.5-7      standard XML documentation system 
ii  docbook-xsl-doc-html [docbook 1.75.2-1   stylesheets for processing DocBook

Versions of packages docbook-xsl suggests:
pn  dbtoepub                  <none>         (no description available)
pn  docbook-xsl-saxon         <none>         (no description available)
ii  fop                       1:0.95.dfsg-11 XML to PDF Translator
ii  libsaxon-java             1:6.5.5-7      Saxon XSLT Processor
ii  libxalan2-java            2.7.1-5        XSL Transformations (XSLT) process
pn  xalan                     <none>         (no description available)

-- no debconf information
--- lists.xsl.orig      2011-04-02 10:37:12.497221731 -0700
+++ lists.xsl   2011-04-02 10:46:08.050175221 -0700
@@ -1195,8 +1195,9 @@
 <xsl:template match="segmentedlist" mode="seglist-table">
   <xsl:apply-templates select="title" mode="list.title.mode" />
   <fo:table>
-    <fo:table-column column-number="1" 
column-width="proportional-column-width(1)"/>
-    <fo:table-column column-number="2" 
column-width="proportional-column-width(1)"/>
+    <xsl:call-template name="segmentedlist.table.columns">
+      <xsl:with-param name="cols" select="count(segtitle)"/>
+    </xsl:call-template>
     <fo:table-header start-indent="0pt" end-indent="0pt">
       <fo:table-row>
         <xsl:apply-templates select="segtitle" mode="seglist-table"/>
@@ -1208,6 +1209,20 @@
   </fo:table>
 </xsl:template>
 
+<xsl:template name="segmentedlist.table.columns">
+  <xsl:param name="cols" select="1"/>
+  <xsl:param name="curcol" select="1"/>
+
+  <fo:table-column column-number="{$curcol}"
+                   column-width="proportional-column-width(1)"/>
+  <xsl:if test="$curcol &lt; $cols">
+    <xsl:call-template name="segmentedlist.table.columns">
+      <xsl:with-param name="cols" select="$cols"/>
+      <xsl:with-param name="curcol" select="$curcol+1"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
 <xsl:template match="segtitle" mode="seglist-table">
   <fo:table-cell>
     <fo:block font-weight="bold">

Reply via email to