Using conkeyref-push to replace one topic with another at the map level
According to the DITA spec at
a conref/conkeyref can target:
We have a need to replace a boilerplate topic in a reused map with a product-specific topic. I created the following test map (topics 1-3 would actually be in the reused map):
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="urn:oasis:names:tc:dita:rng:map.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<topicref href="topic_2_replacement.dita" processing-role="resource-only"
conkeyref="topic_2" conaction="pushreplace" />
<topicref href="topic_1.dita" keys="topic_1"/>
<topicref href="topic_2.dita" keys="topic_2"/>
<topicref href="topic_3.dita" keys="topic_3"/>
but the DITA-OT issues the following error:
[conref-push] [DOTJ041E][ERROR] The attribute conref="topic_2.dita" uses invalid syntax. The value should contain '#' followed by a topic or map ID, optionally followed by '/elemID' for a sub-topic element.
It doesn't seem to want to operate on an entire topic. I was able to approximate the behavior by moving the pushes into the replacement topic <title> and <body> elements, but this is fragile and awkward.
Are entire-topic (and entire-map) operations not supported after all? Thanks in advance for any help!
This looks like a bug to me.
How about if you explicitly specify the topic ID when definining
the "topic_2" key?
<topicref href="topic_2.dita#topicID" keys="topic_2"/>
Radu Coravu Oxygen XML Editor
On 2/25/21 19:16, Chris Papademetrious wrote:
Julio J Vazquez
I think Radu's syntax is the most correct, but more correct would be to use and use key#topicid.
Julio J. Vazquez
Hi Julio, Radu,
Thanks for giving this some thought. This produced a different error:
[conref-push] [DOTJ043W][WARN] The conref push function is trying to replace an element that does not exist (element "#id3" in file "/tmp/temp20210226091132575/topic_3.dita").
so I filed a DITA-OT issue to reconcile the functionality against the spec:
Map-level conkeyref-push of a topic does not work #3711
Testcase provided with the issue, if you'd like to poke at it!