• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Learning DITA

Free DITA training

Free DITA training

  • Log in
  • Register
  • Newsletter
  • Profile
  • Privacy
  • Home
  • About
  • Courses
  • News
  • Resources
  • Support the site
  • Contact
  • Recordings

Conrefend

Posted on 12.02.16

Advanced reuse in DITA Lesson 3: Advanced conrefs Conrefend
Lesson Progress
0% Complete

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.

Contributors
  • Simon Bate
  • Jake Campbell
  • Gretyl Kinsey
Previous Topic
Back to Lesson
Next Topic

sidebar

Blog Sidebar

  • Scriptorium logo
    Maximize the value of your content. Read more.
  • Scriptorium logo
    Need DITA help? We offer flat-rate consulting. Get help.
  • Scriptorium logo
    Already in DITA and need support? Contact us.
RSSTwitter

Want to add content? Join the ditatraining GitHub repository.

  • Home
  • Sponsor
  • News
  • Contact
  • Privacy

Maintained by Scriptorium Publishing

Logo and site presentation © 2015-2021 Scriptorium Publishing. Content based on the open-source DITA training project.