If you want to conditionalize just part of the text of an element, you can use the phrase
element to mark the text. For example, if the only difference is one sentence within a paragraph, you can mark it this way:
<para>To open a file, select File Open. <phrase os="win">The default configuration lists share drives such as E: as well as the C: hard drive.</phrase> <phrase os="linux">The default configuration lists NFS-mounted filesystems as well as local filesystems.</phrase> Choose the file from the list.</para>
Note these features of using phrase
:
A phrase
element is permitted in most places that general text can be used, including within para
, title
, and literallayout
, among others. The DocBook DTD is the final authority for where phrase
can be used.
It can contain any text from a single word up to many sentences, and can include inline markup including index terms. However, phrase
cannot contain block elements like para
and such.
It is especially useful within a title
element, since the DTD permits only one title child element per parent. Instead of trying to conditionalize two title elements, put two conditionalized phrase
elements within a single title
element.
DocBook XSL: The Complete Guide - 3rd Edition | PDF version available | Copyright © 2002-2005 Sagehill Enterprises |