Login | Register
My pages Projects Community openCollabNet

A.1.  Conditions, and how they are used

[ fromfile: grammar.xml id: conditions ]

Any element can have a condition (sometimes shortened to just a c) attribute. For example:

<li> This shows up in in all versions. </li>
<li condition="slides"> This is in the slides </li>
<li c="textbook"> This is a much longer sentence for the textbook. </li>

To process a document, you can select multiple conditional values as separate -c options, or as strings separated by commas (no spaces) after a single -c.

     $ python xml2docbook.py -c remark -c slides,html
     $ python xml2docbook.py -c all

The first executes the script with conditions remark, slides, and html switched on, and all other conditons switched off. The second example switches "all" conditions on.

Condition attributes are used in a variety of ways. You can define new conditions to suit your particular document through the use of plugins (see Section 2.2) and decide which ones to switch on or off by customizing the ant build scripts. Only some of them have special meaning inside the python scripts, and those meanings are listed here.

Currently used Conditions


For HTML output


pdf output


ps output - converts as needed, all png images to eps and substitutes the extensions of all <img> src attributes.


displays the red "fromfile" information at the top of each page.


renders all <pb> tags as <itemizedlist>


renders all <pb> tags as <para>, and ignores the enclosed <li> tags.


output in red/italic


like remark


solutions guide


instructor's notes