Page 1 of 1

Including the topic path and title in the PDF output

Posted: Mon Apr 11, 2016 12:43 pm
by Anonymous1
In the past (using FrameMaker to create PDFs), we provided our translators with the translation project and a PDF. The PDF was our full english manual with one customization. The path and file name of each topic were included in the PDF. This looked like this:

Topic Title
BlaBla BlaBla topic description.
T:/manuals/project_a/spanish/chapter_name/topic_name.xml


When translating with Tansit, the topic path and name is also always visible. This information helped the translators to quickly jump to the right position in our PDF manual if they wanted to see the topic they were translating in context to other topics.

Is there a way to include the topic path and name in the PDFs we create with Oxygen using Apache FOP?

Re: Including the topic path and title in the PDF output

Posted: Mon Apr 11, 2016 1:43 pm
by Radu
Hi,

This seems feasible with an XSLT customization.
The XSLT template which outputs the topic title is located in:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\xsl\fo\commons.xsl

and is called:

<xsl:template match="*" mode="processTopicTitle">

It outputs an fo:block and after that you can add:

Code: Select all

<fo:block>Original Topic: <xsl:value-of select="@xtrf"/></fo:block>
The "@xtrf" attribute is set on all DITA elements in the temporary files folder when processing and it refers to the original topic location.
Here's the recommended way in which an XSLT template can be overwritten from a customization:

https://www.oxygenxml.com/doc/versions/ ... ation.html

Regards,
Radu

Re: Including the topic path and title in the PDF output

Posted: Mon Apr 11, 2016 3:18 pm
by Anonymous1
That worked perfectly :)

Thank you.