link
link — A hypertext link.
Synopsis
link ::=
- Zero or more of:
- text
- Bibliography inlines
- Error inlines
- Graphic inlines
- GUI inlines
- Indexing inlines
- Keyboard inlines
- Linking inlines
- Markup inlines
- Math inlines
- Object-oriented programming inlines
- Operating system inlines
- Product inlines
- Programming inlines
- Publishing inlines
abbrev
acronym
coref
date
emphasis
(db.emphasis)firstterm
(db._firstterm)firstterm
(db.firstterm)footnote
footnoteref
foreignphrase
(db.foreignphrase)glossterm
(db._glossterm)glossterm
(db.glossterm)phrase
(db.phrase)quote
(db.quote)revnumber
subscript
superscript
wordasword
- Technical inlines
- Ubiquitous inlines
abbrev
acronym
alt
anchor
annotation
biblioref
coref
date
emphasis
(db._emphasis)firstterm
(db._firstterm)footnote
footnoteref
foreignphrase
(db._foreignphrase)glossterm
(db._glossterm)indexterm
(db.indexterm.endofrange)indexterm
(db.indexterm.singular)indexterm
(db.indexterm.startofrange)inlinemediaobject
link
olink
phrase
(db._phrase)quote
(db._quote)remark
subscript
superscript
trademark
wordasword
xref
Attributes
Common attributes and common linking attributes.
Additional attributes:
- endterm (IDREF)
- xrefstyle
Required attributes are shown in bold.
Description
The 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.
The link
can have either a
linkend
attribute or an
xlink:href
attribute:
If it has a
linkend
attribute,link
creates an internal cross-reference analagous toxref
except that the author provides the link text.If it has an
xlink:href
attribute,link
is the equivalent of an HTML anchor (html:a href="..."
) for cross-reference with a Uniform Resource Identifier (URI).(In this form, it replaces the
ulink
element from DocBook 4.x and earlier.)
Processing expectations with linkend
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
is used as the “hot” text.
Processing expectations with xlink:href
Formatted inline.
When rendered online, it is natural to make the content of the
link
element an active link. When rendered in print media,
the URI might be ignored, printed after the text of
the link, printed as a footnote, or rendered in some other way.
When the content of the link
element is empty, the
content of the xlink:href
attribute
should be rendered as the text of the link. (In which case, naturally,
it should be rendered even in print media.)
Attributes
Common attributes and common linking attributes.
- any attribute
Any attribute in any other explicit namespace
- endterm
Points to the element whose content is to be used as the text of the link
- xrefstyle
Specifies a keyword or keywords identifying additional style information
Parents
These elements contain link
: abbrev
, accel
, acronym
, address
, application
, arg
, artpagenums
, attribution
, authorinitials
, bibliocoverage
, biblioid
, bibliomisc
, bibliomixed
, bibliomset
, bibliorelation
, bibliosource
, bridgehead
, buildtarget
, caption
(db.html.caption), citation
, citebiblioid
, citetitle
, city
, classname
, classsynopsisinfo
, code
, command
, computeroutput
, confdates
, confnum
, confsponsor
, conftitle
, constant
, contractnum
, contractsponsor
, contrib
, country
, database
, description
, edition
, email
, emphasis
(db._emphasis), emphasis
(db.emphasis), entry
, enumidentifier
, enumitemdescription
, enumname
, enumvalue
, envar
, errorcode
, errorname
, errortext
, errortype
, exceptionname
, extendedlink
, fax
, filename
, firstname
, firstterm
(db._firstterm), firstterm
(db.firstterm), foreignphrase
(db._foreignphrase), foreignphrase
(db.foreignphrase), funcdef
, funcparams
, funcsynopsisinfo
, function
, givenname
, glosssee
, glossseealso
, glossterm
(db._glossterm), glossterm
(db.glossterm), guibutton
, guiicon
, guilabel
, guimenu
, guimenuitem
, guisubmenu
, hardware
, holder
, honorific
, initializer
, interfacename
, issuenum
, jobtitle
, keycap
, keycode
, keysym
, label
, lineage
, lineannotation
, link
, literal
, literallayout
, macroname
, manvolnum
, markup
, mathphrase
, member
, meta
(db.meta.content), methodname
, modifier
, mousebutton
, msgaud
, msglevel
, msgorig
, olink
, option
, optional
, orgdiv
, orgname
, otheraddr
, othername
, package
, pagenums
, para
, paramdef
, parameter
, personname
, phone
, phrase
(db._phrase), phrase
(db.phrase), pob
, postcode
, primary
, primaryie
, productname
, productnumber
, programlisting
, prompt
, property
, publishername
, quote
(db._quote), quote
(db.quote), refdescriptor
, refentrytitle
, refmiscinfo
, refname
, refpurpose
, releaseinfo
, remark
, replaceable
, returnvalue
, revnumber
, revremark
, screen
, secondary
, secondaryie
, see
, seealso
, seealsoie
, seeie
, seg
, segtitle
, seriesvolnums
, shortaffil
, simpara
, specializedtemplate
, state
, street
, subscript
, subtitle
, superscript
, surname
, symbol
, synopsis
, synopsisinfo
, systemitem
, tag
, td
, template
, templatename
, term
, termdef
, tertiary
, tertiaryie
, th
, title
, titleabbrev
, tocentry
, token
, trademark
, type
, typedefname
, unionname
, uri
, userinput
, varname
, volumenum
, wordasword
, year
.
Children
The following elements occur in link
: text, abbrev
, accel
, acronym
, alt
, anchor
, annotation
, application
, author
, biblioref
, buildtarget
, citation
, citebiblioid
, citerefentry
, citetitle
, classname
, code
, command
, computeroutput
, constant
, coref
, database
, date
, editor
, email
, emphasis
(db._emphasis), emphasis
(db.emphasis), enumidentifier
, enumname
, enumvalue
, envar
, errorcode
, errorname
, errortext
, errortype
, exceptionname
, filename
, firstterm
(db._firstterm), firstterm
(db.firstterm), footnote
, footnoteref
, foreignphrase
(db._foreignphrase), foreignphrase
(db.foreignphrase), function
, glossterm
(db._glossterm), glossterm
(db.glossterm), guibutton
, guiicon
, guilabel
, guimenu
, guimenuitem
, guisubmenu
, hardware
, indexterm
(db.indexterm.endofrange), indexterm
(db.indexterm.singular), indexterm
(db.indexterm.startofrange), initializer
, inlineequation
, inlinemediaobject
, interfacename
, jobtitle
, keycap
, keycode
, keycombo
, keysym
, link
, literal
, macroname
, markup
, menuchoice
, methodname
, modifier
, mousebutton
, nonterminal
, olink
, ooclass
, ooexception
, oointerface
, option
, optional
, org
, orgname
, package
, parameter
, person
, personname
, phrase
(db._phrase), phrase
(db.phrase), productname
, productnumber
, prompt
, property
, quote
(db._quote), quote
(db.quote), remark
, replaceable
, returnvalue
, revnumber
, shortcut
, subscript
, superscript
, symbol
, systemitem
, tag
, templatename
, termdef
, token
, trademark
, type
, typedefname
, unionname
, uri
, userinput
, varname
, wordasword
, xref
.
See Also
Examples
1 |<article xmlns="http://docbook.org/ns/docbook"
|xmlns:xlink="http://www.w3.org/1999/xlink">
|<title>Example links</title>
|5 |
<para>In this sentence, <link linkend='nextsect'>this</link>
|word is hot and points to the following section.
|</para>
||
<para>In this sentence, the hot text of the link,
10 |<link linkend='nextsect' endterm="nextsect.title"/>,
|is just the section title.
|</para>
||
<para>In this sentence,
15 |<link xlink:href="http://docbook.org/">this</link> word is
|hot and points to DocBook website.
|</para>
||
<para>In this sentence, <link xlink:href="#nextsect">this</link>
20 |word is hot and also points to the following section. Note,
|however, that this is dependent on the link target appearing
|in the same document as the link and may not work consistently.
|Use <tag class="attribute">linkend</tag> instead.
|</para>
25 ||
<section xml:id='nextsect'>
|<title xml:id="nextsect.title">A Subsection</title>
|<para>This section only exists to be the target of a link.
|</para>
30 |</section>
||
</article>