How to control widows and orphans in a Docbook FO XSL customization layer?
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 17
- Joined: Fri Aug 29, 2014 11:03 pm
How to control widows and orphans in a Docbook FO XSL customization layer?
Post by rmcilvride »
WidowOrphanOutput.png
Dear friends,I need to know how to remove widow/orphan constraints from blocks in formatted output (FO) for Docbook source, because the default setting of "2" is leaving too much white space in my documents in certain places. For example, please see the attached screenshot.
A code snippet for some of this output is:
Code: Select all
...
<listitem>
<formalpara>
<title><guilabel>14 Pause before reading data</guilabel></title>
<para>This parameter specifies a time for the DataHub to pause before
reading the OPC server's data set. Some OPC DA servers report
that they are running, but have not yet received the full data
set from the process. If the DataHub attempts to connect right away,
it might get a partial data set. The pause is fixed; it will
always last for the full time specified.</para>
</formalpara>
</listitem>
</itemizedlist>
</step>
<step>
<para>Finally, you can specify how the OPC items get selected. You can select
them manually or load all of them. </para>
<mediaobject>
<imageobject>
<imagedata fileref="../cdh-prop-opcdefine-4.gif" align="center"/>
</imageobject>
</mediaobject>
<variablelist>
<varlistentry>
<term><guilabel>Manually Select Items</guilabel></term>
<listitem>
<para>Check the <guibutton>Manually Select Items</guibutton> box and
press the <guibutton>Configure Items</guibutton> button to open
the OPC Item Selection window, where you can specify exactly
which points you wish to use:</para>
...
Code: Select all
<xsl:attribute-set name="block">
<xsl:attribute name="widows">1</xsl:attribute>
<xsl:attribute name="orphans">1</xsl:attribute>
</xsl:attribute-set>
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to control widows and orphans in a Docbook FO XSL customization layer?
Hi,
If you use Oxygen's "Find Replace in Files" tool to search in the folder "OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/fo" for "keep-together" you will find all places in the stylesheets where "keep-together" attributes are set on xsl-fo elements. You probably need to look in the XSLT stylesheet "OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/fo/lists.xsl" if you are interested in controlling this for lists. But if there is no attribute set defined for this in the XSLTs you canno overwrite it in a custom XSLT, you will need to overwrite the entire template.
More about page breaks in DocBook:
http://www.sagehill.net/docbookxsl/PageBreaking.html
As we (the Oxygen team) do not use DocBook much internally maybe you can also register and ask around on the DocBook users list:
https://docbook.org/help
Regards,
Radu
If you use Oxygen's "Find Replace in Files" tool to search in the folder "OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/fo" for "keep-together" you will find all places in the stylesheets where "keep-together" attributes are set on xsl-fo elements. You probably need to look in the XSLT stylesheet "OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/fo/lists.xsl" if you are interested in controlling this for lists. But if there is no attribute set defined for this in the XSLTs you canno overwrite it in a custom XSLT, you will need to overwrite the entire template.
More about page breaks in DocBook:
http://www.sagehill.net/docbookxsl/PageBreaking.html
As we (the Oxygen team) do not use DocBook much internally maybe you can also register and ask around on the DocBook users list:
https://docbook.org/help
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: How to control widows and orphans in a Docbook FO XSL customization layer?
Post by rmcilvride »
Hi Radu,
Thank you for your suggestions. As it turns out, I was able to include them in setting attributes for list.block.spacing and list.item.spacing, which is where the problems were occurring.
For example:
And it's working now. I appreciate your feedback.
Thank you for your suggestions. As it turns out, I was able to include them in setting attributes for list.block.spacing and list.item.spacing, which is where the problems were occurring.
For example:
Code: Select all
<!-- Reduces spacing for list items, overrides widow/orphan control -->
<xsl:attribute-set name="list.item.spacing">
<xsl:attribute name="space-before.optimum">.5em</xsl:attribute>
<xsl:attribute name="space-before.minimum">.4em</xsl:attribute>
<xsl:attribute name="space-before.maximum">.6em</xsl:attribute>
<xsl:attribute name="space-after.optimum">.2em</xsl:attribute>
<xsl:attribute name="space-after.minimum">.1em</xsl:attribute>
<xsl:attribute name="space-after.maximum">.3em</xsl:attribute>
<xsl:attribute name="widows">1</xsl:attribute>
<xsl:attribute name="orphans">1</xsl:attribute>
</xsl:attribute-set>
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