Cross-referencing figures
Cross-references to figures are accomplished with the xref element with a type attribute of fig.
When referring a reader to a figure (an image or illustration), you should not hard-code the figure number. In most editing environments, you won't know what the sequential figure number will be until the ditamap is processed to a deliverable document.
You must always use the xref element to cross-reference figures, with the type attribute set to fig.
Cross-references to figures will typically be rendered as the local
language word for
Figure
, followed by the figure's sequential number in the topic
(for hypertext outputs) or in the publication (for page layout documents).
Because the figure number is not hard-coded, it will be recalculated each time
the ditamap containing the topic is processed.
fig_ej25_enginein the same topic is:
<xref href="#concept_ej25/fig_sample_darwin" type="fig"/>
You cannot cross-reference images, so if cross-references are important for your document, use figures rather than simple images. You should include a title element in all figure elements, as the title is used in the generation of cross-reference text in some publishing processes.