XML technologies / DocBook / Structural elements / Common attributes
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
DocBook provides attributes available on every element, listed below. They are usually optional, though some are required on certain elements.
These attributes provide additional information such as language, audience, security, or difficulty level. They distinguish elements with the same name, which can help when filtering sections by difficulty or listing all English quotations in a document.
Common attributes for all DocBook 4 and 5 elements
-
arch(Architecture) specifies an element’s chip or computer architecture, such as
i386,x86_64and so on.
-
audience(Audience) specifies the intended audience, such as programmers, system administrators, or beginners.
-
condition(Condition) introduced in version 4.0 as a general-purpose attribute containing application-specific conditions.
-
conformance(Conformance) identifies a standard, such as ISO, IETF, or DIN, to which the element conforms; not used very often.
-
dir(Writing direction) marks the writing direction, which can be overridden. Available since DocBook V4.3. Rarely needed, it is used only if the publishing system cannot determine the writing direction from the Unicode character itself.
id(Anchor, marker, identifier)marks an element so that it can be referenced. Available only in DocBook 4 and earlier. In DocBook 5, replace
idwithxml:id. Most elements do not require this attribute, but a few do.Note: Permitted characters in an attribute value
Although XML places few restrictions on permitted characters, limit yourself to letters (a-z, A-Z), digits, underscores, and periods. The DocBook XSLT stylesheets can generate (X)HTML chunk files from theidattribute value. Some XSLT tools have problems generating these files if they contain umlauts.lang(Language)identifies the language code, such as
defor German,enfor English, and so on. In combined language-country codes, the hyphen is automatically converted to an underscore; thus,de-DEbecomesde_DE. For more codes, see ISO 639 and ISO 639-2: The Code Lists. This attribute is available only in DocBook 4 and earlier. In DocBook 5, replacelangwithxml:lang.
If no language is specified, English is normally the default, though this can depend on the applications used. The DocBook XSL stylesheets currently recognize all common languages.-
linkend/linkends(DocBook 5 only) (internal link target) points to an anchor identified by the attribute
id. Compared withlinkendthe attributelinkends(plural!) can contain one or more anchors separated by whitespace. The attributelinkendsis not available on every element.
-
os(Operating system) identifies the operating system to which the element applies, distinguishing text written for Linux, Macintosh, Windows, and so on.
-
remap(Remapping) contains the name of a semantically similar element from another markup language or an earlier DocBook version. This may help when converting XML formats while retaining the original element information. It is rarely needed for text written from scratch.
-
revision(Revision number) specifies a revision number.
-
revisionflag(Revision status) identifies an element’s revision status, such as added, deleted, changed, or disabled. Use
revisionflagto show changes between versions. This attribute is usually set by XML comparison tools rather than manually. It has no default value.
-
role(Role) classifies the element. Stylesheets or custom programs can use it to vary behavior, for example between print and online editions.
-
security(Security level) identifies data belonging to a particular security level
-
userlevel(Difficulty level) specifies the minimum experience level required of the user
-
vendor(Vendor) identifies vendor-specific data
-
xreflabel(Cross-reference name) text inserted when an
xrefreferences it
-
wordsize(Word size) specifies the computer architecture’s word size, or width in bits. Available since DocBook V4.4.
-
xml:base(Base URI) specifies the base URI of the element and its children. Available since DocBook V4.3 and needed when processing XIncludes, which may insert it automatically.
DocBook 5 supports some attributes from the XLink specification:
Attributes for DocBook 5 only
-
annotations(Annotations) identifies one or more annotations. For details, see “Adding block annotations”.
-
xml:lang(Language) this DocBook 5 attribute has the same meaning as
lang(see the attributelang).
-
xml:id(Anchor, marker, identifier) this frequently used DocBook 5 attribute has the same meaning as
id(see the attributeid).
-
xlink:actuate(Actuation) specifies when to display the link: on loading (
onLoad), on request (onRequest), never (none), or otherwise (other). Mainly needed for special requirements.
-
xlink:arcrole(Role for arc elements) has the same semantics as
xlink:role. Compared withxlink:rolethe attributexlink:arcroledescribes arc elements. In XLink, paths between resources are calledarcs and are represented by arc elements. An arc element contains, in the attributexlink:arcrole, an absolute URI identifying the relationship between arc elements. Rarely needed.
-
xlink:href(Link target) points to the URI to reference
-
xlink:role(XLink role) uses a URI to describe the relationship between links. The URI describes or explains the link.
-
xlink:show(Display) specifies how to open the link: in a new window (
new), replacing the old one (replace), embedded (embed), or otherwise (other).Note that some values make no sense for certain output media.
-
xlink:title(Link type) describes the link. This may be useful if the target medium can display it as a popup or in another way. (X)HTML uses this description
-
xlink:type(simple) specifies the link type; DocBook 5 currently allows only
simple. A simple link creates a unidirectional reference from the element to a URI. This is similar to an HTML link. The attribute usually need not be specified.
Copyright © 2009 Millin Verlag
You may print the online version for your private use.
Otherwise, this chapter from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Millin Verlag, Siebengebirgsring 36, 53797 Lohmar, info(at)millin.de