Tracker: RFEs

5 define an xlink:role for olinking - ID: 1673820
Last Update: Comment added ( nwalsh )

Currently the DocBook 5 schema supports universal linking using the xlink:href attribute on most elements. When the value of the attribute is a fragment identifier such as "#intro", it references a target in the same document, in a manner similar to the link element. When the value of the attribute is a URL, it references an arbitrary web link, and replaces the ulink element from DocBook 4. These features permit almost any element to serve the same purpose as a link or ulink in DocBook 4.

However, there is currently no way to make an arbitrary element into an olink. An olink reference in DocBook 4 has a targetdoc attribute to identify another document, and a targetptr attribute to identify an internal id target within that document. But a targetdoc attribute in an olink is not handled as a URL, but as a unique document identifier that is resolved by the application at run time. If you try to combine the targetdoc and targetptr attributes in an xlink:href using fragment identifier syntax such as xlink:href="userguide#intro", then it will be misinterpreted as a URL and fragment identifier.

However, the XLink Recommendation also permits assigned an xlink:role attribute, and this could be used to identify a xlink as being an olink.

The xlink:role attribute can be added to "simple" XLinks, which are the type of XLinks used in DocBook 5. Also, xlink:role is already permitted in DocBook 5 wherever xlink:href is permitted. The XLink Recommendation says that an xlink:role attribute value should be a URL that identifies the semantic meaning of the link. Such an attribute can be used to distinguish an olink from a ulink (using DocBook 4 terms).

Since these attributes are already permitted, no changes to the DocBook 5 schema are needed. However, the xlink:role URL for the olink semantic should be defined by the DocBook Technical Committee. Something like:

xlink:role="http://docbook.org/xlink/olink"

This naming scheme is similar to that used for the DocBook 5 namespace "http://docbook.org/ns/docbook". It allows for other semantic roles for XLinks in DocBook to be defined.

An application can then use this role value to properly handle the xlink:href as an olink. For example, if an application designates a targetdoc value of "reference" to contain reference pages, then
the following olink containing a command element:

<olink targetdoc="reference" targetptr="more.1"><command>more</command></olink>

can be replaced by a direct olink:

<command xlink:href="reference#more.1" xlink:role="http://docbook.org/xlink/olink">more</command>

An application would know from the xlink:role attribute that it should treat the first part of the xlink:href as the olink targetdoc, and the fragment identifier as the targetptr.



Robert Stayton ( bobstayton ) - 2007-03-04 23:32:23 PST

5

Closed

Fixed

Norman Walsh

DocBook XML

v5.0

Public


Comment ( 1 )

Date: 2007-03-23 06:26:35 PDT
Sender: nwalshProject Admin


Adopted by the TC at the 21 Mar 2007 telcon and "fixed" in 5.0CR3


Attached File

No Files Currently Attached

Changes ( 3 )

Field Old Value Date By
status_id Open 2007-03-23 06:26:35 PDT nwalsh
resolution_id None 2007-03-23 06:26:35 PDT nwalsh
close_date - 2007-03-23 06:26:35 PDT nwalsh