Using Xrefs

If you are using the Xref file for a single purpose (such as creating a list of figures) the simplest approach is to include it at the appropriate place by inserting a <readgen/> command and add appropriate mappings to format the content.

If, however, you wish to use the Xref file for multiple purposes it is probably more convenient to process it as an XML fragment. This involves:

  • Creating a mapping for tl:xref that scans and suppresses its content and assigns it to an appropriate variable:

    <set var="XrefData" copy="element"/>
  • Using the <xmlproc/> command to extract the required data at the appropriate place.

The DITA/book stylesheet included in the demonstrations has examples of this technique. See the %AddPage and figurelist mappings, for example.