<?xml version="1.0" encoding="utf-8"?>
<section id="S__db-chunk"><title>DocBook Chunking</title>
  <remark>Describe this module</remark>
  <variablelist><title>Parameters</title><varlistentry><term><link linkend="P__db_chunk_chunks"><parameter>db.chunk.chunks</parameter></link></term><listitem><para>A space-seperated list of the names of elements that should be chunked</para></listitem></varlistentry><varlistentry><term><link linkend="P__db_chunk_chunk_top"><parameter>db.chunk.chunk_top</parameter></link></term><listitem><para>Whether the top-level chunk should be output with the chunking mechanism</para></listitem></varlistentry><varlistentry><term><link linkend="P__db_chunk_max_depth"><parameter>db.chunk.max_depth</parameter></link></term><listitem><para>The maximum depth for chunking sections</para></listitem></varlistentry><varlistentry><term><link linkend="P__db_chunk_basename"><parameter>db.chunk.basename</parameter></link></term><listitem><para>The base filename of the output file, without an extension</para></listitem></varlistentry><varlistentry><term><link linkend="P__db_chunk_extension"><parameter>db.chunk.extension</parameter></link></term><listitem><para>The default file extension for new output documents</para></listitem></varlistentry><varlistentry><term><link linkend="P__db_chunk_info_chunk"><parameter>db.chunk.info_chunk</parameter></link></term><listitem><para>Whether to create a chunk for the title page</para></listitem></varlistentry><varlistentry><term><link linkend="P__db_chunk_info_basename"><parameter>db.chunk.info_basename</parameter></link></term><listitem><para>The base filename for the title page</para></listitem></varlistentry><varlistentry><term><link linkend="P__db_chunk_doctype_public"><parameter>db.chunk.doctype_public</parameter></link></term><listitem><para>The public DOCTYPE for output files</para></listitem></varlistentry><varlistentry><term><link linkend="P__db_chunk_doctype_system"><parameter>db.chunk.doctype_system</parameter></link></term><listitem><para>The system DOCTYPE for output files</para></listitem></varlistentry></variablelist><variablelist><title>Modes</title><varlistentry><term><link linkend="M__db_chunk_info_content_mode"><function>db.chunk.info.content.mode</function></link></term><listitem><para>Renders the contents of the title page</para></listitem></varlistentry><varlistentry><term><link linkend="M__db_chunk_content_mode"><function>db.chunk.content.mode</function></link></term><listitem><para>Renders the entire contents of the chunk</para></listitem></varlistentry></variablelist><variablelist><title>Templates</title><varlistentry><term><link linkend="T__db_chunk"><function>db.chunk</function></link></term><listitem><para>Creates a new page of output</para></listitem></varlistentry><varlistentry><term><link linkend="T__db_chunk_content"><function>db.chunk.content</function></link></term><listitem><para>Creates the content of a new page of output</para></listitem></varlistentry><varlistentry><term><link linkend="T__db_chunk_children"><function>db.chunk.children</function></link></term><listitem><para>Creates new output pages for the children of an element</para></listitem></varlistentry><varlistentry><term><link linkend="T__db_chunk_depth-in-chunk"><function>db.chunk.depth-in-chunk</function></link></term><listitem><para>Determines the depth of an element in the containing chunk</para></listitem></varlistentry><varlistentry><term><link linkend="T__db_chunk_depth-of-chunk"><function>db.chunk.depth-of-chunk</function></link></term><listitem><para>Determines the depth of teh containing chunk in the document</para></listitem></varlistentry><varlistentry><term><link linkend="T__db_chunk_chunk-id"><function>db.chunk.chunk-id</function></link></term><listitem><para>Determines the id of the chunk that contains an element</para></listitem></varlistentry><varlistentry><term><link linkend="T__db_chunk_chunk-id_axis"><function>db.chunk.chunk-id.axis</function></link></term><listitem><para>Determines the id of the first chunk along a specified axis</para></listitem></varlistentry></variablelist><refentry id="P__db_chunk_chunks"><indexterm><primary>db.chunk.chunks</primary></indexterm><refnamediv><refname><parameter>db.chunk.chunks</parameter></refname><refpurpose>A space-seperated list of the names of elements that should be chunked</refpurpose></refnamediv><refsection><title>Description</title>
  <remark>This parameter sucks</remark>
  </refsection></refentry><refentry id="P__db_chunk_chunk_top"><indexterm><primary>db.chunk.chunk_top</primary></indexterm><refnamediv><refname><parameter>db.chunk.chunk_top</parameter></refname><refpurpose>Whether the top-level chunk should be output with the chunking mechanism</refpurpose></refnamediv><refsection><title>Description</title>
  <remark>Describe what this does</remark>
  </refsection></refentry><refentry id="P__db_chunk_max_depth"><indexterm><primary>db.chunk.max_depth</primary></indexterm><refnamediv><refname><parameter>db.chunk.max_depth</parameter></refname><refpurpose>The maximum depth for chunking sections</refpurpose></refnamediv><refsection><title>Description</title>
  <remark>Describe what this does</remark>
  </refsection></refentry><refentry id="P__db_chunk_basename"><indexterm><primary>db.chunk.basename</primary></indexterm><refnamediv><refname><parameter>db.chunk.basename</parameter></refname><refpurpose>The base filename of the output file, without an extension</refpurpose></refnamediv><refsection><title>Description</title>
  <remark>Describe what this does</remark>
  </refsection></refentry><refentry id="P__db_chunk_extension"><indexterm><primary>db.chunk.extension</primary></indexterm><refnamediv><refname><parameter>db.chunk.extension</parameter></refname><refpurpose>The default file extension for new output documents</refpurpose></refnamediv><refsection><title>Description</title>
  <remark>Describe what this does</remark>
  </refsection></refentry><refentry id="P__db_chunk_info_chunk"><indexterm><primary>db.chunk.info_chunk</primary></indexterm><refnamediv><refname><parameter>db.chunk.info_chunk</parameter></refname><refpurpose>Whether to create a chunk for the title page</refpurpose></refnamediv><refsection><title>Description</title>
  <remark>Describe what this does</remark>
  </refsection></refentry><refentry id="P__db_chunk_info_basename"><indexterm><primary>db.chunk.info_basename</primary></indexterm><refnamediv><refname><parameter>db.chunk.info_basename</parameter></refname><refpurpose>The base filename for the title page</refpurpose></refnamediv><refsection><title>Description</title>
  <remark>Describe what this does</remark>
  </refsection></refentry><refentry id="P__db_chunk_doctype_public"><indexterm><primary>db.chunk.doctype_public</primary></indexterm><refnamediv><refname><parameter>db.chunk.doctype_public</parameter></refname><refpurpose>The public DOCTYPE for output files</refpurpose></refnamediv><refsection><title>Description</title>
  <remark>Describe this</remark>
  </refsection></refentry><refentry id="P__db_chunk_doctype_system"><indexterm><primary>db.chunk.doctype_system</primary></indexterm><refnamediv><refname><parameter>db.chunk.doctype_system</parameter></refname><refpurpose>The system DOCTYPE for output files</refpurpose></refnamediv><refsection><title>Description</title>
  <remark>Describe this</remark>
  </refsection></refentry><refentry id="M__db_chunk_info_content_mode"><indexterm><primary>db.chunk.info.content.mode</primary></indexterm><refnamediv><refname><function>db.chunk.info.content.mode</function></refname><refpurpose>Renders the contents of the title page</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>depth_in_chunk</parameter></term><listitem><para>The depth of the element in the containing chunk</para></listitem></varlistentry><varlistentry><term><parameter>depth_of_chunk</parameter></term><listitem><para>The depth of the containing chunk in the document</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <para>When processed in this mode, a division element should output the top-level
  markup for the output page.</para>
  </refsection></refentry><refentry id="M__db_chunk_content_mode"><indexterm><primary>db.chunk.content.mode</primary></indexterm><refnamediv><refname><function>db.chunk.content.mode</function></refname><refpurpose>Renders the entire contents of the chunk</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>depth_in_chunk</parameter></term><listitem><para>The depth of the element in the containing chunk</para></listitem></varlistentry><varlistentry><term><parameter>depth_of_chunk</parameter></term><listitem><para>The depth of the containing chunk in the document</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <para>When processed in this mode, a division element should output the top-level
  markup for the output page.</para>
  </refsection></refentry><refentry id="T__db_chunk"><indexterm><primary>db.chunk</primary></indexterm><refnamediv><refname><function>db.chunk</function></refname><refpurpose>Creates a new page of output</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>node</parameter></term><listitem><para>The source element for the output page</para></listitem></varlistentry><varlistentry><term><parameter>template</parameter></term><listitem><para>The named template to call to create the page</para></listitem></varlistentry><varlistentry><term><parameter>href</parameter></term><listitem><para>The name of the file for the output page</para></listitem></varlistentry><varlistentry><term><parameter>depth_of_chunk</parameter></term><listitem><para>The depth of this chunk in the document</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <remark>We need a lot more explanation about chunk flow</remark>
  <para>The <function><link linkend="T__db_chunk">db.chunk</link></function> template creates a new output document using the <literal>exsl:document</literal>
  extension element.  This template calls <function><link linkend="T__db_chunk_content">db.chunk.content</link></function> to create the content
  of the document, passing through all parameters.  This allows you to override the
  chunking mechanism without having to duplicate the content-generation code.</para>
  </refsection></refentry><refentry id="T__db_chunk_content"><indexterm><primary>db.chunk.content</primary></indexterm><refnamediv><refname><function>db.chunk.content</function></refname><refpurpose>Creates the content of a new page of output</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>node</parameter></term><listitem><para>The source element for the output page</para></listitem></varlistentry><varlistentry><term><parameter>template</parameter></term><listitem><para>The named template to call to create the page</para></listitem></varlistentry><varlistentry><term><parameter>depth_of_chunk</parameter></term><listitem><para>The depth of this chunk in the document</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <remark>We need a lot more explanation about chunk flow</remark>
  <para>The <function><link linkend="T__db_chunk_content">db.chunk.content</link></function> template creates the actual content of a new output page.
  It should generally only be called by <function><link linkend="T__db_chunk">db.chunk</link></function>.</para>
  <para>This template will always pass the <parameter>depth_in_chunk</parameter> and <parameter>depth_of_chunk</parameter>
  parameters with appropriate values to the templates it calls.</para>
  </refsection></refentry><refentry id="T__db_chunk_children"><indexterm><primary>db.chunk.children</primary></indexterm><refnamediv><refname><function>db.chunk.children</function></refname><refpurpose>Creates new output pages for the children of an element</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>node</parameter></term><listitem><para>The parent element whose children will be chunked</para></listitem></varlistentry><varlistentry><term><parameter>depth_of_chunk</parameter></term><listitem><para>The depth of <parameter>node</parameter> in the document</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <remark>We need a lot more explanation about chunk flow</remark>
  </refsection></refentry><refentry id="T__db_chunk_depth-in-chunk"><indexterm><primary>db.chunk.depth-in-chunk</primary></indexterm><refnamediv><refname><function>db.chunk.depth-in-chunk</function></refname><refpurpose>Determines the depth of an element in the containing chunk</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>node</parameter></term><listitem><para>The element to determine the depth of</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <remark>Explain how this works</remark>
  </refsection></refentry><refentry id="T__db_chunk_depth-of-chunk"><indexterm><primary>db.chunk.depth-of-chunk</primary></indexterm><refnamediv><refname><function>db.chunk.depth-of-chunk</function></refname><refpurpose>Determines the depth of teh containing chunk in the document</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>node</parameter></term><listitem><para>The element to determine the depth of</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <remark>Explain how this works</remark>
  </refsection></refentry><refentry id="T__db_chunk_chunk-id"><indexterm><primary>db.chunk.chunk-id</primary></indexterm><refnamediv><refname><function>db.chunk.chunk-id</function></refname><refpurpose>Determines the id of the chunk that contains an element</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>id</parameter></term><listitem><para>The id of the element to determine the chunk id of</para></listitem></varlistentry><varlistentry><term><parameter>node</parameter></term><listitem><para>The element to determine the chunk id of</para></listitem></varlistentry><varlistentry><term><parameter>depth_in_chunk</parameter></term><listitem><para>The depth of <parameter>node</parameter> in the containing chunk</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <remark>Explain how this works</remark>
  </refsection></refentry><refentry id="T__db_chunk_chunk-id_axis"><indexterm><primary>db.chunk.chunk-id.axis</primary></indexterm><refnamediv><refname><function>db.chunk.chunk-id.axis</function></refname><refpurpose>Determines the id of the first chunk along a specified axis</refpurpose></refnamediv><refsection><title>Parameters</title><variablelist><varlistentry><term><parameter>node</parameter></term><listitem><para>The base element</para></listitem></varlistentry><varlistentry><term><parameter>node</parameter></term><listitem><para>The axis along which to find the first chunk</para></listitem></varlistentry><varlistentry><term><parameter>depth_in_chunk</parameter></term><listitem><para>The depth of <parameter>node</parameter> in the containing chunk</para></listitem></varlistentry><varlistentry><term><parameter>depth_of_chunk</parameter></term><listitem><para>The depth of the containing chunk in the document</para></listitem></varlistentry></variablelist></refsection><refsection><title>Description</title>
  <remark>Explain how this works, and what the axes are</remark>
  </refsection></refentry></section>
