OLD | NEW |
| (Empty) |
1 <?xml version="1.0"?> | |
2 | |
3 <reference xml:id="template"><?dbhtml dir="template"?><?dbhtml filename="index.h
tml"?> | |
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><xsl:template match="t:templates"/></synopsis> | |
32 </refsynopsisdiv> | |
33 <refsect1><title>Description</title> | |
34 | |
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> | |
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><xsl:template match="xsl:*"/></synopsis> | |
54 </refsynopsisdiv> | |
55 <refsect1><title>Description</title> | |
56 | |
57 <para>This template simply copies the xsl: elements | |
58 straight 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><xsl:template match="t:titlepage"/></synopsis> | |
69 </refsynopsisdiv> | |
70 <refsect1><title>Description</title> | |
71 | |
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. | |
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 | |
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. | |
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. | |
98 This 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 | |
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 | |
107 title 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 | |
118 wrapper element.</para> | |
119 | |
120 | |
121 | |
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> | |
126 | |
127 | |
128 | |
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> | |
131 | |
132 | |
133 </refsect1></refentry> | |
134 | |
135 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="attr_star_in_copy.l
iteral.atts"> | |
136 <refnamediv> | |
137 <refname>@* (in copy.literal.atts mode)</refname> | |
138 <refpurpose>Copy t:titlepage attributes</refpurpose> | |
139 </refnamediv> | |
140 <refsynopsisdiv> | |
141 <synopsis><xsl:template match="@*" mode="copy.literal.atts"/></synopsis> | |
142 </refsynopsisdiv> | |
143 <refsect1><title>Description</title> | |
144 | |
145 <para>This template copies all of the <quote>other</quote> attributes | |
146 from a <literal>t:titlepage</literal> element onto the specified | |
147 wrapper.</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</refpur
pose> | |
155 </refnamediv> | |
156 <refsynopsisdiv> | |
157 <synopsis><xsl:template match="t:titlepage-content"/></synopsis> | |
158 </refsynopsisdiv> | |
159 <refsect1><title>Description</title> | |
160 | |
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> | |
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 | |
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> | |
181 | |
182 </listitem> | |
183 </varlistentry> | |
184 <varlistentry><term>order</term> | |
185 <listitem> | |
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> | |
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 | |
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. | |
207 </para> | |
208 | |
209 | |
210 | |
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> | |
215 | |
216 | |
217 | |
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: | |
221 | |
222 <screen> | |
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> | |
228 </screen> | |
229 </para> | |
230 | |
231 | |
232 | |
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> | |
238 | |
239 | |
240 | |
241 <para>In that case, you can put a <literal>t:or</literal> group inside | |
242 the <literal>authorgroup</literal> element: | |
243 | |
244 <screen> | |
245 <t:titlepage-contents side="recto"> | |
246 <!-- other titlepage elements --> | |
247 <authorgroup> | |
248 <t:or> | |
249 <author/> | |
250 <editor/> | |
251 <corpauthor/> | |
252 </t:or> | |
253 </authorgroup> | |
254 <!-- other titlepage elements --> | |
255 </t:titlepage-contents> | |
256 </screen> | |
257 </para> | |
258 | |
259 | |
260 | |
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> | |
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><xsl:template match="t:titlepage-separator"/></synopsis> | |
276 </refsynopsisdiv> | |
277 <refsect1><title>Description</title> | |
278 | |
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> | |
281 element.</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><xsl:template match="t:titlepage-before"/></synopsis> | |
292 </refsynopsisdiv> | |
293 <refsect1><title>Description</title> | |
294 | |
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 | |
297 side.</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><xsl:template match="*" mode="copy"/></synopsis> | |
308 </refsynopsisdiv> | |
309 <refsect1><title>Description</title> | |
310 | |
311 <para>This template simply copies the elements that it applies to | |
312 straight 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><xsl:template match="@*" mode="copy"/></synopsis> | |
323 </refsynopsisdiv> | |
324 <refsect1><title>Description</title> | |
325 | |
326 <para>This template simply copies the attributes that it applies to | |
327 straight 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_docume
nt.order"> | |
332 <refnamediv> | |
333 <refname>* (in document.order mode)</refname> | |
334 <refpurpose>Create rules to process titlepage elements in document order</refpur
pose> | |
335 </refnamediv> | |
336 <refsynopsisdiv> | |
337 <synopsis><xsl:template match="*" mode="document.order"/></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 | |
343 select expression necessary to process each of those elements in | |
344 the title page.</para> | |
345 | |
346 | |
347 | |
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. | |
351 </para> | |
352 | |
353 | |
354 | |
355 <para>It also automatically calculates the name for the *info container | |
356 and handles elements that have historically had containers with different | |
357 names.</para> | |
358 | |
359 | |
360 </refsect1></refentry> | |
361 | |
362 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="star_in_document.or
der"> | |
363 <refnamediv> | |
364 <refname>* (in document.order mode)</refname> | |
365 <refpurpose>Create rules to process titlepage elements in stylesheet order</refp
urpose> | |
366 </refnamediv> | |
367 <refsynopsisdiv> | |
368 <synopsis><xsl:template match="*" mode="document.order"/></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 | |
374 of <literal>xsl:apply-templates</literal> elements necessary | |
375 process each of those elements in the title page.</para> | |
376 | |
377 | |
378 | |
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. | |
382 </para> | |
383 | |
384 | |
385 | |
386 <para>It also automatically calculates the name for the *info container | |
387 and handles elements that have historically had containers with different | |
388 names.</para> | |
389 | |
390 | |
391 </refsect1></refentry> | |
392 | |
393 <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="star_in_titlepage.s
pecialrules"> | |
394 <refnamediv> | |
395 <refname>* (in titlepage.specialrules mode)</refname> | |
396 <refpurpose>Create templates for special rules</refpurpose> | |
397 </refnamediv> | |
398 <refsynopsisdiv> | |
399 <synopsis><xsl:template match="*" mode="titlepage.specialrules"/></synopsi
s> | |
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 | |
405 processing. 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.s
ubrules"> | |
411 <refnamediv> | |
412 <refname>* (in titlepage.subrules mode)</refname> | |
413 <refpurpose>Create template for individual special rules</refpurpose> | |
414 </refnamediv> | |
415 <refsynopsisdiv> | |
416 <synopsis><xsl:template match="*" mode="titlepage.subrules"/></synopsis> | |
417 </refsynopsisdiv> | |
418 <refsect1><title>Description</title> | |
419 | |
420 <para>This template is called to process the children of special | |
421 template 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><xsl:template match="t:or"/><xsl:template match="t:or" mode="
titlepage.subrules"/></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.sub
rules"> | |
441 <refnamediv> | |
442 <refname>t:or (in titlepage.subrules mode)</refname> | |
443 <refpurpose>Process the t:or special rule in | |
444 titlepage.subrules mode</refpurpose> | |
445 </refnamediv> | |
446 <refsynopsisdiv> | |
447 <synopsis><xsl:template match="t:or" mode="titlepage.subrules"/></synopsis
> | |
448 </refsynopsisdiv> | |
449 <refsect1><title>Description</title> | |
450 | |
451 <para>The titlepage.subrules mode doesn't apply to t:or, so just | |
452 reprocess 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 | |
460 special rules.</refpurpose> | |
461 </refnamediv> | |
462 <refsynopsisdiv> | |
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"/> | |
468 ... | |
469 </xsl:template></synopsis> | |
470 </refsynopsisdiv> | |
471 <refsect1><title>Description</title> | |
472 | |
473 <para>Walk through each of the children of t:or, producing the | |
474 text of the select attribute.</para> | |
475 | |
476 </refsect1></refentry> | |
477 </reference> | |
478 | |
OLD | NEW |