Changing line spacing in Docbook variablelists
Posted: Mon Aug 15, 2016 10:07 pm
I want to remove all line spacing for list items in a Docbook document using Apache FOP XSLT. I've been able to do this successfully, except for the space between the term and listitem in a variablelist. I have made a number of attempts in my custom stylesheet, but no luck.
For example, one part of my Docbook XML code looks like this:
My custom stylesheet currently contains this:
Here is what my output looks like. As you can see, all of the line spacing is removed, except for the area between the term and the listitem. Can anyone help me remove that space?
For example, one part of my Docbook XML code looks like this:
Code: Select all
<varlistentry>
<term><parameter moreinfo="none">modbus</parameter></term>
<listitem>
<para>The modbus instance pointer. Always enter <literal
moreinfo="none">modbus</literal> for this
parameter</para>
</listitem>
</varlistentry>
Code: Select all
<xsl:attribute-set name="list.item.spacing">
<xsl:attribute name="space-before.optimum">0em</xsl:attribute>
<xsl:attribute name="space-before.minimum">0em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0em</xsl:attribute>
<xsl:attribute name="space-after.optimum">0em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0em</xsl:attribute>
</xsl:attribute-set>
<xsl:template match="d:varlistentry" mode="vl.as.blocks">
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<fo:block id="{$id}" xsl:use-attribute-sets="variablelist.term.properties
list.item.spacing"
keep-together.within-column="always"
keep-with-next.within-column="always"
space-after.minimum="0pt"
space-after.maximum="0pt"
space-after.optimum="0pt"
space-after.precedence="force"
>
<xsl:apply-templates select="d:term"/>
</fo:block>
<fo:block
space-before.minimum="0pt"
space-before.maximum="0pt"
space-before.optimum="0pt"
space-before.precedence="force"
>
<xsl:attribute name="margin-{$direction.align.start}">0.25in</xsl:attribute>
<xsl:apply-templates select="d:listitem"/>
</fo:block>
</xsl:template>