Debian Codegraph @

docbook-xsl-ns/template/titlepage.xml

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