| DocBook: The Definitive Guide Version 2.0.7 (Alpha)

# link

$Revision: 1.4 $

$Date: 2002/06/12 11:18:17 $

link — A hypertext link

## Synopsis

### Mixed Content Model

    link ::=
    (#PCDATA|footnoteref|xref|abbrev|acronym|citation|citerefentry|
     citetitle|emphasis|firstterm|foreignphrase|glossterm|footnote|
     phrase|quote|trademark|wordasword|personname|link|olink|ulink|
     action|application|classname|methodname|interfacename|
     exceptionname|ooclass|oointerface|ooexception|command|
     computeroutput|database|email|envar|errorcode|errorname|
     errortype|errortext|filename|function|guibutton|guiicon|guilabel|
     guimenu|guimenuitem|guisubmenu|hardware|interface|keycap|keycode|
     keycombo|keysym|literal|constant|markup|medialabel|menuchoice|
     mousebutton|option|optional|parameter|prompt|property|
     replaceable|returnvalue|sgmltag|structfield|structname|symbol|
     systemitem|token|type|userinput|varname|nonterminal|anchor|
     author|authorinitials|corpauthor|modespec|othercredit|
     productname|productnumber|revhistory|remark|subscript|
     superscript|inlinegraphic|inlinemediaobject|inlineequation|
     synopsis|cmdsynopsis|funcsynopsis|classsynopsis|fieldsynopsis|
     constructorsynopsis|destructorsynopsis|methodsynopsis|indexterm|
     beginpage)*

### Attributes

Common attributes

Name | Type | Default
linkend | IDREF | Required
endterm | IDREF | None
type | CDATA | None

## Description

`Link` is a general purpose hypertext element. Usually, `Link` surrounds the text that should be made “hot,” (unlike `XRef` which must generate the text) but the `EndTerm` attribute can be used to copy text from another element.

### Processing expectations

Formatted inline.

If the `Link` element has content, then that content is processed for output as the “hot” text. If the `Link` element has content and an `EndTerm` attribute, then the content is used and the `EndTerm` is ignored. If the `Link` element has an `EndTerm` attribute and no content, then the content of the element pointed to by `EndTerm` should be repeated at the location of the `Link` and used as the “hot” text.

Linking elements must not be nested within other linking elements (including themselves). Because DocBook is harmonizing towards XML, this restriction cannot easily be enforced by the DTD. The processing of nested linking elements is undefined.

### Future Changes

The `InterfaceDefinition` element will be discarded in DocBook V4.0. It will no longer be available in the content model of this element.

### Parents

These elements contain link: `abbrev`, `ackno`, `acronym`, `action`, `application`, `artpagenums`, `attribution`, `authorinitials`, `bibliocoverage`, `biblioid`, `bibliomisc`, `bibliorelation`, `bibliosource`, `bridgehead`, `citation`, `citebiblioid`, `citetitle`, `city`, `classsynopsisinfo`, `collabname`, `command`, `computeroutput`, `confdates`, `confnum`, `confsponsor`, `conftitle`, `contractnum`, `contractsponsor`, `contrib`, `corpauthor`, `corpname`, `country`, `database`, `date`, `edition`, `email`, `emphasis`, `entry`, `fax`, `figure`, `filename`, `firstname`, `firstterm`, `foreignphrase`, `funcparams`, `funcsynopsisinfo`, `function`, `glosssee`, `glossseealso`, `glossterm`, `hardware`, `holder`, `honorific`, `indexdiv`, `informalfigure`, `interfacename`, `invpartnumber`, `isbn`, `issn`, `issuenum`, `jobtitle`, `keycap`, `label`, `lineage`, `lineannotation`, `link`, `literal`, `literallayout`, `lotentry`, `manvolnum`, `member`, `modespec`, `msgaud`, `olink`, `option`, `optional`, `orgdiv`, `orgname`, `otheraddr`, `othername`, `pagenums`, `para`, `parameter`, `phone`, `phrase`, `pob`, `postcode`, `primary`, `primaryie`, `productname`, `productnumber`, `programlisting`, `property`, `pubdate`, `publishername`, `pubsnumber`, `quote`, `refentry`, `refentrytitle`, `refmiscinfo`, `refnamediv`, `refpurpose`, `releaseinfo`, `remark`, `replaceable`, `revnumber`, `revremark`, `screen`, `screeninfo`, `secondary`, `secondaryie`, `see`, `seealso`, `seealsoie`, `seeie`, `seg`, `segtitle`, `seriesvolnums`, `shortaffil`, `simpara`, `state`, `street`, `subscript`, `subtitle`, `superscript`, `surname`, `synopsis`, `systemitem`, `term`, `tertiary`, `tertiaryie`, `title`, `titleabbrev`, `tocback`, `tocentry`, `tocfront`, `trademark`, `ulink`, `userinput`, `volumenum`, `wordasword`, `year`.

### Children

The following elements occur in link: `abbrev`, `acronym`, `action`, `anchor`, `application`, `author`, `authorinitials`, `beginpage`, `citation`, `citerefentry`, `citetitle`, `classname`, `classsynopsis`, `cmdsynopsis`, `command`, `computeroutput`, `constant`, `constructorsynopsis`, `corpauthor`, `database`, `destructorsynopsis`, `email`, `emphasis`, `envar`, `errorcode`, `errorname`, `errortext`, `errortype`, `exceptionname`, `fieldsynopsis`, `filename`, `firstterm`, `footnote`, `footnoteref`, `foreignphrase`, `funcsynopsis`, `function`, `glossterm`, `guibutton`, `guiicon`, `guilabel`, `guimenu`, `guimenuitem`, `guisubmenu`, `hardware`, `indexterm`, `inlineequation`, `inlinegraphic`, `inlinemediaobject`, `interface`, `interfacename`, `keycap`, `keycode`, `keycombo`, `keysym`, `link`, `literal`, `markup`, `medialabel`, `menuchoice`, `methodname`, `methodsynopsis`, `modespec`, `mousebutton`, `nonterminal`, `olink`, `ooclass`, `ooexception`, `oointerface`, `option`, `optional`, `othercredit`, `parameter`, `personname`, `phrase`, `productname`, `productnumber`, `prompt`, `property`, `quote`, `remark`, `replaceable`, `returnvalue`, `revhistory`, `sgmltag`, `structfield`, `structname`, `subscript`, `superscript`, `symbol`, `synopsis`, `systemitem`, `token`, `trademark`, `type`, `ulink`, `userinput`, `varname`, `wordasword`, `xref`.

## Attributes

endterm

  `Endterm` points to the element whose content is to be used as the text of the link. If `Endterm` is supplied on a `Link` which has content, the value of `Endterm` should be ignored.

linkend

  `Linkend` points to the target of the link.

type

  `Type` is available for application-specific customization of the linking behavior.

## See Also

`anchor`, `olink`, `ulink`, `xref`.

## Examples

    <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
              "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
    <sect1><title>Examples of <sgmltag>Link</sgmltag></title>

    <para>
    In this sentence <link linkend='nextsect'>this</link> word is
    hot and points to the following section.
    </para>

    <para>
    There is also a link to the section called
    <quote><link linkend='nextsect' endterm="nextsect.title"/></quote>
    in this sentence.
    </para>

    <sect2 id='nextsect'><title id='nextsect.title'>A Subsection</title>

    <para>
    This section only exists to be the target of a couple of links.
    </para>

    </sect2>
    </sect1>

lineannotation |  | listitem

Copyright © 1999, 2000, 2001, 2002 O'Reilly & Associates, Inc. All rights reserved.