Using a ditaval file in a ditamap

Post here questions and problems related to editing and publishing DITA content.
jwilkes
Posts: 4
Joined: Tue Apr 25, 2017 1:12 pm

Using a ditaval file in a ditamap

Post by jwilkes »

Or whatever will work for my use case...

I have a number of ditamaps, each of which produces its own manual. A single transformation scenario converts them into pdf (I have another for webhelp). Typically, I want to generate a number of manuals in one go, rather than each separately.

Some dita topics are used in all of the ditamaps. They contain "product" attributes so that I can include or exclude the corresponding product name in each manual.

I define a ditaval file for each product which determines which parts are excluded or included.

How does this then work together? How can I get a ditamap to reference the ditaval file so that only the correct ditaval file is used when building?

I can right-click the ditamap in the DITA Maps Manager and select Edit Preferences. There are a range of options to configure the profile, but nothing I do here has any effect. I just get all of my conditional text, regardless of what I select. Have I missed something here?

The only two ways I find to exclude text are:
  • Use the "funnel" filter option at the top of the DITA Maps Manager. This applies the filter correctly, but it is global, i.e. I cannot use different filters for different ditamaps in one build.
  • Set the ditaval file in the transformation scenario. This applies the same ditaval to all ditamaps when I build a number. Again, this is effectively a global solution.
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Using a ditaval file in a ditamap

Post by Radu »

Hi,

So:
Set the ditaval file in the transformation scenario. This applies the same ditaval to all ditamaps when I build a number. Again, this is effectively a global solution.
Yes and no. When you edit the transformation scenario, in the "Filters" tab you can refer to the DITAVAL file using editor variables, for example something like this ${cfd}/${cfn}-ditaval.ditamap. So Oxygen will load the DITAVAL file by using the current file name of the published DITA Map and adding a suffix to it, thus loading another DITAVAL file for each published DITA Map.

Or as another workaround (but I would suggest you use the editor variables approach) refer in the DITA Map to the DITAVAL file (using the DITA 1.3 branch filtering support):

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

something like:

Code: Select all

<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map title="Growing Flowers">
<ditavalref href="my-specific.ditaval"/>
...............
but branch filtering is not 100% properly implemented in the publishing engine so you may encounter side-effects.


Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jwilkes
Posts: 4
Joined: Tue Apr 25, 2017 1:12 pm

Re: Using a ditaval file in a ditamap

Post by jwilkes »

Fantastic, works a treat! Thanks Radu for the workaround, not quite what I expected but it does what I need.
Post Reply