Reusing a ditamap along with keyscopes

Post here questions and problems related to editing and publishing DITA content.
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Reusing a ditamap along with keyscopes

Post 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
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: Reusing a ditamap along with keyscopes

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: Reusing a ditamap along with keyscopes

Post 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
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: Reusing a ditamap along with keyscopes

Post by Radu »

Hi Ann,

Yes, that's the way :)

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: Reusing a ditamap along with keyscopes

Post 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
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: Reusing a ditamap along with keyscopes

Post 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
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: Reusing a ditamap along with keyscopes

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply