Use of conkeyref with product metadata attribute

ann.jensen
Posts: 236
Joined: Wed Jun 17, 2015 10:19 am

Use of conkeyref with product metadata attribute

Post by ann.jensen » Fri Sep 09, 2016 6:54 pm

Hi,
I am trying to use a conkeyref across 2 sibling ditamaps within a root ditamap.
I have set the user-defined metadata attribute product for each of the sibling ditamaps.
In m_iproperty_docs.ditamap

Code: Select all

<map collection-type="sequence" product="iproperty">
<!-- Key definitions -->
<keydef keys="variables" href="variables_ip.dita" product="iproperty"/>
<!-- End Key definitions -->
and in m_iproperty_ags.ditamap

Code: Select all

<map collection-type="sequence" product="ipropertyAGS">
<!-- Key Definitions -->
<keydef keys="variables" href="variables_ipags.dita" product="ipropertyAGS"/>
<!-- end Key Definitions -->
I am setting the key values as follows:
in variables_ip.dita

Code: Select all

<concept id="variables_ip" product="iproperty">
<title>Variables_ip</title>
<conbody>
<p><ph id="summary">The <ph conref="../../../dita_files/t_content_refs.dita#t_content_refs/iproperty"/> <ph conkeyref="variables_iproperties/summary"/>
Archived work order tasks (work orders older than six months) are included by default.</ph>
<image></image>
<ph conkeyref="variables_iproperties/actions"/>
</p>
and in variables_ipags.dita

Code: Select all

<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="variables_ipags" product="ipropertyAGS">
<title>Variables iPags</title>
<conbody>
<!-- summary -->
<p><ph id="summary">
The <ph conref="../../../dita_files/t_content_refs.dita#t_content_refs/ipropertyags"/> <ph conkeyref="variables_iproperties/summary"/>
</ph></p>
And I am trying to use the keys as follows expecting that the product attribute will be taken into account at build time.
In c_prop_summary.dita

Code: Select all

<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="c_prop_summary" product="iproperty">
<title>Property Summary - <ph conref="../../t_content_refs.dita#t_content_refs/iproperty"/></title>
<shortdesc><ph conkeyref="variables/summary"/></shortdesc>
and in c_prop_summary_ags.dita

Code: Select all

<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="c_prop_summary_ags" product="ipropertyAGS">
<title>Property Summary - <ph conref="../../../t_content_refs.dita#t_content_refs/ipropertyags"/></title>
<shortdesc><ph conkeyref="variables/summary"/></shortdesc>
However, only the first key defined is used at build time i.e. from variables_ip.dita.

I don't understand how to ensure that the correct key value is resolved based on the product metadata value.
Any advice appreciated,
Regards,
Ann

Radu
Posts: 7029
Joined: Fri Jul 09, 2004 5:18 pm

Re: Use of conkeyref with product metadata attribute

Post by Radu » Tue Sep 13, 2016 2:19 pm

Hi Ann,

This is one of those cases where attaching a small small DITA project would help.
The @product attribute, among others can be used to filter out content.
Am I to understand that you do not actually want to filter content (exclude either one or the other topic) but to somehow use it as an indication to a certain value that a key name should resolve to?
A key can be bound to more than one values only using the DITA 1.3 key scoping feature:

http://blog.oxygenxml.com/2015/08/dita- ... on-of.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply