File: //usr/share/doc/docbook-style-xsl-1.69.1/doc/template/titlepage.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Template Stylesheet Reference</title>
<link rel="stylesheet" href="../reference.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.69.0">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="reference" lang="en">
<div class="titlepage">
<div>
<div>
<h1 class="title"><a name="d0e1"></a>Template Stylesheet Reference
</h1>
</div>
<div>
<div class="author">
<h3 class="author"><span class="firstname">Norman</span> <span class="surname">Walsh</span></h3>
</div>
</div>
<div>
<p class="releaseinfo">
$Id: titlepage.xsl,v 1.8 2005/04/29 20:05:36 kosek Exp $
</p>
</div>
<div>
<p class="copyright"><a href="../copyright.html">Copyright</a> © 19992000 by Norman Walsh. <a href="../warranty.html">No Warranty</a>.
</p>
</div>
</div>
<hr>
</div>
<div class="partintro" lang="en">
<div></div>
<div class="section" lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="d0e24"></a>Introduction
</h2>
</div>
</div>
</div>
<p>This is technical reference documentation for the DocBook XSL
Stylesheets; it documents (some of) the parameters, templates, and
other elements of the stylesheets.
</p>
<p>This is not intended to be “<span class="quote">user</span>” documentation.
It is provided for developers writing customization layers for the
stylesheets, and for anyone who's interested in “<span class="quote">how it
works</span>”.
</p>
<p>Although I am trying to be thorough, this documentation is known
to be incomplete. Don't forget to read the source, too :-)
</p>
</div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl>
<dt><span class="refentrytitle"><a href="#d0e39">t:templates</a></span><span class="refpurpose"> - Construct a stylesheet for the templates provided</span></dt>
<dt><span class="refentrytitle"><a href="#d0e71">xsl:*</a></span><span class="refpurpose"> - Copy xsl: elements straight through</span></dt>
<dt><span class="refentrytitle"><a href="#d0e85">t:titlepage</a></span><span class="refpurpose"> - Create the templates necessary to construct a title page</span></dt>
<dt><span class="refentrytitle"><a href="#d0e178">@* (in copy.literal.atts mode)</a></span><span class="refpurpose"> - Copy t:titlepage attributes</span></dt>
<dt><span class="refentrytitle"><a href="#d0e198">t:titlepage-content</a></span><span class="refpurpose"> - Create templates for the content of one side of a title page</span></dt>
<dt><span class="refentrytitle"><a href="#d0e305">t:titlepage-separator</a></span><span class="refpurpose"> - Create templates for the separator</span></dt>
<dt><span class="refentrytitle"><a href="#d0e322">t:titlepage-before</a></span><span class="refpurpose"> - Create templates for what precedes a title page</span></dt>
<dt><span class="refentrytitle"><a href="#d0e339">* (in copy mode)</a></span><span class="refpurpose"> - Copy elements</span></dt>
<dt><span class="refentrytitle"><a href="#d0e353">@* (in copy mode)</a></span><span class="refpurpose"> - Copy attributes</span></dt>
<dt><span class="refentrytitle"><a href="#d0e367">* (in document.order mode)</a></span><span class="refpurpose"> - Create rules to process titlepage elements in document order</span></dt>
<dt><span class="refentrytitle"><a href="#d0e390">* (in document.order mode)</a></span><span class="refpurpose"> - Create rules to process titlepage elements in stylesheet order</span></dt>
<dt><span class="refentrytitle"><a href="#d0e416">* (in titlepage.specialrules mode)</a></span><span class="refpurpose"> - Create templates for special rules</span></dt>
<dt><span class="refentrytitle"><a href="#d0e436">* (in titlepage.subrules mode)</a></span><span class="refpurpose"> - Create template for individual special rules</span></dt>
<dt><span class="refentrytitle"><a href="#d0e450">t:or</a></span><span class="refpurpose"> - Process the t:or special rule</span></dt>
<dt><span class="refentrytitle"><a href="#d0e464">t:or (in titlepage.subrules mode)</a></span><span class="refpurpose"> - Process the t:or special rule in
titlepage.subrules mode</span></dt>
<dt><span class="refentrytitle"><a href="#template.element-or-list">element-or-list</a></span><span class="refpurpose"> - Construct the "or-list" used in the select attribute for
special rules.</span></dt>
</dl>
</div>
</div>
<div class="refentry" lang="en"><a name="d0e39"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>t:templates — Construct a stylesheet for the templates provided</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><xsl:template match="t:templates"/></pre></div>
<div class="refdescription"><a name="d0e48"></a>
<p>The <code class="literal">t:templates</code> element is the root of a
set of templates. This template creates an appropriate
<code class="literal">xsl:stylesheet</code> for the templates.
</p>
<p>If the <code class="literal">t:templates</code> element has a
<code class="literal">base-stylesheet</code> attribute, an
<code class="literal">xsl:import</code> statement is constructed for it.
</p>
</div>
</div>
<div class="refentry" lang="en">
<div class="refentry.separator">
<hr>
</div><a name="d0e71"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>xsl:* — Copy xsl: elements straight through</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><xsl:template match="xsl:*"/></pre></div>
<div class="refdescription"><a name="d0e80"></a>
<p>This template simply copies the xsl: elements
straight through into the result tree.
</p>
</div>
</div>
<div class="refentry" lang="en">
<div class="refentry.separator">
<hr>
</div><a name="d0e85"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>t:titlepage — Create the templates necessary to construct a title page</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><xsl:template match="t:titlepage"/></pre></div>
<div class="refdescription"><a name="d0e94"></a>
<p>The <code class="literal">t:titlepage</code> element creates a set of
templates for processing the titlepage for an element. The
“<span class="quote">root</span>” of this template set is the template named
“<span class="quote"><code class="literal">wrapper.titlepage</code></span>”. That is the
template that should be called to generate the title page.
</p>
<p>The <code class="literal">t:titlepage</code> element has three attributes:
</p>
<div class="variablelist">
<dl>
<dt><span class="term">element</span></dt>
<dd>
<p>The name of the source document element for which
these templates apply. In other words, to make a title page for the
<code class="sgmltag-element">article</code> element, set the
<code class="sgmltag-attribute">element</code> attribute to
“<span class="quote"><code class="literal">article</code></span>”. This attribute is required.
</p>
</dd>
<dt><span class="term">wrapper</span></dt>
<dd>
<p>The entire title page can be wrapped with an element.
This attribute identifies that element.
</p>
</dd>
<dt><span class="term">class</span></dt>
<dd>
<p>If the <code class="sgmltag-attribute">class</code> attribute
is set, a <code class="sgmltag-attribute">class</code> attribute with this
value will be added to the wrapper element that surrounds the entire
title page.
</p>
</dd>
</dl>
</div>
<p>
</p>
<p>Any other attributes are copied through literally to the
wrapper element.
</p>
<p>The content of a <code class="literal">t:titlepage</code> is one or
more <code class="literal">t:titlepage-content</code>,
<code class="literal">t:titlepage-separator</code>, and
<code class="literal">t:titlepage-before</code> elements.
</p>
<p>Each of these elements may be provided for the “<span class="quote">recto</span>”
and “<span class="quote">verso</span>” sides of the title page.
</p>
</div>
</div>
<div class="refentry" lang="en">
<div class="refentry.separator">
<hr>
</div><a name="d0e178"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>@* (in copy.literal.atts mode) — Copy t:titlepage attributes</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><xsl:template match="@*" mode="copy.literal.atts"/></pre></div>
<div class="refdescription"><a name="d0e187"></a>
<p>This template copies all of the “<span class="quote">other</span>” attributes
from a <code class="literal">t:titlepage</code> element onto the specified
wrapper.
</p>
</div>
</div>
<div class="refentry" lang="en">
<div class="refentry.separator">
<hr>
</div><a name="d0e198"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>t:titlepage-content — Create templates for the content of one side of a title page</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><xsl:template match="t:titlepage-content"/></pre></div>
<div class="refdescription"><a name="d0e207"></a>
<p>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.
</p>
<p>The <code class="literal">t:titlepage-content</code> element has two attributes:
</p>
<div class="variablelist">
<dl>
<dt><span class="term">side</span></dt>
<dd>
<p>Identifies the side of the page to which this title
page content applies. The
<code class="sgmltag-attribute">side</code> attribute is required and
must be set to either
“<span class="quote"><code class="literal">recto</code></span>” or
“<span class="quote"><code class="literal">verso</code></span>”. In addition, you must specify
exactly one <code class="literal">t:titlepage-content</code> for each side
within each <code class="literal">t:titlepage</code>.
</p>
</dd>
<dt><span class="term">order</span></dt>
<dd>
<p>Indicates how the order of the elements presented on
the title page is determined. If the
<code class="sgmltag-attribute">order</code> is
“<span class="quote"><code class="literal">document</code></span>”, the elements are presented
in document order. Otherwise (if the
<code class="sgmltag-attribute">order</code> is
“<span class="quote"><code class="literal">stylesheet</code></span>”), the elements are presented
in the order that they appear in the template (and consequently in
the stylesheet).
</p>
</dd>
</dl>
</div>
<p>
</p>
<p>The content of a <code class="literal">t:titlepage-content</code> 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.
</p>
<p>Each element may have a single attribute:
<code class="sgmltag-attribute">predicate</code>. The value of this
attribute is used as a predicate for the expression that matches
the element on which it occurs.
</p>
<p>In other words, to put only the first three authors on the
recto-side of a title
page, you could specify:
</p><pre class="screen">
<t:titlepage-contents side="recto">
<!-- other titlepage elements -->
<author predicate="[count(previous-sibling::author)<2]"/>
<!-- other titlepage elements -->
</t:titlepage-contents>
</pre><p>
</p>
<p>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 <code class="literal">authorgroup</code> elements on the title page, but
you want to select only proper authors, editors, or corporate authors,
not collaborators or other credited authors.
</p>
<p>In that case, you can put a <code class="literal">t:or</code> group inside
the <code class="literal">authorgroup</code> element:
</p><pre class="screen">
<t:titlepage-contents side="recto">
<!-- other titlepage elements -->
<authorgroup>
<t:or>
<author/>
<editor/>
<corpauthor/>
</t:or>
</authorgroup>
<!-- other titlepage elements -->
</t:titlepage-contents>
</pre><p>
</p>
<p>This will have the effect of automatically generating a template
for processing <code class="literal">authorgroup</code>s 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.
</p>
</div>
</div>
<div class="refentry" lang="en">
<div class="refentry.separator">
<hr>
</div><a name="d0e305"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>t:titlepage-separator — Create templates for the separator</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><xsl:template match="t:titlepage-separator"/></pre></div>
<div class="refdescription"><a name="d0e314"></a>
<p>The title page is separated from the content which follows it by
the markup specified in the <code class="literal">t:titlepage-separator</code>
element.
</p>
</div>
</div>
<div class="refentry" lang="en">
<div class="refentry.separator">
<hr>
</div><a name="d0e322"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>t:titlepage-before — Create templates for what precedes a title page</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><xsl:template match="t:titlepage-before"/></pre></div>
<div class="refdescription"><a name="d0e331"></a>
<p>Each side of the title page is preceded by the markup specified
in the <code class="literal">t:titlepage-before</code> element for that
side.
</p>
</div>
</div>
<div class="refentry" lang="en">
<div class="refentry.separator">
<hr>
</div><a name="d0e339"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>* (in copy mode) — Copy elements</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><xsl:template match="*" mode="copy"/></pre></div>
<div class="refdescription"><a name="d0e348"></a>
<p>This template simply copies the elements that it applies to
straight through into the result tree.
</p>
</div>
</div>
<div class="refentry" lang="en">
<div class="refentry.separator">
<hr>
</div><a name="d0e353"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>@* (in copy mode) — Copy attributes</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><xsl:template match="@*" mode="copy"/></pre></div>
<div class="refdescription"><a name="d0e362"></a>
<p>This template simply copies the attributes that it applies to
straight through into the result tree.
</p>
</div>
</div>
<div class="refentry" lang="en">
<div class="refentry.separator">
<hr>
</div><a name="d0e367"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>* (in document.order mode) — Create rules to process titlepage elements in document order</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><xsl:template match="*" mode="document.order"/></pre></div>
<div class="refdescription"><a name="d0e376"></a>
<p>This template is called to process all of the children of the
<code class="literal">t:titlepage-content</code> element. It creates the hairy
select expression necessary to process each of those elements in
the title page.
</p>
<p>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.
</p>
<p>It also automatically calculates the name for the *info container
and handles elements that have historically had containers with different
names.
</p>
</div>
</div>
<div class="refentry" lang="en">
<div class="refentry.separator">
<hr>
</div><a name="d0e390"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>* (in document.order mode) — Create rules to process titlepage elements in stylesheet order</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><xsl:template match="*" mode="document.order"/></pre></div>
<div class="refdescription"><a name="d0e399"></a>
<p>This template is called to process all of the children of the
<code class="literal">t:titlepage-content</code> element. It creates the set
of <code class="literal">xsl:apply-templates</code> elements necessary
process each of those elements in the title page.
</p>
<p>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.
</p>
<p>It also automatically calculates the name for the *info container
and handles elements that have historically had containers with different
names.
</p>
</div>
</div>
<div class="refentry" lang="en">
<div class="refentry.separator">
<hr>
</div><a name="d0e416"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>* (in titlepage.specialrules mode) — Create templates for special rules</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><xsl:template match="*" mode="titlepage.specialrules"/></pre></div>
<div class="refdescription"><a name="d0e425"></a>
<p>This template is called to process all of the descendants of the
<code class="literal">t:titlepage-content</code> element that require special
processing. At present, that's just <code class="literal">t:or</code> elements.
</p>
</div>
</div>
<div class="refentry" lang="en">
<div class="refentry.separator">
<hr>
</div><a name="d0e436"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>* (in titlepage.subrules mode) — Create template for individual special rules</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><xsl:template match="*" mode="titlepage.subrules"/></pre></div>
<div class="refdescription"><a name="d0e445"></a>
<p>This template is called to process the children of special
template elements.
</p>
</div>
</div>
<div class="refentry" lang="en">
<div class="refentry.separator">
<hr>
</div><a name="d0e450"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>t:or — Process the t:or special rule</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><xsl:template match="t:or"/><xsl:template match="t:or" mode="titlepage.subrules"/></pre></div>
<div class="refdescription"><a name="d0e459"></a>
<p>This template processes t:or.</p>
</div>
</div>
<div class="refentry" lang="en">
<div class="refentry.separator">
<hr>
</div><a name="d0e464"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>t:or (in titlepage.subrules mode) — Process the t:or special rule in
titlepage.subrules mode
</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><xsl:template match="t:or" mode="titlepage.subrules"/></pre></div>
<div class="refdescription"><a name="d0e473"></a>
<p>The titlepage.subrules mode doesn't apply to t:or, so just
reprocess this node in the normal mode.
</p>
</div>
</div>
<div class="refentry" lang="en">
<div class="refentry.separator">
<hr>
</div><a name="template.element-or-list"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>element-or-list — Construct the "or-list" used in the select attribute for
special rules.
</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2><pre class="synopsis"><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></pre></div>
<div class="refdescription"><a name="d0e487"></a>
<p>Walk through each of the children of t:or, producing the
text of the select attribute.
</p>
</div>
</div>
</div>
</body>
</html>