3 <reference xml:id="template"><?dbhtml dir="template"?><?dbhtml filename="index.html"?>
7 <title>Titlepage Template Stylesheet Reference</title>
8 <releaseinfo role="meta">
9 $Id: titlepage.xsl 7058 2007-07-17 13:59:29Z xmldoc $
12 <partintro xml:id="intro_partintro">
13 <title>Introduction</title>
15 <para>This is technical reference documentation for the
16 “titlepage” templates in the DocBook XSL Stylesheets.</para>
19 <para>This is not intended to be user documentation. It is
20 provided for developers writing customization layers for the
25 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="templates">
27 <refname>t:templates</refname>
28 <refpurpose>Construct a stylesheet for the templates provided</refpurpose>
31 <synopsis><xsl:template match="t:templates"/></synopsis>
33 <refsect1><title>Description</title>
35 <para>The <literal>t:templates</literal> element is the root of a
36 set of templates. This template creates an appropriate
37 <literal>xsl:stylesheet</literal> for the templates.</para>
41 <para>If the <literal>t:templates</literal> element has a
42 <literal>base-stylesheet</literal> attribute, an
43 <literal>xsl:import</literal> statement is constructed for it.</para>
45 </refsect1></refentry>
47 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="star">
49 <refname>xsl:*</refname>
50 <refpurpose>Copy xsl: elements straight through</refpurpose>
53 <synopsis><xsl:template match="xsl:*"/></synopsis>
55 <refsect1><title>Description</title>
57 <para>This template simply copies the xsl: elements
58 straight through into the result tree.</para>
60 </refsect1></refentry>
62 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="titlepage">
64 <refname>t:titlepage</refname>
65 <refpurpose>Create the templates necessary to construct a title page</refpurpose>
68 <synopsis><xsl:template match="t:titlepage"/></synopsis>
70 <refsect1><title>Description</title>
72 <para>The <literal>t:titlepage</literal> element creates a set of
73 templates for processing the titlepage for an element. The
74 <quote>root</quote> of this template set is the template named
75 <quote><literal>wrapper.titlepage</literal></quote>. That is the
76 template that should be called to generate the title page.
81 <para>The <literal>t:titlepage</literal> element has three attributes:
85 <varlistentry><term>element</term>
87 <para>The name of the source document element for which
88 these templates apply. In other words, to make a title page for the
89 <tag>article</tag> element, set the
90 <tag class="attribute">element</tag> attribute to
91 <quote><literal>article</literal></quote>. This attribute is required.
95 <varlistentry><term>wrapper</term>
97 <para>The entire title page can be wrapped with an element.
98 This attribute identifies that element.
102 <varlistentry><term>class</term>
104 <para>If the <tag class="attribute">class</tag> attribute
105 is set, a <tag class="attribute">class</tag> attribute with this
106 value will be added to the wrapper element that surrounds the entire
117 <para>Any other attributes are copied through literally to the
118 wrapper element.</para>
122 <para>The content of a <literal>t:titlepage</literal> is one or
123 more <literal>t:titlepage-content</literal>,
124 <literal>t:titlepage-separator</literal>, and
125 <literal>t:titlepage-before</literal> elements.</para>
129 <para>Each of these elements may be provided for the <quote>recto</quote>
130 and <quote>verso</quote> sides of the title page.</para>
133 </refsect1></refentry>
135 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="attr_star_in_copy.literal.atts">
137 <refname>@* (in copy.literal.atts mode)</refname>
138 <refpurpose>Copy t:titlepage attributes</refpurpose>
141 <synopsis><xsl:template match="@*" mode="copy.literal.atts"/></synopsis>
143 <refsect1><title>Description</title>
145 <para>This template copies all of the <quote>other</quote> attributes
146 from a <literal>t:titlepage</literal> element onto the specified
149 </refsect1></refentry>
151 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="titlepage-content">
153 <refname>t:titlepage-content</refname>
154 <refpurpose>Create templates for the content of one side of a title page</refpurpose>
157 <synopsis><xsl:template match="t:titlepage-content"/></synopsis>
159 <refsect1><title>Description</title>
161 <para>The title page content, that is, the elements from the source
162 document that are rendered on the title page, can be controlled independently
163 for the recto and verso sides of the title page.</para>
167 <para>The <literal>t:titlepage-content</literal> element has two attributes:
171 <varlistentry><term>side</term>
173 <para>Identifies the side of the page to which this title
174 page content applies. The
175 <tag class="attribute">side</tag> attribute is required and
176 must be set to either
177 <quote><literal>recto</literal></quote> or
178 <quote><literal>verso</literal></quote>. In addition, you must specify
179 exactly one <literal>t:titlepage-content</literal> for each side
180 within each <literal>t:titlepage</literal>.</para>
184 <varlistentry><term>order</term>
186 <para>Indicates how the order of the elements presented on
187 the title page is determined. If the
188 <tag class="attribute">order</tag> is
189 <quote><literal>document</literal></quote>, the elements are presented
190 in document order. Otherwise (if the
191 <tag class="attribute">order</tag> is
192 <quote><literal>stylesheet</literal></quote>), the elements are presented
193 in the order that they appear in the template (and consequently in
194 the stylesheet).</para>
204 <para>The content of a <literal>t:titlepage-content</literal> element is
205 a list of element names. These names should be unqualified. They identify
206 the elements in the source document that should appear on the title page.
211 <para>Each element may have a single attribute:
212 <tag class="attribute">predicate</tag>. The value of this
213 attribute is used as a predicate for the expression that matches
214 the element on which it occurs.</para>
218 <para>In other words, to put only the first three authors on the
219 recto-side of a title
220 page, you could specify:
223 <t:titlepage-contents side="recto">
224 <!-- other titlepage elements -->
225 <author predicate="[count(previous-sibling::author)<2]"/>
226 <!-- other titlepage elements -->
227 </t:titlepage-contents>
233 <para>Usually, the elements so named are empty. But it is possible to
234 make one level of selection within them. Suppose that you want to
235 process <literal>authorgroup</literal> elements on the title page, but
236 you want to select only proper authors, editors, or corporate authors,
237 not collaborators or other credited authors.</para>
241 <para>In that case, you can put a <literal>t:or</literal> group inside
242 the <literal>authorgroup</literal> element:
245 <t:titlepage-contents side="recto">
246 <!-- other titlepage elements -->
254 <!-- other titlepage elements -->
255 </t:titlepage-contents>
261 <para>This will have the effect of automatically generating a template
262 for processing <literal>authorgroup</literal>s in the title page mode,
263 selecting only the specified children. If you need more complex processing,
264 you'll have to construct the templates by hand.</para>
267 </refsect1></refentry>
269 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="titlepage-separator">
271 <refname>t:titlepage-separator</refname>
272 <refpurpose>Create templates for the separator</refpurpose>
275 <synopsis><xsl:template match="t:titlepage-separator"/></synopsis>
277 <refsect1><title>Description</title>
279 <para>The title page is separated from the content which follows it by
280 the markup specified in the <literal>t:titlepage-separator</literal>
283 </refsect1></refentry>
285 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="titlepage-before">
287 <refname>t:titlepage-before</refname>
288 <refpurpose>Create templates for what precedes a title page</refpurpose>
291 <synopsis><xsl:template match="t:titlepage-before"/></synopsis>
293 <refsect1><title>Description</title>
295 <para>Each side of the title page is preceded by the markup specified
296 in the <literal>t:titlepage-before</literal> element for that
299 </refsect1></refentry>
301 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="star_in_copy">
303 <refname>* (in copy mode)</refname>
304 <refpurpose>Copy elements</refpurpose>
307 <synopsis><xsl:template match="*" mode="copy"/></synopsis>
309 <refsect1><title>Description</title>
311 <para>This template simply copies the elements that it applies to
312 straight through into the result tree.</para>
314 </refsect1></refentry>
316 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="attr_star_in_copy">
318 <refname>@* (in copy mode)</refname>
319 <refpurpose>Copy attributes</refpurpose>
322 <synopsis><xsl:template match="@*" mode="copy"/></synopsis>
324 <refsect1><title>Description</title>
326 <para>This template simply copies the attributes that it applies to
327 straight through into the result tree.</para>
329 </refsect1></refentry>
331 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="attr_star_in_document.order">
333 <refname>* (in document.order mode)</refname>
334 <refpurpose>Create rules to process titlepage elements in document order</refpurpose>
337 <synopsis><xsl:template match="*" mode="document.order"/></synopsis>
339 <refsect1><title>Description</title>
341 <para>This template is called to process all of the children of the
342 <literal>t:titlepage-content</literal> element. It creates the hairy
343 select expression necessary to process each of those elements in
344 the title page.</para>
348 <para>Note that this template automatically handles the case where
349 some DocBook elements, like title and subtitle, can occur both inside
350 the *info elements where metadata is usually stored and outside.
355 <para>It also automatically calculates the name for the *info container
356 and handles elements that have historically had containers with different
360 </refsect1></refentry>
362 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="star_in_document.order">
364 <refname>* (in document.order mode)</refname>
365 <refpurpose>Create rules to process titlepage elements in stylesheet order</refpurpose>
368 <synopsis><xsl:template match="*" mode="document.order"/></synopsis>
370 <refsect1><title>Description</title>
372 <para>This template is called to process all of the children of the
373 <literal>t:titlepage-content</literal> element. It creates the set
374 of <literal>xsl:apply-templates</literal> elements necessary
375 process each of those elements in the title page.</para>
379 <para>Note that this template automatically handles the case where
380 some DocBook elements, like title and subtitle, can occur both inside
381 the *info elements where metadata is usually stored and outside.
386 <para>It also automatically calculates the name for the *info container
387 and handles elements that have historically had containers with different
391 </refsect1></refentry>
393 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="star_in_titlepage.specialrules">
395 <refname>* (in titlepage.specialrules mode)</refname>
396 <refpurpose>Create templates for special rules</refpurpose>
399 <synopsis><xsl:template match="*" mode="titlepage.specialrules"/></synopsis>
401 <refsect1><title>Description</title>
403 <para>This template is called to process all of the descendants of the
404 <literal>t:titlepage-content</literal> element that require special
405 processing. At present, that's just <literal>t:or</literal> elements.
408 </refsect1></refentry>
410 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="star_in_titlepage.subrules">
412 <refname>* (in titlepage.subrules mode)</refname>
413 <refpurpose>Create template for individual special rules</refpurpose>
416 <synopsis><xsl:template match="*" mode="titlepage.subrules"/></synopsis>
418 <refsect1><title>Description</title>
420 <para>This template is called to process the children of special
424 </refsect1></refentry>
426 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="or">
428 <refname>t:or</refname>
429 <refpurpose>Process the t:or special rule</refpurpose>
432 <synopsis><xsl:template match="t:or"/><xsl:template match="t:or" mode="titlepage.subrules"/></synopsis>
434 <refsect1><title>Description</title>
436 <para>This template processes t:or.</para>
438 </refsect1></refentry>
440 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="or_in_titlepage.subrules">
442 <refname>t:or (in titlepage.subrules mode)</refname>
443 <refpurpose>Process the t:or special rule in
444 titlepage.subrules mode</refpurpose>
447 <synopsis><xsl:template match="t:or" mode="titlepage.subrules"/></synopsis>
449 <refsect1><title>Description</title>
451 <para>The titlepage.subrules mode doesn't apply to t:or, so just
452 reprocess this node in the normal mode.</para>
454 </refsect1></refentry>
456 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.element-or-list">
458 <refname>element-or-list</refname>
459 <refpurpose>Construct the "or-list" used in the select attribute for
460 special rules.</refpurpose>
463 <synopsis><xsl:template name="element-or-list">
464 <xsl:param name="elements" select="*"/>
465 <xsl:param name="element.count" select="count($elements)"/>
466 <xsl:param name="count" select="1"/>
467 <xsl:param name="orlist"/>
469 </xsl:template></synopsis>
471 <refsect1><title>Description</title>
473 <para>Walk through each of the children of t:or, producing the
474 text of the select attribute.</para>
476 </refsect1></refentry>