Internal references

Regarding printed documents we may define two categories of document internal references:

Page number references

This is the classical type of a reference e.g. in books. An author refers the reader to a distant location by writing ... see further explanation in section 4.5 on page 234. A book's table of contents assigning page numbers to topics is another example. This way the implementation of a reference relies solely on the features a printed document offers.

Hypertext references

This way of implementing references utilizes features of (online) viewers for printable documents. For example PDF viewers like Adobe's Acrobat reader or the evince application are able to follow hypertext links in a fashion known from HTML browsers. This browser feature is based on hypertext capabilities defined in the Adobe's PDF de-facto standard.

Of course the second type of references is limited to people who use an online viewer application instead of reading a document from physical paper.

We now show the implementation of FO based page references. As already being discussed for ID / IDREF pairs we need a link destination (anchor) and a link source. The FO standard uses the same anchor implementation as in XML for ID typed attributes: FO objects may have an attribute id with a document wide unique value. The FO element fo:page-number-citation is used to actually create a page reference via its attribute ref-id:

Figure 988. Two blocks mutual page referencing each other. Create comment in forum

(Animated PDF Version)

...
  <fo:flow flow-name='xsl-region-body'>
    <fo:block id='xml'>Java section see page
      <fo:page-number-citation ref-id='java'/>.
    </fo:block>

    <fo:block id='java'>XML section see page
      <fo:page-number-citation ref-id='xml'/>.
    </fo:block>
  </fo:flow> ...
Two blocks mutual page referencing each other.

NB: Be careful defining id attributes for objects being descendants of fo:static-content nodes. Such objects typically appear on multiple pages and are therefore no unique anchors. A reference carrying such an id value thus actually refers to 1 <= n values on n different pages. Typically a user agent will choose the first object of this set when clicking the link. So in effect the parent fo:page-sequence is chosen as the effective link target.

The element fo:basic-link creates PDF hypertext links. We extend the previous example:

Figure 989. Two blocks with mutual page- and hypertext references. Create comment in forum

(Animated PDF Version)

<fo:flow flow-name='xsl-region-body'>
  <fo:block id='xml'>Java section see <fo:basic-link color="blue"
    internal-destination="java">page<fo:page-number-citation
   ref-id='java'/>.</fo:basic-link></fo:block>

<fo:block id='java'>XML section see
  <fo:basic-link color="blue"
    internal-destination="xml">page <fo:page-number-citation
     ref-id='xml'/>.</fo:basic-link></fo:block >
</fo:flow>
Two blocks with mutual page- and hypertext references.