+ // Output the header of the table. For both HTML and CALS, this is surrounded by a thead.
+ bool const have_first_head = haveLTFirstHead(false);
+ // if we have a first head, then we are going to ignore the
+ // headers for the additional pages, since there aren't any
+ // in HTML or DocBook.
+ bool const have_head = !have_first_head && haveLTHead(false);
+
+ if (have_head || have_first_head) {
+ xs << xml::StartTag("thead") << xml::CR();
+ for (row_type r = 0; r < nrows(); ++r) {
+ if (((have_first_head && row_info[r].endfirsthead) ||
+ (have_head && row_info[r].endhead)) &&
+ !row_info[r].caption) {
+ xmlRow(xs, r, runparams, true, output_format, buffer().params().docbook_table_output);
+ }
+ }
+ xs << xml::EndTag("thead");
+ xs << xml::CR();
+ }
+}
+
+
+void Tabular::xmlFooter(XMLStream & xs, OutputParams const & runparams, const XmlOutputFormat output_format) const
+{
+ // Output the footer of the table. For both HTML and CALS, this is surrounded by a tfoot and output just after
+ // the header (and before the body).
+ bool const have_last_foot = haveLTLastFoot(false);
+ bool const have_foot = !have_last_foot && haveLTFoot(false);
+
+ if (have_foot || have_last_foot) {
+ xs << xml::StartTag("tfoot") << xml::CR();
+ for (row_type r = 0; r < nrows(); ++r) {
+ if (((have_last_foot && row_info[r].endlastfoot) ||
+ (have_foot && row_info[r].endfoot)) &&
+ !row_info[r].caption) {
+ xmlRow(xs, r, runparams, false, output_format, buffer().params().docbook_table_output);
+ }
+ }
+ xs << xml::EndTag("tfoot");
+ xs << xml::CR();
+ }
+}
+
+
+void Tabular::xmlBody(XMLStream & xs, OutputParams const & runparams, const XmlOutputFormat output_format) const
+{
+ // Output the main part of the table. The tbody container is mandatory for CALS, but optional for HTML (only if
+ // there is no header and no footer). It never hurts to have it, though.
+ xs << xml::StartTag("tbody");
+ xs << xml::CR();
+ for (row_type r = 0; r < nrows(); ++r)
+ if (isValidRow(r))
+ xmlRow(xs, r, runparams, false, output_format, buffer().params().docbook_table_output);
+ xs << xml::EndTag("tbody");
+ xs << xml::CR();
+}