$Id: titlepage.xsl,v 1.7 2004/04/25 10:35:01 kosek Exp $
Copyright © 19992000 by Norman Walsh. No Warranty.
This is technical reference documentation for the DocBook XSL Stylesheets; it documents (some of) the parameters, templates, and other elements of the stylesheets.
This is not intended to be “user” documentation. It is provided for developers writing customization layers for the stylesheets, and for anyone who's interested in “how it works”.
Although I am trying to be thorough, this documentation is known to be incomplete. Don't forget to read the source, too :-)
Table of Contents
t:templates — Construct a stylesheet for the templates provided
<xsl:template match="t:templates"/>
t:titlepage — Create the templates necessary to construct a title page
<xsl:template match="t:titlepage"/>
The t:titlepage element creates a set of
                  templates for processing the titlepage for an element. The
                  “root” of this template set is the template named
                  “wrapper.titlepage”. That is the
                  template that should be called to generate the title page.
                  
               
The t:titlepage element has three attributes:
                  
                  
                  
               
The name of the source document element for which
                           these templates apply. In other words, to make a title page for the
                           article element, set the
                           element attribute to
                           “article”. This attribute is required.
                           
                        
The entire title page can be wrapped with an element. This attribute identifies that element.
If the class attribute
                           is set, a class attribute with this
                           value will be added to the wrapper element that surrounds the entire
                           title page.
                           
                        
Any other attributes are copied through literally to the wrapper element.
The content of a t:titlepage is one or
                  more t:titlepage-content,
                  t:titlepage-separator, and
                  t:titlepage-before elements.
               
Each of these elements may be provided for the “recto” and “verso” sides of the title page.
@* (in copy.literal.atts mode) — Copy t:titlepage attributes
<xsl:template match="@*" mode="copy.literal.atts"/>
t:titlepage-content — Create templates for the content of one side of a title page
<xsl:template match="t:titlepage-content"/>
The title page content, that is, the elements from the source document that are rendered on the title page, can be controlled independently for the recto and verso sides of the title page.
The t:titlepage-content element has two attributes:
                  
                  
                  
               
Identifies the side of the page to which this title
                           page content applies. The
                           side attribute is required and
                           must be set to either 
                           “recto” or
                           “verso”. In addition, you must specify
                           exactly one t:titlepage-content for each side
                           within each t:titlepage.
                        
Indicates how the order of the elements presented on
                           the title page is determined. If the
                           order is
                           “document”, the elements are presented
                           in document order. Otherwise (if the
                           order is
                           “stylesheet”), the elements are presented
                           in the order that they appear in the template (and consequently in
                           the stylesheet).
                        
The content of a t:titlepage-content element is
                  a list of element names. These names should be unqualified.  They identify
                  the elements in the source document that should appear on the title page.
                  
               
Each element may have a single attribute:
                  predicate. The value of this
                  attribute is used as a predicate for the expression that matches
                  the element on which it occurs.
               
In other words, to put only the first three authors on the recto-side of a title page, you could specify:
  <t:titlepage-contents side="recto">
    <!-- other titlepage elements -->
    <author predicate="[count(previous-sibling::author)<2]"/>
    <!-- other titlepage elements -->
  </t:titlepage-contents>
Usually, the elements so named are empty. But it is possible to
                  make one level of selection within them. Suppose that you want to
                  process authorgroup elements on the title page, but
                  you want to select only proper authors, editors, or corporate authors,
                  not collaborators or other credited authors.
               
In that case, you can put a t:or group inside
                  the authorgroup element:
                  
                  
               
  <t:titlepage-contents side="recto">
    <!-- other titlepage elements -->
    <authorgroup>
      <t:or>
        <author/>
        <editor/>
        <corpauthor/>
      </t:or>
    </authorgroup>
    <!-- other titlepage elements -->
  </t:titlepage-contents>
This will have the effect of automatically generating a template
                  for processing authorgroups in the title page mode,
                  selecting only the specified children. If you need more complex processing,
                  you'll have to construct the templates by hand.
               
t:titlepage-separator — Create templates for the separator
<xsl:template match="t:titlepage-separator"/>
t:titlepage-before — Create templates for what precedes a title page
<xsl:template match="t:titlepage-before"/>
* (in document.order mode) — Create rules to process titlepage elements in document order
<xsl:template match="*" mode="document.order"/>
This template is called to process all of the children of the
                  t:titlepage-content element. It creates the hairy
                  select expression necessary to process each of those elements in
                  the title page.
               
Note that this template automatically handles the case where some DocBook elements, like title and subtitle, can occur both inside the *info elements where metadata is usually stored and outside.
It also automatically calculates the name for the *info container and handles elements that have historically had containers with different names.
* (in document.order mode) — Create rules to process titlepage elements in stylesheet order
<xsl:template match="*" mode="document.order"/>
This template is called to process all of the children of the
                  t:titlepage-content element. It creates the set
                  of xsl:apply-templates elements necessary
                  process each of those elements in the title page.
               
Note that this template automatically handles the case where some DocBook elements, like title and subtitle, can occur both inside the *info elements where metadata is usually stored and outside.
It also automatically calculates the name for the *info container and handles elements that have historically had containers with different names.
* (in titlepage.specialrules mode) — Create templates for special rules
<xsl:template match="*" mode="titlepage.specialrules"/>
* (in titlepage.subrules mode) — Create template for individual special rules
<xsl:template match="*" mode="titlepage.subrules"/>
t:or — Process the t:or special rule
<xsl:template match="t:or"/><xsl:template match="t:or" mode="titlepage.subrules"/>
t:or (in titlepage.subrules mode) — Process the t:or special rule in titlepage.subrules mode
<xsl:template match="t:or" mode="titlepage.subrules"/>
element-or-list — Construct the "or-list" used in the select attribute for special rules.
<xsl:template name="element-or-list"> <xsl:param name="elements" select="*"/> <xsl:param name="element.count" select="count($elements)"/> <xsl:param name="count" select="1"/> <xsl:param name="orlist"/> ... </xsl:template>