Changing line spacing in Docbook variablelists
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 17
- Joined: Fri Aug 29, 2014 11:03 pm
Changing line spacing in Docbook variablelists
Post by rmcilvride »
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>

-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Changing line spacing in Docbook variablelists
Hi,
Maybe you should look inside the generated XSL-FO file, see if your customization is applied and if there are other margins which should interfere.
As a recommendation, the Docbook Apps Mailing list (https://lists.oasis-open.org/archives/docbook-apps/) is probably a better channel where to ask Docbook customization related-questions.
Regards,
Radu
Maybe you should look inside the generated XSL-FO file, see if your customization is applied and if there are other margins which should interfere.
As a recommendation, the Docbook Apps Mailing list (https://lists.oasis-open.org/archives/docbook-apps/) is probably a better channel where to ask Docbook customization related-questions.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 17
- Joined: Fri Aug 29, 2014 11:03 pm
Re: Changing line spacing in Docbook variablelists
Post by rmcilvride »
Hi Radu,
Thanks for the quick reply. I'm pretty sure my customizations apply, because I can change the font of the term to bold. But the generated XSL-FO file might have some clues to the problem. Where would I find it? In any case, I'm acting on your suggestion and have asked about this on the Docbook Apps mailing list.
Best regards,
Bob
Thanks for the quick reply. I'm pretty sure my customizations apply, because I can change the font of the term to bold. But the generated XSL-FO file might have some clues to the problem. Where would I find it? In any case, I'm acting on your suggestion and have asked about this on the Docbook Apps mailing list.
Best regards,
Bob
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Changing line spacing in Docbook variablelists
Hi Bob,
If you are using Oxygen and you edit the Docbook to PDF transformation scenario, in the FO Processor tab you can uncheck the Perform FO Processing... checkbox and in the Output tab you can change the extension of the saved file to ".fo", then decide to open it in the editor at the end of the transformation.
I'm also adding a link to the answer you received on the Docbook mailing list, in case somebody may find it useful:
https://lists.oasis-open.org/archives/d ... 00019.html
Regards,
Radu
If you are using Oxygen and you edit the Docbook to PDF transformation scenario, in the FO Processor tab you can uncheck the Perform FO Processing... checkbox and in the Output tab you can change the extension of the saved file to ".fo", then decide to open it in the editor at the end of the transformation.
I'm also adding a link to the answer you received on the Docbook mailing list, in case somebody may find it useful:
https://lists.oasis-open.org/archives/d ... 00019.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 17
- Joined: Fri Aug 29, 2014 11:03 pm
Re: Changing line spacing in Docbook variablelists
Post by rmcilvride »
Hi Radu,
That's a great tip for viewing the generated XSL-FO file. Thank you! And thanks for linking to the Docbook-Apps message. I can add that as Bob Stayton mentioned, his customization applies to all the paras in a varlistentry, not just the first one. I have had to make additional modifications to get exactly what I need, but his response got me past the main issue I was having.
Best regards,
Bob
That's a great tip for viewing the generated XSL-FO file. Thank you! And thanks for linking to the Docbook-Apps message. I can add that as Bob Stayton mentioned, his customization applies to all the paras in a varlistentry, not just the first one. I have had to make additional modifications to get exactly what I need, but his response got me past the main issue I was having.
Best regards,
Bob
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service