XML technologies / DocBook / Conditional elements (profiling) / Adding profiling information

(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)

You do not need to customize the DocBook stylesheets to use profiling. Simply add profiling attributes to the relevant element. These attributes are listed in the following table.

The profiling attributes are evaluated by a profiling stylesheet that provides a parameter for each attribute (see the second column, Profiling name). All parameters are empty by default, but you can override them with your own values.

Table: Profiling attributes

Attribute name

Profiling name

Description

arch

profile.arch

Processor architecture, such as i386, ppc, sparc

audience

profile.audience

specifies the target audience

condition

profile.condition

general standard attribute with no specific semantics

conformance

profile.conformance

identifies a standard

lang, xml:langa

profile.lang

identifies a natural language, such as de, en, es

os

profile.os

Operating systems such as linux, mac, win and others

revision

profile.revision

identifies the revision, such as v1.5

revisionflag

profile.revisionflag

identifies an element’s status, such as changed

role

profile.role

general attribute; avoid using it for profiling if possible!b

security

profile.security

Security level

userlevel

profile.userlevel

identifies a user’s experience with a topic, such as beginner, professional or expert

vendor

profile.vendor

Name of a product or vendor, such as Samba, DocBook, etc.

wordsize

profile.wordsize

Word size (width in bits) of the computer architecture

a   For DocBook 5 only.
b   The attribute role is already used by some elements (as in emphasis for bold type). This produces unwanted side effects when you use role.  

To use profiling attributes, enter a document variant as the value. For example:

<section os="linux">
    <title>Installation unter Linux</title>
    ...
</section>
<section os="win">
    <title>Installation unter Windows</title>
    ...
</section>
<section os="macos">
    <title>Installation unter MacOS</title>
    ...
</section>

The example contains three parallel sections describing the installation of a program for different operating systems. The condition applies to the element containing the profiling attribute and all its child elements.

Usually, the output should contain customized instructions for only one operating system, such as Linux. In this case, select the following condition during the profiling step: os="linux". This excludes all elements whose os attribute has a value other than linux. Elements where the attribute os is absent are included unchanged.

  

back to top