Search code examples
reusabilitydita

Is there a way to reuse content but substitute local values in DITA


I have a project that is written in DITA and I have run into a reuse scenario that I thought would be easy to address, but I can't find a way to do it. I want to reuse certain chunks of content across multiple topics in a document, but to substitute local values at some places in the reused content.

I have topics dealing with the same subject matter but for different platforms (Windows, Linux, etc.). Much of the information is the same between them, but there are local variations in the content, like the name of the platform or a particular value which applies on one platform an not another.

I thought I was going to be able to use keys to substitute in the appropriate values in the sub-maps that define each presentation-level topic. But it seems, from what I have experienced and from what I have read, that while you can define keys locally in a map, they are all resolved into a single global key space at build time. In other words, you can redefine a key locally, but the effect of doing so is global. So my attempt to define keys locally would result in one of the platforms winning the global definition contest and those values being used in all my reused content, regardless of which map they are reused in.

Have I missed something? Is there a way to do this in DITA?


Solution

  • You haven't missed anything, at present (DITA 1.2) this is not possible. You can of course reuse pieces of content multiple times in the same document, but you cannot have variations within that reused content.

    This is indeed a shortcoming, but it is being addressed in the next version, DITA 1.3, by the use of "key scope". This article explains it well:

    http://www.infomanagementcenter.com/members/newsletter/Output/2014/04-April/04062014.php