Page 1 of 1

Multiple keyword values for a single keydef, in one output?

Posted: Thu Aug 17, 2017 5:58 pm
by ren
Hello

We'd like to publish a single output for multiple domain types, using keydefs to populate terms specific to each domain. The goal is to avoid hardcoding terms that may change in future (and would therefore require manual/Find and Replace updating). Our topics are contained within a "user_guide.ditamap", which contains a "product_variables.ditamap", which contains the keydefs and their keyword values. Our current transformation scenario for the PDF output is filtered using a .ditaval file. We're using oXygen XML author 18, DITA-OT 1.8.5, Mac OS X version 10.11 (El Capitan)

For example, we'd like to be able to have a single topic containing multiple instances of

Code: Select all

 <section id="example_charts"><title>Example
<keyword keyref="Domain"/> Charts</title></section>
Where the 'Domain' keyword would populate as follows

Code: Select all

<keydef keys="Domain">
<topicmeta>
<keywords>
<keyword>Term for domain A</keyword>
<keyword>Term for domain B</keyword>
<keyword>Term for domain C</keyword>
</keywords>
</topicmeta>
</keydef>
The .ditaval for the output would be set as follows:

Code: Select all

<prop att="domain" val="a" action="include"/>
<prop att="domain" val="b" action="include"/>
<prop att="domain" val="c" action="include"/>
That way, when we product a single PDF output, we'll have a topic containing the following sections
"Example Term for domain A Charts"
"Example Term for domain B Charts"
"Example Term for domain C Charts"

However, during the PDF transformation, oXygen populates all

Code: Select all

<keyword keyref="Domain"/>
with 'Term for domain A'. If we change the keyword order in our product_variables.ditamap, say

Code: Select all

<keydef keys="Domain">
<topicmeta>
<keywords>
<keyword>Term for domain B</keyword>
<keyword>Term for domain C</keyword>
<keyword>Term for domain A</keyword>
</keywords>
</topicmeta>
</keydef>
Then all populate with 'Term for domain B' upon PDF transformation.

We've tried inserting <ph domain="b"><keyword keyref="Domain"/></ph>, to enable the output to display 'Term for domain B' in the appropriate sections, but find that doing so omits any value in the output.

Is it possible to produce a single output with keydefs populated with different values?
Thanks,
Ren

Re: Multiple keyword values for a single keydef, in one output?

Posted: Fri Aug 18, 2017 11:49 am
by Radu
Hi Ren,

The DITA standard has a default set of profiling attributes which can be used to filter out content:

https://www.oxygenxml.com/dita/1.3/spec ... dproc.html

There is no @domain attribute defined in the DITA standard. Are you using a DITA specialization which added it?
I read your thread post a couple of times and I think that I'm beginning to understand what you want.
First of all a DITAVAL like this:

Code: Select all


....
<prop att="domain" val="a" action="include"/>
<prop att="domain" val="b" action="include"/>
<prop att="domain" val="c" action="include"/>
....
does not help at all because by default all profiling attribute values are included.
Also by default with DITA 1.2 you cannot have a key with more than one effective value. So usually when you get a key with multiple keywords, only the first keyword will be used when the keyref is resolved.
I think what you would find useful is the DITA 1.3 key scoping mechanism:

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

There is there a topic there called peeling.dita which refers to a key <ph keyref="vegetable"/>. Because the "peeling.dita" is included multiple times in the DITA Map and each time with a new key scope, its contents will change as the "vegetable" key is redefined in each context.

The DITA 1.3 branch filtering might also work for what you want:

http://blog.oxygenxml.com/2015/09/dita- ... -next.html

You refer to a topicref structure multiple times in the map but each time with a different DITAVAL file applied.

Regards,
Radu

Re: Multiple keyword values for a single keydef, in one output?

Posted: Fri Aug 18, 2017 3:51 pm
by ren
Thanks for your reply, Radu

We did create a DITA specification for domain.

I tested out keyscopes in a test project using the peeling.dita example and it worked well. Unfortunately since we are on DITA-OT 1.8.5 we cannot use DITA specification 1.3. We find changing to DITA-OT 2.x results in several build errors whereby some nested .ditamaps are not parsed, our keydefs are not populated with values in the output, and our .css is not respected in the output. That seems like a topic for another forum question, however.

We'll keep keyscopes and branch filtering in mind if we move forward with DITA-0T 2.x.

Thanks for your help on this,
Ren

Re: Multiple keyword values for a single keydef, in one output?

Posted: Fri Aug 18, 2017 4:01 pm
by Radu
Hi Ren,

Ok. If at some point you will need a hand migrating and you will be able to share with us a sample project we'll try to help on a different forum thread (or you can email us if you have sensitive information).

Regards,
Radu