Page 1 of 1

How to add a preference.xml in Oxygen for Dita PDF

Posted: Thu Jul 27, 2017 12:48 pm
by lisazeng
Hi Expert,

I want to add a preference.xml in my ditamap and it is no included in my chapters counts. my toc should like these in Dita PDF

Content
Preference
Chapter 1
Chapter 2


As Preferences are different for each documents, so we need to edits it as xml while not hard code in the dita OT plugin.

Thanks!

br,
lisa

Re: How to add a preference.xml in Oxygen for Dita PDF

Posted: Thu Jul 27, 2017 3:39 pm
by Radu
Hi,

You can add in your DITA Map a topicref like:

Code: Select all

  <topicref href="prefs.xml" processing-role="resource-only" format="xml"/>
The file will not be considered part of the TOC. And you can use the XSLT document() function to load it and use its settings.

Regards,
Radu

Re: How to add a preference.xml in Oxygen for Dita PDF

Posted: Mon Aug 14, 2017 8:47 am
by lisazeng
Hi Radu,

If I use <topicref href="prefs.xml" processing-role="resource-only" format="xml"/>, then the prefs.xml is not shown in my created PDF.
How can I make it avaialbel?

thanks!

Lisa

Re: How to add a preference.xml in Oxygen for Dita PDF

Posted: Mon Aug 14, 2017 8:58 am
by Radu
Hi Lisa,

And how would you like it to show up in the PDF? It's a custom XML format from what I understand.
Do you actually want in the PDF a code block containing the entire contents of the XML file? If so, maybe in one of your DITA topics you can use a <coderef>:

https://www.oxygenxml.com/dita/1.3/spec ... deref.html

Regards,
Radu

Re: How to add a preference.xml in Oxygen for Dita PDF

Posted: Mon Aug 14, 2017 9:26 am
by lisazeng
Hi Radu,

In my Dita map I have
<topicref href="concepts/preface.xml" format="xml" processing-role="resource-only"/>
<topicref href="concepts/about_this_document.xml">

and the created PDF has no content of preface.xml before the content of about_this_document.xml, the whole preface.xml is missing in my PDF.

I just want to have this preface.xml also shown in my PDF as a preface page.

Thanks!

br,

Lisa

Re: How to add a preference.xml in Oxygen for Dita PDF

Posted: Mon Aug 14, 2017 12:25 pm
by Radu
Hi Lisa,

The original subject of this forum thread discussed about a "preference.xml". I considered that it was an XML document which was not a DITA file and you wanted to include it in the DITA Map.
Now from what I see you mention a "preface.xml". So it's a DITA topic that you want to refer in the DITA Map before all chapters, right?
If you are using a DITA Bookmap structure there is a special <preface> element which you can use:

Code: Select all

<!DOCTYPE bookmap PUBLIC "-//OASIS//DTD DITA BookMap//EN"
"http://docs.oasis-open.org/dita/v1.1/OS/dtd/bookmap.dtd">
<bookmap id="taskbook">
....................
<frontmatter>
<preface href="topics/preface.xml"/>
</frontmatter>
<chapter href="topics/installing.xml">
........
</chapter>
<chapter href="tasks/configuring.xml">
....................
</chapter>
................
</bookmap>
Regards,
Radu