Dynamically change a chunk of content within a conref?
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 24
- Joined: Wed Jan 04, 2017 3:48 pm
Dynamically change a chunk of content within a conref?
I created a series of DITA task topics that explain how to create different configuration items in our portal. There are some steps that are the same for all types of configurations. I documented these reusable steps in a collection file and inserted them into the task topics using a conref.
There is one reusable step in which I would like to cite the configuration based on the topic in which the conref is used. Is it possible to dynamically change the configuration type cited in the conref based on the configuration type associated with the topic? Consider the following example steps that would be referenced in task topics for three different types of configurations: proxy, SAML, and container.
In each task topic, I would conref the <ph> element into the appropriate step and add the configuration type as static text after the conref. For example:
I appreciate your thoughts.
I am using Oxygen XML Editor 25.1.
There is one reusable step in which I would like to cite the configuration based on the topic in which the conref is used. Is it possible to dynamically change the configuration type cited in the conref based on the configuration type associated with the topic? Consider the following example steps that would be referenced in task topics for three different types of configurations: proxy, SAML, and container.
- In the Comment field, enter the reason for creating the proxy.
- In the Comment field, enter the reason for creating the SAML.
- In the Comment field, enter the reason for creating the container.
Code: Select all
<ph id="configuration_reason">In the <uicontrol>Comment</uicontrol> field, enter the reason for creating the</ph>
Code: Select all
<step>
<cmd><ph conref="../_common/t_coll_config_tool.dita#t_coll_config_tool/configuration_reason"/> proxy.</cmd>
</step>
I am using Oxygen XML Editor 25.1.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Dynamically change a chunk of content within a conref?
Hi,
I think what you want would be possible if you used DITA key scopes with key refs and content key references.
The DITA Map would look like this:
with "reusableSteps.dita" looking like:
and the "myTask.dita" containing a
But this might in a way complicate things also make things more difficult for translations as it's best to translate entire block elements and not to translate individual texts which end up being concatenated together.
Regards,
Radu
I think what you want would be possible if you used DITA key scopes with key refs and content key references.
The DITA Map would look like this:
Code: Select all
<topicref href="myTask.dita" keyscope="ks">
<keydef keys="variableSuffix">
<topicmeta>
<keywords>
<keyword>prefix</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="reusableSteps" href="reusableSteps.dita"/>
</topicref>
Code: Select all
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="reusableSteps">
<title></title>
<taskbody>
<steps>
<step id="reused">
<cmd>some content here <ph keyref="variableSuffix"/></cmd>
</step>
</steps>
</taskbody>
</task>
Code: Select all
<step conkeyref="reusableSteps/reused"/>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 24
- Joined: Wed Jan 04, 2017 3:48 pm
Re: Dynamically change a chunk of content within a conref?
I tried using the key scope you suggested. Instead of each topic displaying the keyword defined in its corresponding <topicref> element, all of the topics display the key word that was defined in the first <topicref> element.
Here is the example you provided for the map. I expanded this example by adding two additional <topicref> elements.
When I run the transformation scenario, the conkeyrefs in all three topics use the keyword prefix1, which is the keyword defined in the <topicref> element for the first topic. I was hoping to see prefix2 used in the conkeyref in topic2 and prefix3 used in the conkeyref in topic3.
I used the same @keyscope value in all three <topicref> elements. I also used the same @keys value in the <keydef> element containing the keyword.
Let me know if you have any thoughs.
Here is the example you provided for the map. I expanded this example by adding two additional <topicref> elements.
Code: Select all
<topicref href="myTask1.dita" keyscope="ks">
<keydef keys="variableSuffix">
<topicmeta>
<keywords>
<keyword>prefix1</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="reusableSteps" href="reusableSteps.dita"/>
</topicref>
<topicref href="myTask2.dita" keyscope="ks">
<keydef keys="variableSuffix">
<topicmeta>
<keywords>
<keyword>prefix2</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="reusableSteps" href="reusableSteps.dita"/>
</topicref>
<topicref href="myTask3.dita" keyscope="ks">
<keydef keys="variableSuffix">
<topicmeta>
<keywords>
<keyword>prefix3</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="reusableSteps" href="reusableSteps.dita"/>
</topicref>
I used the same @keyscope value in all three <topicref> elements. I also used the same @keys value in the <keydef> element containing the keyword.
Let me know if you have any thoughs.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Dynamically change a chunk of content within a conref?
Hi,
If that does not work, maybe you can zip a small example and send it to us (support@oxygenxml.com) and I can try to take a look at it.
https://www.oxygenxml.com/dita/1.3/spec ... copes.html
Radu
You should try to use a different key scope value for each of these topicrefs, something like ks1, ks2, ks3. Otherwise the behavior will be as if all three are from the same key scope "ks" and the conkeyref will resolve to a single target in a key scope context.I used the same @keyscope value in all three <topicref> elements.
If that does not work, maybe you can zip a small example and send it to us (support@oxygenxml.com) and I can try to take a look at it.
https://www.oxygenxml.com/dita/1.3/spec ... copes.html
Regards,Key references in each key scope are resolved using the effective key definition that is specified within its own key scope.
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 24
- Joined: Wed Jan 04, 2017 3:48 pm
Re: Dynamically change a chunk of content within a conref?
Using a unique @keyscope attribute value for each <topicref> element resolved the issue. I expanded by test by defining a second keyword (in a second <keydef> element within each key scope. That enabled be to substitute a second keyword in a different conkeyref within each topic. Thank you for your help Radu.
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service