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.xml

The 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.

  

back to top