Preventing contents of the row from disappering
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 12
- Joined: Thu Sep 09, 2021 12:03 pm
Preventing contents of the row from disappering
Hi,
I want to keep my contents of the row on the same page , so I've used keep-together.within-page="always" on fo:table-row and I'm getting expected output i.e. when the contents of the row are more, it is moving to next page with the header rows.
But, when the contents of the row exceeds more than one page, the contents are getting disappeared. I want the contents to move to next page if it exceeds more than one page i.e. page break inside those rows are acceptable but when the contents are small it should move to next page. Any Ideas?
I want to keep my contents of the row on the same page , so I've used keep-together.within-page="always" on fo:table-row and I'm getting expected output i.e. when the contents of the row are more, it is moving to next page with the header rows.
But, when the contents of the row exceeds more than one page, the contents are getting disappeared. I want the contents to move to next page if it exceeds more than one page i.e. page break inside those rows are acceptable but when the contents are small it should move to next page. Any Ideas?
-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Preventing contents of the row from disappering
Post by julien_lacour »
Hello,
Usually in DITA Map PDF - based on XSL-FO transformation, table rows are generated like this:
By adding the following template you can create rows without the keep-together.within-page="always" attribute:
After adding the previous template, in your DITA source you must add the @outputclass="break-on-two-pages" attribute on the rows that must not be kept on the same page.
You can run the transformation with the 'clean.temp=no' parameter then check the topic.fo file.
It must not contain <fo:table-row keep-together.within-page="always"> on the rows marked with the outputclass.
Regards,
Julien
Usually in DITA Map PDF - based on XSL-FO transformation, table rows are generated like this:
Code: Select all
<xsl:template match="*[contains(@class, ' topic/tbody ')]/*[contains(@class, ' topic/row ')]">
<fo:table-row xsl:use-attribute-sets="tbody.row">
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates/>
</fo:table-row>
</xsl:template>
...
<xsl:attribute-set name="tbody.row">
<!--Table body row-->
<xsl:attribute name="keep-together.within-page">always</xsl:attribute>
</xsl:attribute-set>
Code: Select all
<xsl:template match="*[contains(@class, ' topic/tbody ')]/*[contains(@class, ' topic/row ')
and @outputclass='break-on-two-pages')]">
<fo:table-row>
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates/>
</fo:table-row>
</xsl:template>
You can run the transformation with the 'clean.temp=no' parameter then check the topic.fo file.
It must not contain <fo:table-row keep-together.within-page="always"> on the rows marked with the outputclass.
Regards,
Julien
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