Keyref in conref not resolved in PDF

58 views
Skip to first unread message

Andrew Campbell

unread,
Jul 10, 2019, 11:53:11 AM7/10/19
to DITA-OT Users
I have three files - a bookmap, a normal topic, and a topic that is only used as a conref.

Using DITA-OT 3.3.1 and DITA-3.3.2, and the html5 transform, everything is resolved correctly, but when I use the pdf transform, only the keyref in the normal topic is resolved; the keyref in the conref'ed file isn't resolved.

When I edit the files in Oxygen, everything looks OK - both keyrefs are resolved, and I can generate the correct PDF out put from Oxygen.

I'm at a loss to know what is going on here. Can anyone help?

I have attached the three inout files and relevant output files from the 3.3.1 transform.
testBook.pdf
topic.html
conrefTarget.dita
testBook.ditamap
topic.dita

Radu Coravu

unread,
Jul 11, 2019, 12:49:39 AM7/11/19
to Andrew Campbell, DITA-OT Users
HI Andrew,

The PDF output was changed a couple of DITA OT versions ago to use a new type of pre processing stage called "preprocess2".
Because of various bugs we encountered, Oxygen's bundled DITA OT has a small modification so that the PDF output still uses the "preprocess" stage.
If you want to make this change in your DITA OT, open the build file "DITA-OT\plugins\org.dita.pdf2\build_template.xml", search in it for "preprocess2", replace with "preprocess" and then run again "dita --install" to integrate your changes to the plugin.

Or if you want to continue using the DITA OT unchanged try adding in your DITA Maps references also to resource-only topics (like the ones holding the content referenced content). Something like this:

<topicref href="conrefTarget.dita" processing-role="resource-only"/>

This should make the publishing work and in general it's a good practice.

Regards,
Radu

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/dita-ot-users/622aa7c9-a7ec-4578-a6c7-b27f8873a7bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Campbell

unread,
Jul 12, 2019, 4:31:24 AM7/12/19
to DITA-OT Users
Thank you. Based on what you said, I’ve been able to get a solution that works without having to edit the default plugin.
 
In my custom PDF plugin I had the line
 
<target name="my-pdf"
       depends="my-pdf.init,
                dita2pdf2"/>
 
In the depends attribute, I replaced dita2pdf2 with the depends for dita2pdf2 (found in plugins.org.dita.pdf2/build_template.xml), except I changed preprocess2 to preprocess.
 
<target name="my-pdf"
        depends="my-pdf.init,
                 dita2pdf2.init,
                 build-init,
                 preprocess,
                 map2pdf2,
                 topic2pdf2"/>
 
I based this on this page: Map-first preprocessing.  
 
Any thoughts on or criticisms of this approach are welcome.

Andrew

Radu Coravu

unread,
Jul 12, 2019, 4:48:34 AM7/12/19
to Andrew Campbell, DITA-OT Users
Hi Andrew,

Great, looks good to me.

Regards,
Radu

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages