Page 1 of 1

Reusing a ditamap along with keyscopes

Posted: Fri Sep 23, 2016 6:05 pm
by ann.jensen
Hi,
I have a ditamap with a bunch of child topics that relate directly to one of my products...and with a small few changes also relate to another of my products.
Because of the commonalities I would like to reuse this map and use keys with key scope to deal with the differences.
I have done this successfully with a bunch of topics (not part of a map) but don't see how I can use keydefs and keyscope while reusing a ditamap and its child topics without explicitly referencing each of the map's topics.
Is this approach only possible with topics and not maps?
thanks in advance,
Ann

Re: Reusing a ditamap along with keyscopes

Posted: Mon Sep 26, 2016 12:26 pm
by Radu
Hi Ann,

You can set a keyscope attribute on the reference to the DITA Map.
If I did not precisely understand your usecase maybe you can give me a small example, either paste some DITA content here or attach a sample DITA project to an email...

Regards,
Radu

Re: Reusing a ditamap along with keyscopes

Posted: Mon Sep 26, 2016 5:18 pm
by ann.jensen
Hi Radu,
I just tried again and it is possible. I can reuse a reference to a DITAMAP, set a unique keyscope value on each map reference (or a parent topic) and then set the same keydefs with different values within the

Code: Select all

<topicref>
and

Code: Select all

</topicref>
elements for each of the map references.
Hope that makes sense,
Regards,
Ann

Re: Reusing a ditamap along with keyscopes

Posted: Tue Sep 27, 2016 10:56 am
by Radu
Hi Ann,

Yes, that's the way :)

Regards,
Radu

Re: Reusing a ditamap along with keyscopes

Posted: Mon Oct 17, 2016 10:44 am
by ann.jensen
Hi Radu,
I am having difficulty with this approach again. Taking my description in my previous post - if my 2 ditamap references each live within 2 topicrefs that have keyscopes set on them, can I still use this approach?

Code: Select all

<topicref href="AspeniProperties/c_about_iproperty.dita" collection-type="sequence" product="iproperty" keyscope="iproperty_scope"> 
<!-- Various keydefs -->
<keydef keys="system_name">
<topicmeta><keywords><keyword>Aspen iProperty®</keyword></keywords></topicmeta>
</keydef>
<topicref href="AspeniProperties/notes/m_notes_ip.ditamap" format="ditamap" keyscope="iproperty_notes_scope">
<!-- Various keydefs -->
<keydef keys="task_notes_tab" href="AspeniProperties/notes/images/i_task_note_tab.png" format="png"/>
</topicref>
</topicref>

<topicref href="AspeniPropertiesAGS/c_ip_ags.dita" collection-type="sequence" product="ipropertyags" keyscope="ipropertyags_scope">
<!-- Various keydefs -->
<keydef keys="system_name">
<topicmeta><keywords><keyword>Aspen iProperty® AGS</keyword></keywords></topicmeta>
</keydef>
<topicref href="AspeniProperties/notes/m_notes_ip.ditamap" format="ditamap" keyscope="ipropertyags_notes_scope">
<!-- Various keydefs -->
<keydef keys="task_notes_tab" href="AspeniPropertiesAGS/notes/images/i_task_note_tab.png" format="png"/>
</topicref>
</topicref>
I am getting errors because of the multiple levels of keyscopes. When I try to use a keydef defined at level 1 within the level 2 keyscope e.g. try to reference system_name key from within iproperty_notes_scope, it cannot resolve its value because it is 2 levels up from where I want to use it :-|.

Any advice appreciated,
Regards,
Ann

Re: Reusing a ditamap along with keyscopes

Posted: Mon Oct 17, 2016 11:11 am
by ann.jensen
Hi,
I forgot to mention that everything resolves fine in Author view in oXygen XML Author but this is not the case when I run the transform to generate WebHelp.
Regards,
Ann

Re: Reusing a ditamap along with keyscopes

Posted: Mon Oct 17, 2016 1:34 pm
by Radu
Hi Ann,

So this:
When I try to use a keydef defined at level 1 within the level 2 keyscope e.g. try to reference system_name key from within iproperty_notes_scope, it cannot resolve its value because it is 2 levels up from where I want to use it
should work, maybe there is a bug on the publishing side. Could you put together some samples to demonstrate this and send them to support@oxygenxml.com?

Regards,
Radu