Content Reference Push (conref push)

The content reference push mechanism is the opposite of a content reference.

Sample project: conrefpush.zip



Note: The content reference push can be helpful for filling a multiple referenced technical data topic with technical data from different products.

map.ditamap

The map.ditamap references the conrefpush-source.dita topic that itself pushes content into the conrefpush-target.dita topic. The conrefpush-source.dita topic is not rendered int the output.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
  <title>conrefpush</title>
  <topicref href="conrefpush-source.dita" processing-role="resource-only" toc="no"/>
  <topicref href="conrefpush-target.dita" keys="conrefpush-target"/>
</map>

conrefpush-source.dita

The conrefpush-source.dita topic contains a <p> element, that replaces the <p> element with the @id replace-me in the conrefpush-target.dita topic.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="conrefpush-source">
  <title>source</title>
  <body>
    <!--
      The following <p> element replaces the <p> element
      with the @id="replace-me" in the conrefpush-target.dita topic.
    -->
    <p conaction="pushreplace" conkeyref="conrefpush-target/replace-me">
      NEW CONTENT :)
    </p>
  </body>
</topic>

conrefpush-target.dita

The conrefpush-target.dita topic contains a <p> element with the @id replace-me, that is replaced with the pushed <p> element of the conrefpush-source.dita topic.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="conrefpush-target">
  <title>target</title>
  <body>
    <p>The following paragraph should be replaced</p>
    <p id="replace-me">REPLACE ME</p>
  </body>
</topic>