titlepage.xml 15 KB

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