Can I use links to external files in my KEYDEF ditamap

Post here questions and problems related to editing and publishing DITA content.
protl
Posts: 13
Joined: Mon Dec 18, 2017 10:52 pm

Can I use links to external files in my KEYDEF ditamap

Post by protl »

I have a project that uses variables for content such as product names. The variables are defined as KEYDEF elements in a single .ditamap file, and all are contained in a MAP element within the .ditamap file. When I insert a variable into one of my topic files, the list of available variables that I see comes from the .ditamap file that I have selected as the root map for my project.

I'd like to be able to have a subset of my variables be shared across projects. Is there a way that I can format my variables file so that it points to one or more external files for shared variables, while still containing the KEYDEF values for my local variables?

For example:
<map>

<title>Variables</title>

<!--GLOBAL variables-->
....SOME KIND OF LINK TO EXTERNAL FILE WOULD BE HERE....

<!--LOCAL variables-->
<keydef keys="companyCity"><topicmeta><keywords><keyword>Cambridge, MA</keyword></keywords></topicmeta></keydef>
<keydef keys="companyName"><topicmeta><keywords><keyword>Acme</keyword></keywords></topicmeta></keydef>

</map>
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Can I use links to external files in my KEYDEF ditamap

Post by Radu »

Hi,

In your "variables.ditamap" you can add a topicref to another "common_variables.ditamap" like:

Code: Select all

<topicref format="ditamap" href="common_variables.ditamap"/>
And the "common_variables.ditamap" is another DITA Map which has extra key definitions.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply