DAISY—Structure Guidelines: Elements, Inline Elements, Information Object Anchor

DAISY—Structure Guidelines: Elements, Inline Elements, Information Object Anchor

Information Object

Anchor

Definition

An anchor points to another place within the document (as identified by an ID attribute), another document, or a specific point in another document. A link is made up of a pair of anchors, with one being the source anchor, and the other being the destination anchor.

When using an anchor to reference another location within the same document, the anchor must include a pound sign (#) followed by the name of an identifier unique in that document. When using a link to reference a location within a different document, the href attribute must include the name of an external document or file, or the name of an external file followed by a pound sign (#) followed by a unique identifier in the external document. External links without the pound sign and unique identifier will open the document and position the user at the beginning.

The “external” attribute, which can hold values of “true” or the default “false,” indicates whether the external media must be rendered by an external application.

Syntax

Link Anchor:

<a href="uri">Text of reference</a>

Example 1: Internal Reference

The beginning of a recipe might be marked as follows so it could be easily referenced from other parts of the book:

<level3>

<h3><a id="red_sauce">Classic Red Sauce</a></h3>

...<

/level3>

A cross-reference to this recipe would be tagged as follows:

<p>For a simple, delicious alternative, try the <a href="#red_sauce">Classic Red Sauce</a> on page 109.</p>

Selecting the text Classic Red Sauce from the link anchor would position the user at the beginning of the heading of that recipe.

Example 2: External File Reference

Assuming that a large cookbook was published in two volumes, a reference from Volume One to Volume Two would be marked as follows:

<p>The basic recipes that every aspiring Italian cook should know will be found in <a href="italian_cooking/vol2.xml">Volume Two.</a></p>

Selecting the anchor text Volume Two would open that volume and position the user at its beginning.

Example 3: External File Reference With A Unique Identifier

Referencing a specific recipe in Volume Two, for example, Classic Red Sauce, from a point in Volume One would be marked as shown below.

<level3>

<h3><a id="red_sauce">Classic Red Sauce</a></h3>

...</level3>

The cross-reference in Volume One would be marked:

<p>See <a href="italian_cooking/vol2.xml#red_sauce">Classic Red Sauce</a> in Volume II, page 109.</p>

Selecting the anchor Classic Red Sauce will open Volume Two and position the user at the beginning of the heading of the recipe.

Example 4

This example would launch the given address in a web browser when selected:

<a href="http://www.daisy.org/" external="true">DAISY homepage</a>

Tags: DAISY