Easy content inclusion

The conref attribute of an element allows to reference the contents (text, child elements, some of the attributes) of another element.

Instead of just seeing an empty element having a conref attribute (that is, the ``pointer''), it is nicer to see the referenced contents. This process is called transclusion and XMLmind XML Editor can do it for you.

Note: Everything explained here should also work for DITA maps.
Note: The following procedure (Copy as Reference then Paste) is not specific to DITA. The same procedure could be used to add references to DocBook or XHTML documents. This is why it is explained in great details in our tutorial.
  1. Open in XMLmind XML Editor the topic containing the element you want to reference.
  2. Select this element. Let's call this element the conref source.
  3. If this element has no id attribute, specify one using the Attributes tool.
  4. Press Ctrl+Shift-C ( Edit > Reference > Copy as Reference ). You'll see the name of the element copied as reference displayed in dimmed blue at the bottom right of XMLmind XML Editor main window.
  5. Switch to the topic where you want to create the reference.
  6. Use Ctr-U ( Edit > Paste Before ), Ctrl-V ( Edit > Paste ) or Ctrl-W ( Edit > Paste After ) to paste a reference to the conref source. Let's call this pasted reference the conref target.
  7. Sometimes, you'll want to add attributes which are specific to the conref target (typically an id attribute). In such case:
    1. Select the conref target.
    2. Use Edit > Reference > Untransclude to un-transclude the conref target. You'll see an element having the same name as the conref source but having no content and having a conref attribute pointing the conref source.
    3. Use the Attributes tool to specify one or more attributes.
    4. Use Edit > Reference > Retransclude to re-transclude the conref target.
Related tasks
Content inclusion: an alternative, low-level, method