### 6.6 Specifying formats for cross references

Cross references (empty xref elements) need different output formats depending on the type of element referenced. Numbered elements, such as list items and footnotes, need the number included in cross references to those elements; headings typically need the title included in the cross reference.

If the <xref> elements in your document include an outputclass attribute, you can map outputclass values to formats; see §6.3.3 Mapping cross-reference outputclass attributes to formats.

If there is no outputclass attribute, DITA2Go uses the xref property of the element to which the cross reference refers (see §7.6.5 Specifying block properties for paragraph formats). Failing that, DITA2Go assigns a default cross-reference format based on the xref element type attribute:

NumXref | for li (default format = <numonly/>)
FtnXref | for fn (default format = <sup><numonly/>)
TextXref | for other (default format = <paratext/>)
TitleXref | for the rest (default format= <autonum/> <paratext/>)

To specify a cross-reference format name for each type of cross reference:

    [ElementOptions]
    ; XrefTextFormat = name for xrefs to text elements
    XrefTextFormat = TextXref
    ; XrefTitleFormat = name for xrefs to elements with titles
    XrefTitleFormat = TitleXref
    ; XrefNumFormat = name for xrefs to li elements
    XrefNumFormat = NumXref
    ; XrefFtnFormat = name for xrefs to footnotes,
    XrefFtnFormat = FtnXref
    ; GenListXrefFormat = name for xrefs used in generated list items
    GenListXrefFormat = TitleXref

These are the default names for cross-reference formats. You can specify different names; however, if you do, you must change the default names wherever they occur, notably in subformats configuration templates; see §8.1.1 Understanding where to define subformats.

To configure the formats for each of these cross-reference types, see §8.7 Defining cross-reference output formats.

Previous Topic: 6.5.8 Understanding default attribute-based prefixes and headings

Next Topic: 6.7 Specifying formats for footnotes

Parent Topic: 6. Mapping elements to output formats

Sibling Topics:

6.1 Understanding how to assign formats

6.2 Specifying options for naming formats

6.3 Mapping outputclass attribute values to formats

6.4 Mapping element paths to output formats

6.5 Mapping element attributes to output formats

6.7 Specifying formats for footnotes

6.8 Specifying options for figures

6.9 Specifying formats and options for tables

6.10 Specifying options for special lists

6.11 Specifying options for draft comments

6.12 Specifying options for maps

6.13 Deciding where to display title and shortdesc