![]() |
| Previous Top Next |
Defining Hyperlinks |
Hyperlinks can be created around SPS components such as text or images. The targets of hyperlinks can be: (i) bookmarks in the SPS design, and (ii) external resources, such as web pages or email messages. In this section, we first discuss link content and then the targets of links.
Creating hyperlinks
A hyperlink can be created around text (static or dynamic), nodes, images, conditional templates, Auto-Calculations, and blocks of content or nodes; it cannot be created around a data-entry device such as an input field or combo box—though it can be created around a node or conditional template in which that data-entry device is.
To create a hyperlink select the required component in the design, then click the menu command Insert | Hyperlink, or right-click and select Insert | Hyperlink, or use the shortcut Ctrl+L. This pops up the Insert Hyperlink dialog (screenshot below), in which you specify the target of the link.

The target of a link can be either:
| • | A bookmark in the same SPS design (in which case the URI is a fragment identifier), or |
| • | An external resource; the URI can be static (directly entered), dynamic (taken from a node in an XML document), a combination of static and dynamic parts, or the value of an unparsed entity. |
How these two kinds of targets are defined is explained below. After the URI has been defined in the Insert/Edit Hyperlink dialog, click OK to finish.
To link to a bookmark, do the following:
| 1. | In the Static tab of the Insert Hyperlink dialog, click the Bookmark button. This pops up the Select Place in Document dialog (screenshot below). |

| 2. | This dialog lists all the bookmarks defined in the SPS. Select the bookmark you wish to target, and click OK. The bookmark is entered as a fragment identifier in the URI input field. |
When the XML document is transformed with an XSLT stylesheet the fragment identifier will be the target of the hyperlink in the output document.
URIs that locate external resources can be built in the following ways:
| • | By entering the URI directly in the Static tab of the Insert Hyperlink dialog. For example, a link to the Altova home page (http://www.altova.com) can be entered directly in the Address input field of the Static tab. |
| • | By selecting a node in the XML document source in the Dynamic tab of the Insert Hyperlink dialog. The node in the XML source can provide a text string that is either: (i) the URI to be targeted, or (ii) the name of an unparsed entity which has the required URI as its value. For example, the Altova website address can be contained as a text string in a node. |
| • | By building a URI that has both static and dynamic parts in the Static and Dynamic tab of the Insert Hyperlink dialog. This can be useful for adding static prefixes (e.g. a protocol) or suffixes (e.g. a domain name). For example, email addresses can be created using a static part of mailto: and a dynamic part that takes the string content of the //Contact/@email node (screenshot below). |

How to use unparsed entities is described in the section Unparsed Entity URIs.
Editing hyperlink properties
To edit a hyperlink, right-click either the start or end hyperlink (A) tag, and select Hyperlink Properties from the context menu. This pops up the Edit Hyperlink dialog (screenshot above). The Edit Hyperlink dialog can also be accessed via the URL property of the link group of properties in the Properties window. The link group of properties also includes the bookmark name property, which specifies the name of a bookmark in the document that can the target of the link. The Properties window thus provides access to the targets of the hyperlink, enabling these to be edited.
After a link has been created, it can be followed in Design View by pressing Ctrl and clicking the link.
Removing and deleting hyperlinks
A hyperlink is an SPS component (for example, a text string or image), which links to a document fragment or other resource, via a URI. When the target URI is cleared, the hyperlink is said to be removed; the SPS component however remains in the design document. On the other hand, when a hyperlink is deleted, the SPS component is deleted from the design document. These two actions are carried out as follows:
| • | To remove a hyperlink, right-click the hyperlink and, in the Edit Hyperlink dialog (screenshot above), press the Remove Link button. The target URI is cleared. |
| • | To delete a hyperlink, select the hyperlink (by clicking either the start or end hyperlink (A) tag), and press the Delete key. The hyperlink and its contents are deleted. |
See also:
Inserting Bookmarks, for a description of how to use bookmarks in the design.
Unparsed Entity URIs, for a complete description of how to use unparsed entity URIs in an SPS.
Insert | Hyperlink, for more about inserting hyperlinks.
|