Formatting text in keyword element

Post here questions and problems related to editing and publishing DITA content.
THaen
Posts: 10
Joined: Mon Apr 23, 2018 10:56 am

Formatting text in keyword element

Post by THaen »

Hi,

For a specific customer, we are using keys to manage the product names. However, some of those product names contain one or two words that have to be in italics. It is not possible to use the <i> element in a <keyword> element. Does someone have a solution to this?

Any hints would be much appreciated.

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

Re: Formatting text in keyword element

Post by Radu »

Hi,

Using keyrefs you can only reuse plain pieces of text. If you want to reuse text with various inline elements you will need to use conkeyrefs. Usually with conkeyrefs you have a DITA topic containing reusable elements, which with an id attribute defined on it. You create a <keydef> in the DITA Map pointing to the topic and then refer to the reusable content something like <ph conkeyref="keyName/elementID"/>.

https://www.oxygenxml.com/doc/versions/ ... eyref.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
THaen
Posts: 10
Joined: Mon Apr 23, 2018 10:56 am

Re: Formatting text in keyword element

Post by THaen »

Hi Radu,

Thank you for your answer, I was thinking in that direction, but didn't really know how exactly. I'm going to try it right now. Thanks!

Tessa
THaen
Posts: 10
Joined: Mon Apr 23, 2018 10:56 am

Re: Formatting text in keyword element

Post by THaen »

Hi Radu,

That worked for me in body text.
However, what if we need that same product name in the metadata (<prodname>), to generate output that uses the metadata to put the productname in the header on each page of the document? I cannot insert that conkeyref there, because the <ph> element is not valid there. Do you have any tips for that circumstance?

Regards,
Tessa
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Formatting text in keyword element

Post by Radu »

Hi Tessa,

You will probably need to define an extra reusable <keyword> holding the same product name but without styling and refer to it using keyref.
You will get indeed the same product name definition duplicate, once as a reusable ph and once as a keyword.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
THaen
Posts: 10
Joined: Mon Apr 23, 2018 10:56 am

Re: Formatting text in keyword element

Post by THaen »

Hi Radu,

Thank you for your reply.
Does that mean that it is not possible to use text formatting in the <prodname> element?

Regards,
Tessa
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Formatting text in keyword element

Post by Radu »

Hi Tessa,

The DITA 1.3 specs lists the possible child elements of <prodname>:

https://www.oxygenxml.com/dita/1.3/spec ... __prodname

and they are all you can use. The <prodname> element is intended as metadata, so it was not considered as something which appears in the published output.

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