Skip to content

Cross References

Any block element can be given a unique id. This can be used to access information about the element, via

  1. <ref target="..." /., and
  2. <page-number target="..." /> Both of which take an element's id as their target attribute.

Elements can also be grouped into a collection, using the optional outline attribute

ref

<ref /> is an inline tag which displays the position of the given element within its collection.

For example,

xml
<press>
    <flows>
        <frame id="my-figure" outline="figures">
            <img src="..." />
            
            <p>My Figure</p>
        </frame>
        
        ...
        
        <p>See figure <ref target="my-figure" /> for more information</p>
        
        ...
    </flows>
</press>

Here, the paragraph will display as "See figure 1 for more information." This is because "my-figure" is the first entry in the "figures" collection.

A <ref /> tag will also form a link to the targeted element. i.e. clicking on the<ref /> in the final document will move you to the entry it references.

page-number

<page-number /> is an inline tag which displays the page number of a given element.

For example,

xml
<p>
    See the figure on page <page-number target="my-figure" />.
</p>

Similarly to <ref />, <page-number /> also forms a link to the targeted element.

However unlike <ref />, the target attribute in a page-number tag is actually optional. If it's skipped then the tag evaluates to the current page number.