Re: modifying multiple instances of a topic in the same map?


Ron Wheeler
 

You might want to explain your use case a bit in terms of what you want to customize and what you need to produce.

audience might be helpful.
It pushes the customization into the topic a bit.

In order to create bilingual documents, I have used audience to select the content in the topic that will be output.

    <shortdesc>
        <ph audience="en">This unit has 2 bedrooms and 1 bathroom in the interior of the building.</ph>
        <ph audience="fr">Cette unité dispose de 2 chambres et 1 salle de bain à l'intérieur du bâtiment.</ph>
    </shortdesc>

In my case this does the job very well and I like having the 2 languages in the same topic so that the text has a better chance of staying in synch.

If your case is more complex you may also have to think about using keyref/conkeyrefs as well.

Ron

On 2020-02-06 6:51 p.m., Chris Papademetrious wrote:
If I reuse the same topic in multiple bookmaps, and those bookmaps have a difference in profiling attributes (let's say, @product), then I can customize the topic for each bookmap:

<topic id="mytopic">
  <title>My Topic</title>
  <body>
    <p product="p1">This is customized for Product P1.</p>
    <p product="p2">This is customized for Product P2.</p>
  </body>
</topic>

But let's say I reuse a topic multiple times in the *same book*:

<bookmap>
  <chapter ...>
    <topicref href="mytopic.dita" keys="my1"/>
  </chapter>
  ...
  <chapter ...>
    <topicref href="mytopic.dita" keys="my2"/>
  </chapter>
</bookmap>

What mechanisms are available to customize each instance of that topic in the same book?

Is there a way to push a profiling attribute down into a referenced topic from the map?

 - Chris

Join main@dita-users.groups.io to automatically receive all group messages.