The conref attribute is useful for pulling content from a single element into another topic. But what if you want to pull in content from a series of elements?
To pull a sequence of two or more elements into a topic, use the conrefend attribute in combination with the conref attribute. The two attributes specify the starting and ending elements in a sequence of elements. The starting element, the ending element, and all elements in between are pulled into the referencing topic.
For example, you might have a warehouse topic (named wh.dita) that contains this <ul> element:
<concept id="wh_elements"> ... <ul> <li id="food_insects">small insects</li> <li id="food_fish">small fish and fish eggs</li> <li id="food_crustaceans">crustaceans</li> <li id="food_snails">snails and mollusks</li> <li id="food_frogs">frogs and salamanders</li> <li id="food_fruit">berries and nuts</li> </ul> </concept>
To pull the four list items from “fish” through “frogs” into a list in another topic, use this conref and conrefend combination:
<ul> <li>cracked corn</li> <li conref="wh.dita#wh_elements/food_fish" conrefend="wh.dita#wh_elements/food_frogs"/> ... </ul>
If you use conrefend, keep in mind that:
- Both of the elements identified by the conref and conrefend attributes must be the same element name as the referencing element. For instance, if the referencing element is a <p> element, the elements indicated by the conref and conrefend attributes must also be <p> elements.
- The elements that occur between the elements indicated by the conref and conrefend attribute do not have to be the same type. For example, if the conref and conrefend attributes indicate <p> (paragraph) elements, and if there are non-<p> elements (such as <note> or <image>) between the conref and conrefend <p> elements, those elements will also be included in the content reference.
You can also use conrefend with conkeyrefs. If conrefend is combined with a conkeyref, the filename in the conrefend attribute is ignored and is replaced with the filename used by the key specified in the conkeyref.
Note: Not all CCMSs support the conrefend attribute. Test or check with your vendor before using this attribute.