PDF front page: Insert two items from a topic?

Post here questions and problems related to editing and publishing DITA content.
tsurikov
Posts: 4
Joined: Thu Jul 03, 2025 5:09 pm

PDF front page: Insert two items from a topic?

Post by tsurikov »

Dear experts,

I use Oxygen XML Editor 27.1 to publish DITA content to PDF via a customized XSLT plug-in based on org.dita.pdf2. I need the PDF front page to pull two items from a topic, like this:
image.png
How could I do this, please? I'm fairly comfortable with other aspects of XSLT, plugins, and transformations ... I just can't figure out the XSLT code in this case. Specifically I can't figure out how to convince the DITA OT not to publish the front_page.dita topic as a regular topic using the typical page layout like all other topics use.

Thank you in advance for any help and suggestions!
You do not have the required permissions to view the files attached to this post.
xephon
Posts: 164
Joined: Mon Nov 24, 2014 1:49 pm
Location: Greven/Germany

Re: PDF front page: Insert two items from a topic?

Post by xephon »

I'd suggest you create dedicated fields on the bookmap for this purpose. There is an old but good book, called DITA for Print. It will help you to get what you want.
stefan-jung.org – Your DITA/DITA-OT XML consultant
julien_lacour
Posts: 717
Joined: Wed Oct 16, 2019 3:47 pm

Re: PDF front page: Insert two items from a topic?

Post by julien_lacour »

Hello,

Besides what Stefan said, you should also take a look at the original "createFrontCoverContents" PDF2 template.
You could also follow the "Embedding a Company Logo" from our user guide, this a good starting point for front page customization.

Regards,
Julien
tsurikov
Posts: 4
Joined: Thu Jul 03, 2025 5:09 pm

Re: PDF front page: Insert two items from a topic?

Post by tsurikov »

Thank you for your fast responses, xephon and Julien!

I have DITA For Print, love it, and use it constantly. I didn't find it helpful in this case because its front-cover customization examples are only for small individual elements in the bookmap (such as the title) or static elements that never change (such as the logo). I can't add regular topic content -- paragraphs, lists, tables, images -- directly in a bookmap. They must go in a topicref.

I think I've narrowed down my problem to XPath syntax. I just cannot figure out how to get the stylesheets to see my topic content. During testing, I couldn't even get them to see the entire front_page.dita topic. For example, I expected one of these to display the entire topic, but neither does -- the result is empty content:

<xsl:apply-templates select="$map/bookmap/frontmatter/topicref[1]"/>
<xsl:apply-templates select="$map/*[contains(@class, ' bookmap/frontmatter ')]/*[contains(@class, ' map/topicref ')][1]"/>

I know that Oxygen XML Editor includes an XSLT debugger with an XPath builder, but I haven't yet been able to get it set up for a DITA OT plug-in.
julien_lacour
Posts: 717
Joined: Wed Oct 16, 2019 3:47 pm

Re: PDF front page: Insert two items from a topic?

Post by julien_lacour »

Hello,

To set up the debugger for your plugin you can follow this topic from our user-guide.
After integrating the plugin, it should appear in topic2fo_shell_fop.xsl imports.

You should be able to fetch the topic using something like:

Code: Select all

<xsl:variable name="front_page"
    select="/descendant::*[contains(@class, ' topic/topic ')][@oid = 'front_page']"/>
As the stage1.xml file contains the ditamap with its topics merged.

Regards,
Julien
Post Reply