Home Up Next Previous

Chapter 5. Extended Links

XLink extended links, like annotations, can be non-local. The more interesting feature is that unlike HTML anchors, they can also have multiple endpoints. Consider the following link: ⌖5

1<phrase xmlns:xlink="http://www.w3.org/1999/xlink"
        xlink:type="extended">
  <link xlink:title="DocBook.org"
        xlink:label="target"
5        xlink:href="http://docbook.org/"
        xlink:type="locator"/>
  <link xlink:title="DocBook on Wikipedia"
        xlink:label="target"
        xlink:href="http://en.wikipedia.org/wiki/DocBook"
10        xlink:type="locator"/>
  <citetitle xlink:label="source" xlink:type="resource"
  >DocBook</citetitle>
  <link xlink:to="target" xlink:from="source" xlink:type="arc"/>
</phrase>

With JavaScript enabled, this link to DocBook▶ [DocBook.org, DocBook on Wikipedia] has a popup menu to select the link target. Rendered without JavaScript, the link choices are presented as alternatives after the link.

Annotations
╳
⌖5 Simplifying link markup

It’s worth noting that although the XLink vocabulary is defined purely in terms of attributes so that it can more easily be embedded in other vocabularies, there’s no reason a DocBook customization couldn’t use simplified markup to identify links:

<extended-link>
  <target title="DocBook.org" href="http://docbook.org/"/>
  <target title="DocBook on Wikipedia"
          href="http://en.wikipedia.org/wiki/DocBook"/>
  <citetitle>DocBook</citetitle>
</extended-link>

In this example, I’ve adopted the convention that an extended-link element identifies an extended link with the semantic that target element(s) identify the link target and any other element identifies the source.

This is equivalent to the attribute form and could easily be translated into it.

PreviousUpNext
Chapter 4. AnnotationsHomeAppendix A. Paged media support
[toc]
Table of Contents╳
  • Chapter 1. Clean Look and Feel
  • Chapter 2. Persistent ToC
  • Chapter 3. Callouts
  • Chapter 4. Annotations
  • Chapter 5. Extended Links
  • Appendix A. Paged media support
  • References