DITA-OT PDF plugin
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: DITA-OT PDF plugin
Hi Simon,
Could you double check the default behavior? From what I tested the chapters are numbered from start to finish of the document without their number being reset in each part.
Would it be possible that you have a PDF customization which changed the default behavior?
Regards,
Radu
Could you double check the default behavior? From what I tested the chapters are numbered from start to finish of the document without their number being reset in each part.
Would it be possible that you have a PDF customization which changed the default behavior?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: DITA-OT PDF plugin
Hi Simon,
In my initial test I only tested with the DITA OT 2.x which is bundled with Oxygen 17.1 and it behaved the way you want.
Indeed the DITA OT 1.8 does reset chapters for each part but this was fixed in DITA OT 2.x:
https://github.com/dita-ot/dita-ot/issues/1272
In the XSLT stylesheet:
OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\xsl\fo\commons.xsl
there is a template which computes the chapter number:
The DITA OT 2.x equivalent which fixes the problem looks like this:
Instead of directly making changes to the DITA OT XSLTs the proper way to customize the XSLT stylesheets for the PDF output would be this one:
https://www.oxygenxml.com/doc/versions/ ... ation.html
Regards,
Radu
In my initial test I only tested with the DITA OT 2.x which is bundled with Oxygen 17.1 and it behaved the way you want.
Indeed the DITA OT 1.8 does reset chapters for each part but this was fixed in DITA OT 2.x:
https://github.com/dita-ot/dita-ot/issues/1272
In the XSLT stylesheet:
OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\xsl\fo\commons.xsl
there is a template which computes the chapter number:
Code: Select all
<xsl:template match="*[contains(@class, ' bookmap/chapter ')] |
opentopic:map/*[contains(@class, ' map/topicref ')]" mode="topicTitleNumber" priority="-1">
Code: Select all
<xsl:template match="*[contains(@class, ' bookmap/chapter ')] |
opentopic:map/*[contains(@class, ' map/topicref ')]" mode="topicTitleNumber" priority="-1">
<xsl:variable name="chapters">
<xsl:document>
<xsl:for-each select="$map/descendant::*[contains(@class, ' bookmap/chapter ')]">
<xsl:sequence select="."/>
</xsl:for-each>
</xsl:document>>
</xsl:variable>
<xsl:for-each select="$chapters/*[current()/@id = @id]">
<xsl:number format="1" count="*[contains(@class, ' bookmap/chapter ')]"/>
</xsl:for-each>
</xsl:template>
https://www.oxygenxml.com/doc/versions/ ... ation.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 19
- Joined: Thu Mar 29, 2012 4:45 pm
Re: DITA-OT PDF plugin
I have another question. I don't know if I need to modify the XSLT or if I'm missing an attribute on my XML.
I have an xref to another topic in a step:
<step>
<cmd><xref href="DeactivatingLicense.dita">Deactivate the license on your existing
computer.</xref></cmd>
</step>
The PDF output generated it:
"1. Deactivate the license on your existing computer."
How do I make the xref state the page number of the topic as below when outputting to PDF.
"1. Deactivate the license on your existing computer, see page XX."
Regards,
Simon
I have an xref to another topic in a step:
<step>
<cmd><xref href="DeactivatingLicense.dita">Deactivate the license on your existing
computer.</xref></cmd>
</step>
The PDF output generated it:
"1. Deactivate the license on your existing computer."
How do I make the xref state the page number of the topic as below when outputting to PDF.
"1. Deactivate the license on your existing computer, see page XX."
Regards,
Simon
-
- Posts: 19
- Joined: Thu Mar 29, 2012 4:45 pm
Re: DITA-OT PDF plugin
I'm trying to rearrange the table of contents so I have a page number before the topic title. I have this working by moving the page number block above the title. I then use the fo:leader to indent the titles depending on their level. However, where the page number changes from single digits to double or triple there is a slight difference in the alignment of the titles.
I was hoping I could wrap the page number in an inline-container with a fixed width like this:
However, when I try transform I get and error that fo:inline is not a valid child of fo:inline-container. I'm not sure what is treated as a valid child of inline-container as nothing seems to work.
Any ideas how else I could achieve fixing the width of the page number field so the titles align regardless of the number of digits in the page number.
-Simon
I was hoping I could wrap the page number in an inline-container with a fixed width like this:
Code: Select all
<fo:inline-container width="2cm" >
<fo:inline xsl:use-attribute-sets="__toc__page-number">
<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:inline-container>
Any ideas how else I could achieve fixing the width of the page number field so the titles align regardless of the number of digits in the page number.
-Simon
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: DITA-OT PDF plugin
Hi Simon,
The idea to have the page number to the left of the topic titles seems quite strange to me... Is it for Arabic content?
About fo:inline-container, the specification states it allows block-type elements:
https://www.w3.org/TR/xsl/#fo_inline-container
Not sure what to suggest in this case, maybe you could ask around on the DITA Users List Yahoo Group, see if the people registered on it have better approaches.
Regards,
Radu
The idea to have the page number to the left of the topic titles seems quite strange to me... Is it for Arabic content?
About fo:inline-container, the specification states it allows block-type elements:
https://www.w3.org/TR/xsl/#fo_inline-container
Not sure what to suggest in this case, maybe you could ask around on the DITA Users List Yahoo Group, see if the people registered on it have better approaches.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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