source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/template/titlepage.xml@ c8e0d1d

Last change on this file since c8e0d1d was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 14.7 KB
Line 
1<?xml version="1.0"?>
2
3<reference xml:id="template"><?dbhtml dir="template"?><?dbhtml filename="index.html"?>
4
5
6 <info>
7 <title>Titlepage Template Stylesheet Reference</title>
8 <releaseinfo role="meta">
9 $Id: titlepage.xsl 9600 2012-09-11 12:12:09Z kosek $
10 </releaseinfo>
11 </info>
12 <partintro xml:id="intro_partintro">
13 <title>Introduction</title>
14
15<para>This is technical reference documentation for the
16 “titlepage” templates in the DocBook XSL Stylesheets.</para>
17
18
19<para>This is not intended to be user documentation. It is
20 provided for developers writing customization layers for the
21 stylesheets.</para>
22
23 </partintro>
24
25<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="templates">
26<refnamediv>
27<refname>t:templates</refname>
28<refpurpose>Construct a stylesheet for the templates provided</refpurpose>
29</refnamediv>
30<refsynopsisdiv>
31<synopsis>&lt;xsl:template match="t:templates"/&gt;</synopsis>
32</refsynopsisdiv>
33<refsect1><title>Description</title>
34
35<para>The <literal>t:templates</literal> element is the root of a
36set of templates. This template creates an appropriate
37<literal>xsl:stylesheet</literal> for the templates.</para>
38
39
40
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>
44
45</refsect1></refentry>
46
47<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="star">
48<refnamediv>
49<refname>xsl:*</refname>
50<refpurpose>Copy xsl: elements straight through</refpurpose>
51</refnamediv>
52<refsynopsisdiv>
53<synopsis>&lt;xsl:template match="xsl:*"/&gt;</synopsis>
54</refsynopsisdiv>
55<refsect1><title>Description</title>
56
57<para>This template simply copies the xsl: elements
58straight through into the result tree.</para>
59
60</refsect1></refentry>
61
62<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="titlepage">
63<refnamediv>
64<refname>t:titlepage</refname>
65<refpurpose>Create the templates necessary to construct a title page</refpurpose>
66</refnamediv>
67<refsynopsisdiv>
68<synopsis>&lt;xsl:template match="t:titlepage"/&gt;</synopsis>
69</refsynopsisdiv>
70<refsect1><title>Description</title>
71
72<para>The <literal>t:titlepage</literal> element creates a set of
73templates 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
76template that should be called to generate the title page.
77</para>
78
79
80
81<para>The <literal>t:titlepage</literal> element has three attributes:
82
83
84<variablelist>
85<varlistentry><term>element</term>
86<listitem>
87<para>The name of the source document element for which
88these 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.
92</para>
93</listitem>
94</varlistentry>
95<varlistentry><term>wrapper</term>
96<listitem>
97<para>The entire title page can be wrapped with an element.
98This attribute identifies that element.
99</para>
100</listitem>
101</varlistentry>
102<varlistentry><term>class</term>
103<listitem>
104<para>If the <tag class="attribute">class</tag> attribute
105is set, a <tag class="attribute">class</tag> attribute with this
106value will be added to the wrapper element that surrounds the entire
107title page.
108</para>
109</listitem>
110</varlistentry>
111</variablelist>
112
113</para>
114
115
116
117<para>Any other attributes are copied through literally to the
118wrapper element.</para>
119
120
121
122<para>The content of a <literal>t:titlepage</literal> is one or
123more <literal>t:titlepage-content</literal>,
124<literal>t:titlepage-separator</literal>, and
125<literal>t:titlepage-before</literal> elements.</para>
126
127
128
129<para>Each of these elements may be provided for the <quote>recto</quote>
130and <quote>verso</quote> sides of the title page.</para>
131
132
133</refsect1></refentry>
134
135<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="attr_star_in_copy.literal.atts">
136<refnamediv>
137<refname>@* (in copy.literal.atts mode)</refname>
138<refpurpose>Copy t:titlepage attributes</refpurpose>
139</refnamediv>
140<refsynopsisdiv>
141<synopsis>&lt;xsl:template match="@*" mode="copy.literal.atts"/&gt;</synopsis>
142</refsynopsisdiv>
143<refsect1><title>Description</title>
144
145<para>This template copies all of the <quote>other</quote> attributes
146from a <literal>t:titlepage</literal> element onto the specified
147wrapper.</para>
148
149</refsect1></refentry>
150
151<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="titlepage-content">
152<refnamediv>
153<refname>t:titlepage-content</refname>
154<refpurpose>Create templates for the content of one side of a title page</refpurpose>
155</refnamediv>
156<refsynopsisdiv>
157<synopsis>&lt;xsl:template match="t:titlepage-content"/&gt;</synopsis>
158</refsynopsisdiv>
159<refsect1><title>Description</title>
160
161<para>The title page content, that is, the elements from the source
162document that are rendered on the title page, can be controlled independently
163for the recto and verso sides of the title page.</para>
164
165
166
167<para>The <literal>t:titlepage-content</literal> element has two attributes:
168
169
170<variablelist>
171<varlistentry><term>side</term>
172<listitem>
173<para>Identifies the side of the page to which this title
174page content applies. The
175<tag class="attribute">side</tag> attribute is required and
176must be set to either
177<quote><literal>recto</literal></quote> or
178<quote><literal>verso</literal></quote>. In addition, you must specify
179exactly one <literal>t:titlepage-content</literal> for each side
180within each <literal>t:titlepage</literal>.</para>
181
182</listitem>
183</varlistentry>
184<varlistentry><term>order</term>
185<listitem>
186<para>Indicates how the order of the elements presented on
187the title page is determined. If the
188<tag class="attribute">order</tag> is
189<quote><literal>document</literal></quote>, the elements are presented
190in document order. Otherwise (if the
191<tag class="attribute">order</tag> is
192<quote><literal>stylesheet</literal></quote>), the elements are presented
193in the order that they appear in the template (and consequently in
194the stylesheet).</para>
195
196</listitem>
197</varlistentry>
198</variablelist>
199
200</para>
201
202
203
204<para>The content of a <literal>t:titlepage-content</literal> element is
205a list of element names. These names should be unqualified. They identify
206the elements in the source document that should appear on the title page.
207</para>
208
209
210
211<para>Each element may have a single attribute:
212<tag class="attribute">predicate</tag>. The value of this
213attribute is used as a predicate for the expression that matches
214the element on which it occurs.</para>
215
216
217
218<para>In other words, to put only the first three authors on the
219recto-side of a title
220page, you could specify:
221
222<screen>
223 &lt;t:titlepage-contents side="recto"&gt;
224 &lt;!-- other titlepage elements --&gt;
225 &lt;author predicate="[count(previous-sibling::author)&lt;2]"/&gt;
226 &lt;!-- other titlepage elements --&gt;
227 &lt;/t:titlepage-contents&gt;
228</screen>
229</para>
230
231
232
233<para>Usually, the elements so named are empty. But it is possible to
234make one level of selection within them. Suppose that you want to
235process <literal>authorgroup</literal> elements on the title page, but
236you want to select only proper authors, editors, or corporate authors,
237not collaborators or other credited authors.</para>
238
239
240
241<para>In that case, you can put a <literal>t:or</literal> group inside
242the <literal>authorgroup</literal> element:
243
244<screen>
245 &lt;t:titlepage-contents side="recto"&gt;
246 &lt;!-- other titlepage elements --&gt;
247 &lt;authorgroup&gt;
248 &lt;t:or&gt;
249 &lt;author/&gt;
250 &lt;editor/&gt;
251 &lt;corpauthor/&gt;
252 &lt;/t:or&gt;
253 &lt;/authorgroup&gt;
254 &lt;!-- other titlepage elements --&gt;
255 &lt;/t:titlepage-contents&gt;
256</screen>
257</para>
258
259
260
261<para>This will have the effect of automatically generating a template
262for processing <literal>authorgroup</literal>s in the title page mode,
263selecting only the specified children. If you need more complex processing,
264you'll have to construct the templates by hand.</para>
265
266
267</refsect1></refentry>
268
269<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="titlepage-separator">
270<refnamediv>
271<refname>t:titlepage-separator</refname>
272<refpurpose>Create templates for the separator</refpurpose>
273</refnamediv>
274<refsynopsisdiv>
275<synopsis>&lt;xsl:template match="t:titlepage-separator"/&gt;</synopsis>
276</refsynopsisdiv>
277<refsect1><title>Description</title>
278
279<para>The title page is separated from the content which follows it by
280the markup specified in the <literal>t:titlepage-separator</literal>
281element.</para>
282
283</refsect1></refentry>
284
285<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="titlepage-before">
286<refnamediv>
287<refname>t:titlepage-before</refname>
288<refpurpose>Create templates for what precedes a title page</refpurpose>
289</refnamediv>
290<refsynopsisdiv>
291<synopsis>&lt;xsl:template match="t:titlepage-before"/&gt;</synopsis>
292</refsynopsisdiv>
293<refsect1><title>Description</title>
294
295<para>Each side of the title page is preceded by the markup specified
296in the <literal>t:titlepage-before</literal> element for that
297side.</para>
298
299</refsect1></refentry>
300
301<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="star_in_copy">
302<refnamediv>
303<refname>* (in copy mode)</refname>
304<refpurpose>Copy elements</refpurpose>
305</refnamediv>
306<refsynopsisdiv>
307<synopsis>&lt;xsl:template match="*" mode="copy"/&gt;</synopsis>
308</refsynopsisdiv>
309<refsect1><title>Description</title>
310
311<para>This template simply copies the elements that it applies to
312straight through into the result tree.</para>
313
314</refsect1></refentry>
315
316<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="attr_star_in_copy">
317<refnamediv>
318<refname>@* (in copy mode)</refname>
319<refpurpose>Copy attributes</refpurpose>
320</refnamediv>
321<refsynopsisdiv>
322<synopsis>&lt;xsl:template match="@*" mode="copy"/&gt;</synopsis>
323</refsynopsisdiv>
324<refsect1><title>Description</title>
325
326<para>This template simply copies the attributes that it applies to
327straight through into the result tree.</para>
328
329</refsect1></refentry>
330
331<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="attr_star_in_document.order">
332<refnamediv>
333<refname>* (in document.order mode)</refname>
334<refpurpose>Create rules to process titlepage elements in document order</refpurpose>
335</refnamediv>
336<refsynopsisdiv>
337<synopsis>&lt;xsl:template match="*" mode="document.order"/&gt;</synopsis>
338</refsynopsisdiv>
339<refsect1><title>Description</title>
340
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
343select expression necessary to process each of those elements in
344the title page.</para>
345
346
347
348<para>Note that this template automatically handles the case where
349some DocBook elements, like title and subtitle, can occur both inside
350the *info elements where metadata is usually stored and outside.
351</para>
352
353
354
355<para>It also automatically calculates the name for the *info container
356and handles elements that have historically had containers with different
357names.</para>
358
359
360</refsect1></refentry>
361
362<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="star_in_document.order">
363<refnamediv>
364<refname>* (in document.order mode)</refname>
365<refpurpose>Create rules to process titlepage elements in stylesheet order</refpurpose>
366</refnamediv>
367<refsynopsisdiv>
368<synopsis>&lt;xsl:template match="*" mode="document.order"/&gt;</synopsis>
369</refsynopsisdiv>
370<refsect1><title>Description</title>
371
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
374of <literal>xsl:apply-templates</literal> elements necessary
375process each of those elements in the title page.</para>
376
377
378
379<para>Note that this template automatically handles the case where
380some DocBook elements, like title and subtitle, can occur both inside
381the *info elements where metadata is usually stored and outside.
382</para>
383
384
385
386<para>It also automatically calculates the name for the *info container
387and handles elements that have historically had containers with different
388names.</para>
389
390
391</refsect1></refentry>
392
393<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="star_in_titlepage.specialrules">
394<refnamediv>
395<refname>* (in titlepage.specialrules mode)</refname>
396<refpurpose>Create templates for special rules</refpurpose>
397</refnamediv>
398<refsynopsisdiv>
399<synopsis>&lt;xsl:template match="*" mode="titlepage.specialrules"/&gt;</synopsis>
400</refsynopsisdiv>
401<refsect1><title>Description</title>
402
403<para>This template is called to process all of the descendants of the
404<literal>t:titlepage-content</literal> element that require special
405processing. At present, that's just <literal>t:or</literal> elements.
406</para>
407
408</refsect1></refentry>
409
410<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="star_in_titlepage.subrules">
411<refnamediv>
412<refname>* (in titlepage.subrules mode)</refname>
413<refpurpose>Create template for individual special rules</refpurpose>
414</refnamediv>
415<refsynopsisdiv>
416<synopsis>&lt;xsl:template match="*" mode="titlepage.subrules"/&gt;</synopsis>
417</refsynopsisdiv>
418<refsect1><title>Description</title>
419
420<para>This template is called to process the children of special
421template elements.
422</para>
423
424</refsect1></refentry>
425
426<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="or">
427<refnamediv>
428<refname>t:or</refname>
429<refpurpose>Process the t:or special rule</refpurpose>
430</refnamediv>
431<refsynopsisdiv>
432<synopsis>&lt;xsl:template match="t:or"/&gt;&lt;xsl:template match="t:or" mode="titlepage.subrules"/&gt;</synopsis>
433</refsynopsisdiv>
434<refsect1><title>Description</title>
435
436<para>This template processes t:or.</para>
437
438</refsect1></refentry>
439
440<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="or_in_titlepage.subrules">
441<refnamediv>
442<refname>t:or (in titlepage.subrules mode)</refname>
443<refpurpose>Process the t:or special rule in
444titlepage.subrules mode</refpurpose>
445</refnamediv>
446<refsynopsisdiv>
447<synopsis>&lt;xsl:template match="t:or" mode="titlepage.subrules"/&gt;</synopsis>
448</refsynopsisdiv>
449<refsect1><title>Description</title>
450
451<para>The titlepage.subrules mode doesn't apply to t:or, so just
452reprocess this node in the normal mode.</para>
453
454</refsect1></refentry>
455
456<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.element-or-list">
457<refnamediv>
458<refname>element-or-list</refname>
459<refpurpose>Construct the "or-list" used in the select attribute for
460special rules.</refpurpose>
461</refnamediv>
462<refsynopsisdiv>
463<synopsis>&lt;xsl:template name="element-or-list"&gt;
464&lt;xsl:param name="elements" select="*"/&gt;
465&lt;xsl:param name="element.count" select="count($elements)"/&gt;
466&lt;xsl:param name="count" select="1"/&gt;
467&lt;xsl:param name="orlist"/&gt;
468 ...
469&lt;/xsl:template&gt;</synopsis>
470</refsynopsisdiv>
471<refsect1><title>Description</title>
472
473<para>Walk through each of the children of t:or, producing the
474text of the select attribute.</para>
475
476</refsect1></refentry>
477</reference>
478
Note: See TracBrowser for help on using the repository browser.