On 08/11/2017 03:09 AM, Sarrel, Marc A (393A) wrote:

I just downloaded a trial version of XSL Utility 5.4.5 and am impressed.
 We need a tool that converts from DocBook 5 to Word.  The first run
with our test document was successful, except for one thing.

We often put lists of items inside the cell of a table.  When I convert
to Word (using db5ToDocx or db5ToWML) or RTF (db5toRTF), I see a blank
line (just a pilcrow) at the top of each cell that contains a list.
 Typically, our tag hierarchy looks like this:


Is there a way to change the transform so that the blank line never appears?

Yes, in "fo/lists.xsl", at line 663, replace[*]:

<fo:table id="{$id}" xsl:use-attribute-sets="normal.para.spacing">


<fo:table id="{$id}">

that is, please remove the vertical space added before the <fo:table> used to represent a vertical DocBook <simplelist>:

<xsl:attribute-set name="normal.para.spacing">
  <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
  <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
  <xsl:attribute name="space-before.maximum">1.2em</xsl:attribute>

Here's what happens:

When a fo:table has some vertical margins, it seems that XMLmind XSL-FO Converter generates a empty paragraph as a trick to implement this vertical space. It's probably (didn't check that by looking at the code) because, unlike a Word paragraph, a Word table cannot have vertical margins.

[*] It's of course possible to do that in a less simplistic way. That is, discard xsl:use-attribute-sets="normal.para.spacing", but only when the <simplelist> is the first child of an <entry>.

PS: All this is in fact a XMLmind XSL-FO Converter documented limitation:

space-before | yes | Conditionality not supported.
See http://www.xmlmind.com/foconverter/conformance.html

By default, the space-before has a conditionality equal to "discard" (https://www.w3.org/TR/xsl/#space-before). This means that, at the beginning of a table cell, the space-before set for a vertical DocBook <simplelist> should be ignored.

Conditionality is an enumerated value which controls whether a space-specifier has effect at the beginning or end of a reference-area or a line-area. Possible values are retain and discard; a conditional space-specifier is one for which this value is discard.
See https://www.w3.org/TR/xsl/#spacecond

XMLmind FO Converter Support List

Reply via email to