Q and A list of questions

Each qandaset can have its own local table of contents (TOC) that lists the questions in the set. You can globally turn the lists on or off, and then locally turn an individual list on or off.

The generate.toc parameter is used to globally control all TOCs, including all qandaset elements in the document. To turn them on, the stylesheet parameter generate.toc must include the line:

qandaset  toc

This line is included by default in the stylesheets. To turn them all off, the line should be omitted or replaced with this line:

qandaset  nop

See the section “Which components have a TOC” for more on the generate.toc parameter.

Once you have established the global pattern with generate.toc, you can use a processing instruction to turn the list on or off for an individual qandaset. The example below shows the use of the processing instruction that turns on the TOC for a single qandaset when they are turned off globally:

<qandaset><?dbhtml toc="1" ?>

Likewise, the following PI can be used to turn off the TOC for a single qandaset when they are turned on globally:

<qandaset><?dbhtml toc="0" ?>

The combination of the two mechanisms gives you complete control over the question lists.

There is one other stylesheet parameter that affects the list of questions. The DocBook DTD permits an answer element to include nested qandaentry elements. By default, the nested elements are not included in the list of questions. If you want them included, then set the stylesheet parameter qanda.nested.in.toc to 1.

You may have a requirement to customize the template that generates the list of questions. For print output, customize the template named qandaset.toc found in the stylesheet module fo/autotoc.xsl. For HTML output, customize the template named process.qanda.toc in the stylesheet module html/qandaset.xsl.