Using keys for topics in bookmaps

Having trouble installing Oxygen? Got a bug to report? Post it all here.
rww
Posts: 23
Joined: Wed Jul 24, 2013 12:40 am

Using keys for topics in bookmaps

Post by rww »

Hi

I have a common bookmap that I'm using in two product bookmaps, since 95% of the material is common to both products. For some topics though, like About Product X I need to be able to reference the correct topic for the product, so one Product A book would have About Product A and the other book About Product B. I can do this using profiling by having both these topics in the common bookmap and by setting the correct profile for each topic, but I don't think this is very elegant and I'd like to be able to do it through keys so the correct topic is automatically referenced in the Product A/B bookmap.

I guess what I'm asking is, is there a way to use keys to reference topics in a bookmap?

Thanks

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

Re: Using keys for topics in bookmaps

Post by Radu »

Hi Richard,

Let's say you would have a product1.ditamap which would have several key mappings among which a key mapping like:

Code: Select all

<keydef href="product1Info.dita" keys="productInfo"/>
and a product2.ditamap which at some point could define a key mapping for the same key like:

Code: Select all

<keydef href="product2Info.dita" keys="productInfo"/>
Then in the common bookmap you would need to refer to the defined key:

Code: Select all

<topicref keyref="productInfo"/>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
rww
Posts: 23
Joined: Wed Jul 24, 2013 12:40 am

Re: Using keys for topics in bookmaps

Post by rww »

Ah yes, that's what I was looking for - thanks.

I've discovered that NOT defining a key for a topic that's included in the common bookmap as a keyref excludes that topic from the generated output. However, although the PDF gets generated, a validation check fails due to the missing keydef. I thought about setting <keydef href="" keys="productInfo"/> but it gives a syntax error.
rww
Posts: 23
Joined: Wed Jul 24, 2013 12:40 am

Re: Using keys for topics in bookmaps

Post by rww »

I had a read of the Oasis spec for the keydef element and there's an attribute called print, which accepts values of Yes and No. Applying this to the keydef does exactly what I want:

Code: Select all

<keydef href="product1Info.dita" keys="productInfo" print="no"/>
Radu
Posts: 9449
Joined: Fri Jul 09, 2004 5:18 pm

Re: Using keys for topics in bookmaps

Post by Radu »

Hi,

Yes, the print attribute is a kind of profiling condition based on the obtained output format, print='yes' basically means PDF pr PDF-type outputs.

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