Definition list spacing
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 11
- Joined: Fri Oct 15, 2010 11:48 am
Definition list spacing
Hi,
Is there a way I can edit the table attributes for the definition list so that the dl and dd elements print beside each other in PDF output?
At the moment the dl and dd elements are printing in evenly sized columns.
I'd like the dl column to autosize to the largest entry and the dd column to take up the rest of the width.
I've a feeling this could be part of the problem too...
When I try print a definition list I get the following warnings:
Any help appreciated.
Thanks,
Dave
Is there a way I can edit the table attributes for the definition list so that the dl and dd elements print beside each other in PDF output?
At the moment the dl and dd elements are printing in evenly sized columns.
I'd like the dl column to autosize to the largest entry and the dd column to take up the rest of the width.
I've a feeling this could be part of the problem too...
When I try print a definition list I get the following warnings:
Code: Select all
[java] 832 WARN [ main ] org.apache.fop.apps.FOUserAgent - "fo:list-item-label" is missing child elements. Required content model: marker* (%block;)+ (See position 26:-1)
[java] 835 WARN [ main ] org.apache.fop.apps.FOUserAgent - The following feature isn't implemented by Apache FOP, yet: table-layout="auto" (on fo:table) (See position 29:-1)
[java] 849 WARN [ main ] org.apache.fop.apps.FOUserAgent - The following feature isn't implemented by Apache FOP, yet: table-layout="auto" (on fo:table) (See position 30:-1)
Thanks,
Dave
-
- Posts: 9439
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Definition list spacing
Hi Dave,
The XSLT stylesheet used for constructing <dl> lists can be found here:
OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/demo/fo/xsl/fo/tables.xsl
The XSLT template is this one:
<xsl:template match="*[contains(@class, ' topic/dl ')]">
...................
It relies on attribute sets from the XSLT:
OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/demo/fo/cfg/fo/attrs/tables-attr.xsl
For example if in this attribute-set:
<xsl:attribute-set name="dl">
........
you set the table-layout to auto like:
Then when transforming to PDF using XEP the output should have the <dt> and <dl> closer together.
Unfortunately FOP does not support auto table-layout.
Maybe you can experiment setting a smaller value to the table width or by using different text alignments.
Regards,
Radu
The XSLT stylesheet used for constructing <dl> lists can be found here:
OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/demo/fo/xsl/fo/tables.xsl
The XSLT template is this one:
<xsl:template match="*[contains(@class, ' topic/dl ')]">
...................
It relies on attribute sets from the XSLT:
OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/demo/fo/cfg/fo/attrs/tables-attr.xsl
For example if in this attribute-set:
<xsl:attribute-set name="dl">
........
you set the table-layout to auto like:
Code: Select all
<xsl:attribute-set name="dl">
<!--DL is a table-->
<!--<xsl:attribute name="width">100%</xsl:attribute>-->
<xsl:attribute name="table-layout">auto</xsl:attribute>
<xsl:attribute name="space-before.optimum">5pt</xsl:attribute>
<xsl:attribute name="space-after.optimum">5pt</xsl:attribute>
</xsl:attribute-set>
Unfortunately FOP does not support auto table-layout.
Maybe you can experiment setting a smaller value to the table width or by using different text alignments.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 11
- Joined: Fri Oct 15, 2010 11:48 am
Re: Definition list spacing
Thanks Radu,
I added the following line to the tables-attr.xsl file and it has lined the columns up much better:
<xsl:attribute name="width">65px</xsl:attribute>
I also commented out the following line in the same file but not sure if that matters to be honest.
<!-- <xsl:attribute name="width">100%</xsl:attribute>-->
I added the following line to the tables-attr.xsl file and it has lined the columns up much better:
<xsl:attribute name="width">65px</xsl:attribute>
Code: Select all
<xsl:attribute-set name="dlentry.dt">
<xsl:attribute name="width">65px</xsl:attribute>
<xsl:attribute name="relative-align">baseline</xsl:attribute>
</xsl:attribute-set>
<!-- <xsl:attribute name="width">100%</xsl:attribute>-->
Code: Select all
<xsl:attribute-set name="dl">
<!--DL is a table-->
<!-- <xsl:attribute name="width">100%</xsl:attribute>-->
<!-- <xsl:attribute name="table-layout">auto</xsl:attribute>-->
<xsl:attribute name="space-before.optimum">5pt</xsl:attribute>
<xsl:attribute name="space-after.optimum">5pt</xsl:attribute>
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