ToC hiding Chapter level pagenumber
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 11
- Joined: Tue Aug 23, 2016 6:18 pm
ToC hiding Chapter level pagenumber
Post by Quick van Rijt »
When rendering with DITA 3.2.1 to PDF by FOP using customization plugin, my generated topic.fo has TOC entries, all ending on
In the resulting PDF, all lower level topics are shown as expected. But Chapter and Appendix level topics show leader-dots without a pagenumber.
I have modified __toc__page-number with @border="1px solid orange" to highlight the block, but nothing apparently off-page.
I have search all org.dita.pdf2 and org.dita.pdf2.fop folders.
Where to look to fix this?
Code: Select all
<fo:basic-link ...>
...
<fo:inline xsl:use-attribute-sets="__toc__page-number">
<fo:leader xsl:use-attribute-sets="__toc__leader"/>
<fo:page-number-citation>
<xsl:attribute name="ref-id">
<xsl:call-template name="generate-toc-id"/>
</xsl:attribute>
</fo:page-number-citation>
</fo:inline>
</fo:basic-link>
In the resulting PDF, all lower level topics are shown as expected. But Chapter and Appendix level topics show leader-dots without a pagenumber.
I have modified __toc__page-number with @border="1px solid orange" to highlight the block, but nothing apparently off-page.
I have search all org.dita.pdf2 and org.dita.pdf2.fop folders.
Where to look to fix this?
Regards
Quick van Rijt
Professional user of Oxygen XML and DITA OT
Quick van Rijt
Professional user of Oxygen XML and DITA OT
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: ToC hiding Chapter level pagenumber
Hi Quick,
Honestly I'm quite rusty when it comes to XSL-FO based PDF customization.
If you add an <xsl:message> with a <xsl:copy-of select="."/> in that particular code is it called also for Chapter and Appendix.
If it is called, what value does the call " <xsl:call-template name="generate-toc-id"/>" return?
If set the "clean.temp=no" parameter and after the transformation you look in the temporary folder at the "*_Merged.xml" file, does that "ref-id" attribute set for a Chapter properly refer to the chapter ID?
Regards,
Radu
Honestly I'm quite rusty when it comes to XSL-FO based PDF customization.
If you add an <xsl:message> with a <xsl:copy-of select="."/> in that particular code is it called also for Chapter and Appendix.
If it is called, what value does the call " <xsl:call-template name="generate-toc-id"/>" return?
If set the "clean.temp=no" parameter and after the transformation you look in the temporary folder at the "*_Merged.xml" file, does that "ref-id" attribute set for a Chapter properly refer to the chapter ID?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 11
- Joined: Tue Aug 23, 2016 6:18 pm
Re: ToC hiding Chapter level pagenumber
Post by Quick van Rijt »
My ToC entries for Chapters/Appendices do have OPENTOPIC id's for fo:basic-link/@internal-destination.
I then suspected the fo:page-number-citation/@ref-id to fail (even if it has the same OPENTOPIC value)
I discovered in topic.fo that the Chapters/Appendix level topics do not get assigned an early @id (in fo:block or fo:wrapper).
I am not touching that area in my plugin.
@id is assigned in processing template dita-ot-3.2.1/org.dita.pdf2/xsl/fo/topic.xsl:69: [Codebox=]<xsl:template match="*" mode="processTopicTitle">[/Codebox]
Which in turn is called by template [Codebox=]<xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]">[/Codebox]
AND that last template especially ignores Chapter or Appendix processing!! (But how can the core PDF2 transformation be successful then?) I am not done yet
I then suspected the fo:page-number-citation/@ref-id to fail (even if it has the same OPENTOPIC value)
I discovered in topic.fo that the Chapters/Appendix level topics do not get assigned an early @id (in fo:block or fo:wrapper).
I am not touching that area in my plugin.
@id is assigned in processing template dita-ot-3.2.1/org.dita.pdf2/xsl/fo/topic.xsl:69: [Codebox=]<xsl:template match="*" mode="processTopicTitle">[/Codebox]
Which in turn is called by template [Codebox=]<xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]">[/Codebox]
AND that last template especially ignores Chapter or Appendix processing!! (But how can the core PDF2 transformation be successful then?) I am not done yet

Regards
Quick van Rijt
Professional user of Oxygen XML and DITA OT
Quick van Rijt
Professional user of Oxygen XML and DITA OT
-
- Posts: 11
- Joined: Tue Aug 23, 2016 6:18 pm
Re: ToC hiding Chapter level pagenumber
Post by Quick van Rijt »
Solved it.
To remove the default fancy chapter heading, I used an empty insertChapterFirstpageStaticContent template.
The DITA-OT uses it also to set the chapter's @id for table of content reference.
The solution is adding an empty block ($myplugin/cfg/fo/xsl/commons.xsl):
To remove the default fancy chapter heading, I used an empty insertChapterFirstpageStaticContent template.
The DITA-OT uses it also to set the chapter's @id for table of content reference.
The solution is adding an empty block ($myplugin/cfg/fo/xsl/commons.xsl):
Code: Select all
<xsl:template match="*" mode="insertChapterFirstpageStaticContent">
<xsl:param name="type" as="xs:string"/>
<fo:block>
<xsl:attribute name="id">
<xsl:call-template name="generate-toc-id"/>
</xsl:attribute>
<xsl:comment> commons.xsl/insertChapterFirstpageStaticContent: fancy chapter start removed</xsl:comment>
</fo:block>
</xsl:template>
Regards
Quick van Rijt
Professional user of Oxygen XML and DITA OT
Quick van Rijt
Professional user of Oxygen XML and DITA OT
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