The conrefend attribute is used when referencing a range of elements with the conref mechanism. The conref or conkeyref attribute points to the first element in the range, while conrefend points to the last element in the range. Although the start and end elements must be of the same type as the referencing element (or specialized from that element), the intermediary, contiguous nodes in the middle of the range do not have to be the same.
Several items must be taken into account when using or implementing conrefend.
Figure 3-65 List example: Source topic.dita with ids
<topic id="x"> ... <body> <ol> <li id="apple">A</li> <li id="bear">B</li> <li id="cat">C</li> <li id="dog">D</li> <li id="eel">E</li> </ol> </body> </topic>
Figure 3-66 List example: Reusing topic with conrefs
<topic id="y"> ... <body> <ol> <li>My own first item</li> <li conref="topic.dita#x/bear" conrefend="topic.dita#x/dog"/> <li>And a different final item</li> </ol> </body> </topic>
Figure 3-67 List example: Processed result of reusing topic
<topic id="y"> ... <body> <ol> <li>My own first item</li> <li>B</li> <li id="cat">C</li> <li>D</li> <li>And a different final item</li> </ol> </body> </topic>
Figure 3-68 Block level example: Source topic.dita with ids
<topic id="x">
...
<body>
<p id="p1">First para</p>
<ol id="mylist">
<li id="apple">A</li>
<li id="bear">B</li>
<li id="cat">C</li>
<li id="dog">D</li>
<li id="eel">E</li>
</ol>
<p id="p2">Second para</p>
</body>
</topic>
Figure 3-69 Block level example: Reusing topic with conrefs
<topic id="y"> ... <body> <p conref="topic.dita#x/p1" conrefend="topic.dita#x/p2"/> </body> </topic>
Figure 3-70 Block level example: Processed result of reusing topic
<topic id="y">
...
<body>
<p>First para</p>
<ol id="mylist">
<li id="apple">A</li>
<li id="bear">B</li>
<li id="cat">C</li>
<li id="dog">D</li>
<li id="eel">E</li>
</ol>
<p>Second para</p>
</body>
</topic>
When the conkeyref attribute is used in place of conref, a key is used to address the target of the reference. The conrefend attribute, which indicates the end of a conref range, may not use a key. Instead the the map or topic element addressed by the key name component of the conkeyref is used in place of whatever map or topic element is addressed by the conrefend attribute.
For example, if the value of the conkeyref attribute is "config/step1" and the value of the conrefend is "defaultconfig.dita#config/laststep", the conref range will end with the step that has id="laststep" in whatever topic is addressed by the key name "config". If the key name "config" is not defined, and the conref attribute itself is not present for fallback, the conrefend attribute is ignored.
Figure 3-71 Defining and referencing a key with conkeyref
In this example the key "xmp" is defined as the first topic in the file examples.dita.
<map>
<!-- ... -->
<keydef keys="xmp" href="examples.dita"/>
<!-- ... -->
</map>
examples.dita:
<topic id="examples">
<title>These are examples</title>
<body>
<ul>
<li id="first">A first example</li>
<li>Another trivial example</li>
<li id="last">Final example</li>
</ul>
</body>
</topic>
To reuse these list items by using the key, the conkeyref attribute combines the key itself with the sub-topic id (first) to define the start of the range. The conrefend attribute defines a default high-level object along with the sub-topic id (last) that ends the range:
<li conkeyref="xmp/first"
conrefend="default.dita#default/last"/>
The conkeyref attribute uses a key to reference the first topic in examples.dita, so the range begins with the object examples.dita#examples/first. The high-level object in the conrefend attribute (default.dita#default) is replaced with the object represented by the key (the first topic in examples.dita), resulting in a range that ends with the object examples.dita#examples/last.
Figure 3-72 Combining conref, conkeyref, and conrefend
When conref, conkeyref, and conrefend are all specified, the key value takes priority.
<li conkeyref="thisconfig/start"
conref="standardconfig.dita#config/start"
conrefend="standardconfig.dita#config/end"/>
When encountering an error condition, an implementation may but need not issue an error message.