XML technologies / DocBook / Conditional elements (profiling) / Applying multiple profiling criteria / One profiling attribute, multiple attribute values
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
The following file uses the attribute os in several places. Line 3 is notable: it specifies four values separated by semicolons (;). This means that the paragraph applies to all the listed operating systems.
Example: profiling-chapter.001.xml
<chapter>
<title>Das Programm XYZ</title>
<para os="unix;linux;win;mac">In den folgenden Abschnitten ...</para>
<section>
<title>Installation</title>
<para os="unix;linux">Das Programm wird im Verzeichnis <filename>/usr/share/sgml/</filename> installiert.</para>
<para os="mac">Das Programm wird im Verzeichnis <filename>system:prog:sgml</filename> installiert.</para>
<para os="win">Das Programm wird im Verzeichnis <filename>c:\prog\sgml</filename> installiert.</para>
</section>
<section os="unix">
<title>Besonderheiten von <trademark>Unix</trademark></title>
<para>Besondere Eigenschaften gibt es unter dem Betriebssystem <trademark>UNIX</trademark> ...</para>
</section>
<!-- ... -->
</chapter>The document above can be filtered through profiling in several ways. For output containing both Linux and UNIX™ use the following command:
xsltproc --stringparam profile.os "linux;unix" \
DB/html/profile-docbook.xsl \
profiling-chapter-001.xmlThe order of linux;unix does not matter. Values must contain no intervening spaces and must always be separated by semicolons. The values themselves must not contain a semicolon.
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