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 |
| | Processor architecture, such as |
| | specifies the target audience |
| | general standard attribute with no specific semantics |
| | identifies a standard |
| | identifies a natural language, such as |
| | Operating systems such as |
| | identifies the revision, such as |
| | identifies an element’s status, such as |
| | general attribute; avoid using it for profiling if possible!b |
| | Security level |
| | identifies a user’s experience with a topic, such as |
| | Name of a product or vendor, such as Samba, DocBook, etc. |
| | 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.
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
back to top