Next / Previous / Contents / NM Tech homepage

9. html-titlepage.xml: HTML title page template

Very little customization has been done to the stock version of this file. Because we are using chunked HTML output, the title page material appears at the top of every chunk—so we don't really need a title page. The title has been moved to the page header, produced by the header.navigation template. The authorgroup and author content have been moved to the page footer, produced by the footer.navigation template. The remaining title page elements are discarded.

Here is the html-titlepage.xml template file, with comments. This file is a modified copy of file html/titlepage.templates.xml in the stock DocBook-XSL Stylesheets distribution.

First is the root templates element, which describes the several namespaces used in this file.

html-titlepage.xml
<!--File html-titlepage.xml.
 !   Do not edit this file directly.  It is extracted mechanically
 !   from the documentation:
 !       http://www.nmt.edu/~shipman/doc/doc5style/
 !-->
<t:templates xmlns:t="http://nwalsh.com/docbook/xsl/template/1.0"
    xmlns:param="http://nwalsh.com/docbook/xsl/template/1.0/param"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

The namespaces are:

The remainder of the file consists of t:titlepage elements; each describes the title page for a particular context. The only one we've customized here is the first one, which governs the title page layout of an <article>. Here is the start tag:

html-titlepage.xml
<!--article-->
<t:titlepage t:element="article" t:wrapper="div"
    class="titlepage">

Within each t:titlepage element are several child elements that describe the generated content. We removed most of them: for example, author information will appear in the page colophon. However, we do retain the abstract element in the main title; this is the standard location for pointers to the HTML and PDF forms of the document.

html-titlepage.xml
  <t:titlepage-content t:side="recto">
    <abstract/>
    <!--All items removed were here-->
  </t:titlepage-content>

The t:titlepage-content element describes generated content. Its t:side="recto" attribute means that this applies to the right-hand (recto) page, that is the “front” title page, as opposed to the “verso” page on the back. These terms obviously apply to printed pages and not to HTML; however, the recto page in the HTML is still the “front” page.

Here is the content that was removed from the stock titlepage.templates.xml file:

    <title/>
    <subtitle/>
    <corpauthor/>
    <authorgroup/>
    <author/>
    <othercredit/>
    <releaseinfo/>
    <copyright/>
    <legalnotice/>
    <pubdate/>
    <revision/>
    <revhistory/>

These elements, if present, would produce the title, subtitle, corporate author, and so forth.

Next in our html-titlepage.xml file is the template for the verso page, which we are not customizing:

html-titlepage.xml
  <t:titlepage-content t:side="verso">
  </t:titlepage-content>

Only one customization remains. In the stock file, there is a horizontal rule (<hr/) following the title page content. Since we aren't generating any title page content, we don't need the horizontal rule either. Here is the customized t:titlepage-separator element that used to contain the horizontal rule:

html-titlepage.xml
  <t:titlepage-separator>
    <!--hr removed here; reinstate if there is any content in
     !  the titlepage-content element above.
     !-->
  </t:titlepage-separator>

Next we finish off the t:titlepage element, supplying empty t:titlepage-before elements. If there were any content in these elements, that content would appear before the title page.

html-titlepage.xml
  <t:titlepage-before t:side="recto">
  </t:titlepage-before>

  <t:titlepage-before t:side="verso">
  </t:titlepage-before>
</t:titlepage>

</t:templates>

The rest of the the stock html/titlepage.templates.xml file has been deleted. This rather long section includes declarations for the format of title content for elements such as set, book, sect1, and so forth. We won't need these unless we later decide to add a “title page” to elements other than article.

If you want to define new kinds of title content for some elements, go to the stock html/titlepage.templates.xml file, find the t:titlepage element for the desired DocBook element, and paste it in here.

For example, if we ever define a book style, find the element that starts with <t:titlepage t:element="book" t:wrapper="div" class="titlepage">, insert it here, and customize it as appropriate.