Chunking Q and A

If you publish a large FAQ (frequently asked questions) document to HTML, you might want to group related questions together and chunk each group into a separate HTML file. The qandadiv element is designed to group together questions, but it is not suitable for chunking. That's because it is a block-type element, not a section-type element, so the chunking stylesheets won't create a chunk with it. Also, a qandadiv title does not normally appear in the table of contents.

The best approach to chunking a large Q and A is to break it into DocBook section elements (or the equivalent sect1, sect2, etc). Each section contains a qandaset that holds that group of qandaentrys. The section element provides the hook for chunking, and a title that shows up in the table of contents. You can also nest them to form hierarchies of questions.

<section id="group1">
 <title>First group of questions</title>
 <qandaset>
   <qandaentry id="group1_1">
      <question>
         <para>...</para>
      </question>
      <answer>
         <para>...</para>
       </answer>
   </qandaentry>
   ...
 </qandaset>
</section>

See the section “Controlling what gets chunked” to control what sections become chunks in the HTML output.