titlepage.xsl 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. <?xml version='1.0'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  4. version='1.0'>
  5. <!-- ********************************************************************
  6. $Id$
  7. ********************************************************************
  8. This file is part of the XSL DocBook Stylesheet distribution.
  9. See ../README or http://docbook.sf.net/release/xsl/current/ for
  10. copyright and other information.
  11. ******************************************************************** -->
  12. <!-- ==================================================================== -->
  13. <xsl:attribute-set name="book.titlepage.recto.style">
  14. <xsl:attribute name="font-family">
  15. <xsl:value-of select="$title.fontset"/>
  16. </xsl:attribute>
  17. <xsl:attribute name="font-weight">bold</xsl:attribute>
  18. <xsl:attribute name="font-size">12pt</xsl:attribute>
  19. <xsl:attribute name="text-align">center</xsl:attribute>
  20. </xsl:attribute-set>
  21. <xsl:attribute-set name="book.titlepage.verso.style">
  22. <xsl:attribute name="font-size">10pt</xsl:attribute>
  23. </xsl:attribute-set>
  24. <xsl:attribute-set name="article.titlepage.recto.style"/>
  25. <xsl:attribute-set name="article.titlepage.verso.style"/>
  26. <xsl:attribute-set name="set.titlepage.recto.style"/>
  27. <xsl:attribute-set name="set.titlepage.verso.style"/>
  28. <xsl:attribute-set name="part.titlepage.recto.style">
  29. <xsl:attribute name="text-align">center</xsl:attribute>
  30. </xsl:attribute-set>
  31. <xsl:attribute-set name="part.titlepage.verso.style"/>
  32. <xsl:attribute-set name="partintro.titlepage.recto.style"/>
  33. <xsl:attribute-set name="partintro.titlepage.verso.style"/>
  34. <xsl:attribute-set name="reference.titlepage.recto.style"/>
  35. <xsl:attribute-set name="reference.titlepage.verso.style"/>
  36. <xsl:attribute-set name="dedication.titlepage.recto.style"/>
  37. <xsl:attribute-set name="dedication.titlepage.verso.style"/>
  38. <xsl:attribute-set name="preface.titlepage.recto.style"/>
  39. <xsl:attribute-set name="preface.titlepage.verso.style"/>
  40. <xsl:attribute-set name="chapter.titlepage.recto.style"/>
  41. <xsl:attribute-set name="chapter.titlepage.verso.style"/>
  42. <xsl:attribute-set name="appendix.titlepage.recto.style"/>
  43. <xsl:attribute-set name="appendix.titlepage.verso.style"/>
  44. <xsl:attribute-set name="bibliography.titlepage.recto.style"/>
  45. <xsl:attribute-set name="bibliography.titlepage.verso.style"/>
  46. <xsl:attribute-set name="bibliodiv.titlepage.recto.style"/>
  47. <xsl:attribute-set name="bibliodiv.titlepage.verso.style"/>
  48. <xsl:attribute-set name="glossary.titlepage.recto.style"/>
  49. <xsl:attribute-set name="glossary.titlepage.verso.style"/>
  50. <xsl:attribute-set name="glossdiv.titlepage.recto.style"/>
  51. <xsl:attribute-set name="glossdiv.titlepage.verso.style"/>
  52. <xsl:attribute-set name="index.titlepage.recto.style"/>
  53. <xsl:attribute-set name="index.titlepage.verso.style"/>
  54. <xsl:attribute-set name="setindex.titlepage.recto.style"/>
  55. <xsl:attribute-set name="setindex.titlepage.verso.style"/>
  56. <xsl:attribute-set name="indexdiv.titlepage.recto.style"/>
  57. <xsl:attribute-set name="indexdiv.titlepage.verso.style"/>
  58. <xsl:attribute-set name="colophon.titlepage.recto.style"/>
  59. <xsl:attribute-set name="colophon.titlepage.verso.style"/>
  60. <xsl:attribute-set name="sidebar.titlepage.recto.style"/>
  61. <xsl:attribute-set name="sidebar.titlepage.verso.style"/>
  62. <xsl:attribute-set name="qandaset.titlepage.recto.style"/>
  63. <xsl:attribute-set name="qandaset.titlepage.verso.style"/>
  64. <xsl:attribute-set name="section.titlepage.recto.style">
  65. <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
  66. </xsl:attribute-set>
  67. <xsl:attribute-set name="section.titlepage.verso.style">
  68. <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
  69. <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
  70. </xsl:attribute-set>
  71. <xsl:attribute-set name="sect1.titlepage.recto.style"
  72. use-attribute-sets="section.titlepage.recto.style"/>
  73. <xsl:attribute-set name="sect1.titlepage.verso.style"
  74. use-attribute-sets="section.titlepage.verso.style"/>
  75. <xsl:attribute-set name="sect2.titlepage.recto.style"
  76. use-attribute-sets="section.titlepage.recto.style"/>
  77. <xsl:attribute-set name="sect2.titlepage.verso.style"
  78. use-attribute-sets="section.titlepage.verso.style"/>
  79. <xsl:attribute-set name="sect3.titlepage.recto.style"
  80. use-attribute-sets="section.titlepage.recto.style"/>
  81. <xsl:attribute-set name="sect3.titlepage.verso.style"
  82. use-attribute-sets="section.titlepage.verso.style"/>
  83. <xsl:attribute-set name="sect4.titlepage.recto.style"
  84. use-attribute-sets="section.titlepage.recto.style"/>
  85. <xsl:attribute-set name="sect4.titlepage.verso.style"
  86. use-attribute-sets="section.titlepage.verso.style"/>
  87. <xsl:attribute-set name="sect5.titlepage.recto.style"
  88. use-attribute-sets="section.titlepage.recto.style"/>
  89. <xsl:attribute-set name="sect5.titlepage.verso.style"
  90. use-attribute-sets="section.titlepage.verso.style"/>
  91. <xsl:attribute-set name="simplesect.titlepage.recto.style"
  92. use-attribute-sets="section.titlepage.recto.style"/>
  93. <xsl:attribute-set name="simplesect.titlepage.verso.style"
  94. use-attribute-sets="section.titlepage.verso.style"/>
  95. <xsl:attribute-set name="refnamediv.titlepage.recto.style"
  96. use-attribute-sets="section.titlepage.recto.style"/>
  97. <xsl:attribute-set name="refnamediv.titlepage.verso.style"
  98. use-attribute-sets="section.titlepage.verso.style"/>
  99. <xsl:attribute-set name="refsynopsisdiv.titlepage.recto.style"
  100. use-attribute-sets="section.titlepage.recto.style"/>
  101. <xsl:attribute-set name="refsynopsisdiv.titlepage.verso.style"
  102. use-attribute-sets="section.titlepage.verso.style"/>
  103. <xsl:attribute-set name="refsection.titlepage.recto.style"
  104. use-attribute-sets="section.titlepage.recto.style"/>
  105. <xsl:attribute-set name="refsection.titlepage.verso.style"
  106. use-attribute-sets="section.titlepage.verso.style"/>
  107. <xsl:attribute-set name="refsect1.titlepage.recto.style"
  108. use-attribute-sets="section.titlepage.recto.style"/>
  109. <xsl:attribute-set name="refsect1.titlepage.verso.style"
  110. use-attribute-sets="section.titlepage.verso.style"/>
  111. <xsl:attribute-set name="refsect2.titlepage.recto.style"
  112. use-attribute-sets="section.titlepage.recto.style"/>
  113. <xsl:attribute-set name="refsect2.titlepage.verso.style"
  114. use-attribute-sets="section.titlepage.verso.style"/>
  115. <xsl:attribute-set name="refsect3.titlepage.recto.style"
  116. use-attribute-sets="section.titlepage.recto.style"/>
  117. <xsl:attribute-set name="refsect3.titlepage.verso.style"
  118. use-attribute-sets="section.titlepage.verso.style"/>
  119. <xsl:attribute-set name="table.of.contents.titlepage.recto.style"/>
  120. <xsl:attribute-set name="table.of.contents.titlepage.verso.style"/>
  121. <xsl:attribute-set name="list.of.tables.titlepage.recto.style"/>
  122. <xsl:attribute-set name="list.of.tables.contents.titlepage.verso.style"/>
  123. <xsl:attribute-set name="list.of.figures.titlepage.recto.style"/>
  124. <xsl:attribute-set name="list.of.figures.contents.titlepage.verso.style"/>
  125. <xsl:attribute-set name="list.of.equations.titlepage.recto.style"/>
  126. <xsl:attribute-set name="list.of.equations.contents.titlepage.verso.style"/>
  127. <xsl:attribute-set name="list.of.examples.titlepage.recto.style"/>
  128. <xsl:attribute-set name="list.of.examples.contents.titlepage.verso.style"/>
  129. <xsl:attribute-set name="list.of.procedures.titlepage.recto.style"/>
  130. <xsl:attribute-set name="list.of.procedures.contents.titlepage.verso.style"/>
  131. <xsl:attribute-set name="list.of.unknowns.titlepage.recto.style"/>
  132. <xsl:attribute-set name="list.of.unknowns.contents.titlepage.verso.style"/>
  133. <!-- ==================================================================== -->
  134. <xsl:template match="*" mode="titlepage.mode">
  135. <!-- if an element isn't found in this mode, try the default mode -->
  136. <xsl:apply-templates select="."/>
  137. </xsl:template>
  138. <xsl:template match="abbrev" mode="titlepage.mode">
  139. <xsl:apply-templates mode="titlepage.mode"/>
  140. </xsl:template>
  141. <xsl:template match="abstract" mode="titlepage.mode">
  142. <fo:block>
  143. <xsl:call-template name="formal.object.heading">
  144. <xsl:with-param name="title">
  145. <xsl:apply-templates select="." mode="title.markup"/>
  146. </xsl:with-param>
  147. </xsl:call-template>
  148. <xsl:apply-templates mode="titlepage.mode"/>
  149. </fo:block>
  150. </xsl:template>
  151. <xsl:template match="abstract/title" mode="titlepage.mode"/>
  152. <xsl:template match="abstract/title" mode="titlepage.abstract.title.mode">
  153. <xsl:apply-templates mode="titlepage.mode"/>
  154. </xsl:template>
  155. <xsl:template match="address" mode="titlepage.mode">
  156. <!-- use the normal address handling code -->
  157. <xsl:apply-templates select="."/>
  158. </xsl:template>
  159. <xsl:template match="affiliation" mode="titlepage.mode">
  160. <fo:block>
  161. <xsl:apply-templates mode="titlepage.mode"/>
  162. </fo:block>
  163. </xsl:template>
  164. <xsl:template match="artpagenums" mode="titlepage.mode">
  165. <xsl:apply-templates mode="titlepage.mode"/>
  166. </xsl:template>
  167. <xsl:template match="author" mode="titlepage.mode">
  168. <fo:block>
  169. <xsl:call-template name="anchor"/>
  170. <xsl:call-template name="person.name"/>
  171. <xsl:if test="affiliation/orgname">
  172. <xsl:text>, </xsl:text>
  173. <xsl:apply-templates select="affiliation/orgname" mode="titlepage.mode"/>
  174. </xsl:if>
  175. <xsl:if test="email|affiliation/address/email">
  176. <xsl:text> </xsl:text>
  177. <xsl:apply-templates select="(email|affiliation/address/email)[1]"/>
  178. </xsl:if>
  179. </fo:block>
  180. </xsl:template>
  181. <xsl:template match="authorblurb" mode="titlepage.mode">
  182. <xsl:apply-templates mode="titlepage.mode"/>
  183. </xsl:template>
  184. <xsl:template match="authorgroup" mode="titlepage.mode">
  185. <fo:wrapper>
  186. <xsl:call-template name="anchor"/>
  187. <xsl:apply-templates mode="titlepage.mode"/>
  188. </fo:wrapper>
  189. </xsl:template>
  190. <xsl:template match="authorinitials" mode="titlepage.mode">
  191. <xsl:apply-templates mode="titlepage.mode"/>
  192. </xsl:template>
  193. <xsl:template match="bibliomisc" mode="titlepage.mode">
  194. <xsl:apply-templates mode="titlepage.mode"/>
  195. </xsl:template>
  196. <xsl:template match="bibliomset" mode="titlepage.mode">
  197. <xsl:apply-templates mode="titlepage.mode"/>
  198. </xsl:template>
  199. <xsl:template match="collab" mode="titlepage.mode">
  200. <xsl:apply-templates mode="titlepage.mode"/>
  201. </xsl:template>
  202. <xsl:template match="confgroup" mode="titlepage.mode">
  203. <fo:block>
  204. <xsl:apply-templates mode="titlepage.mode"/>
  205. </fo:block>
  206. </xsl:template>
  207. <xsl:template match="confdates" mode="titlepage.mode">
  208. <fo:block>
  209. <xsl:apply-templates mode="titlepage.mode"/>
  210. </fo:block>
  211. </xsl:template>
  212. <xsl:template match="conftitle" mode="titlepage.mode">
  213. <fo:block>
  214. <xsl:apply-templates mode="titlepage.mode"/>
  215. </fo:block>
  216. </xsl:template>
  217. <xsl:template match="confnum" mode="titlepage.mode">
  218. <!-- suppress -->
  219. </xsl:template>
  220. <xsl:template match="contractnum" mode="titlepage.mode">
  221. <xsl:apply-templates mode="titlepage.mode"/>
  222. </xsl:template>
  223. <xsl:template match="contractsponsor" mode="titlepage.mode">
  224. <xsl:apply-templates mode="titlepage.mode"/>
  225. </xsl:template>
  226. <xsl:template match="contrib" mode="titlepage.mode">
  227. <xsl:apply-templates mode="titlepage.mode"/>
  228. </xsl:template>
  229. <xsl:template match="copyright" mode="titlepage.mode">
  230. <xsl:call-template name="gentext">
  231. <xsl:with-param name="key" select="'Copyright'"/>
  232. </xsl:call-template>
  233. <xsl:call-template name="gentext.space"/>
  234. <xsl:call-template name="dingbat">
  235. <xsl:with-param name="dingbat">copyright</xsl:with-param>
  236. </xsl:call-template>
  237. <xsl:call-template name="gentext.space"/>
  238. <xsl:call-template name="copyright.years">
  239. <xsl:with-param name="years" select="year"/>
  240. <xsl:with-param name="print.ranges" select="$make.year.ranges"/>
  241. <xsl:with-param name="single.year.ranges"
  242. select="$make.single.year.ranges"/>
  243. </xsl:call-template>
  244. <xsl:call-template name="gentext.space"/>
  245. <xsl:apply-templates select="holder" mode="titlepage.mode"/>
  246. </xsl:template>
  247. <xsl:template match="year" mode="titlepage.mode">
  248. <xsl:apply-templates/>
  249. </xsl:template>
  250. <xsl:template match="holder" mode="titlepage.mode">
  251. <xsl:apply-templates/>
  252. </xsl:template>
  253. <xsl:template match="corpauthor" mode="titlepage.mode">
  254. <xsl:apply-templates mode="titlepage.mode"/>
  255. </xsl:template>
  256. <xsl:template match="corpcredit" mode="titlepage.mode">
  257. <xsl:apply-templates mode="titlepage.mode"/>
  258. </xsl:template>
  259. <xsl:template match="corpname" mode="titlepage.mode">
  260. <xsl:apply-templates mode="titlepage.mode"/>
  261. </xsl:template>
  262. <xsl:template match="date" mode="titlepage.mode">
  263. <xsl:apply-templates mode="titlepage.mode"/>
  264. </xsl:template>
  265. <xsl:template match="edition" mode="titlepage.mode">
  266. <xsl:apply-templates mode="titlepage.mode"/>
  267. <xsl:call-template name="gentext.space"/>
  268. <xsl:call-template name="gentext">
  269. <xsl:with-param name="key" select="'Edition'"/>
  270. </xsl:call-template>
  271. </xsl:template>
  272. <xsl:template match="editor" mode="titlepage.mode">
  273. <!-- The first editor is dealt with in the following template,
  274. which in turn displays all editors of the same mode. -->
  275. </xsl:template>
  276. <xsl:template match="editor[1]" priority="2" mode="titlepage.mode">
  277. <xsl:call-template name="gentext.edited.by"/>
  278. <xsl:call-template name="gentext.space"/>
  279. <xsl:call-template name="person.name.list">
  280. <xsl:with-param name="person.list" select="../editor"/>
  281. </xsl:call-template>
  282. </xsl:template>
  283. <xsl:template match="firstname" mode="titlepage.mode">
  284. <xsl:apply-templates mode="titlepage.mode"/>
  285. </xsl:template>
  286. <xsl:template match="graphic" mode="titlepage.mode">
  287. <!-- use the normal graphic handling code -->
  288. <xsl:apply-templates select="."/>
  289. </xsl:template>
  290. <xsl:template match="honorific" mode="titlepage.mode">
  291. <xsl:apply-templates mode="titlepage.mode"/>
  292. </xsl:template>
  293. <xsl:template match="isbn" mode="titlepage.mode">
  294. <xsl:apply-templates mode="titlepage.mode"/>
  295. </xsl:template>
  296. <xsl:template match="issn" mode="titlepage.mode">
  297. <xsl:apply-templates mode="titlepage.mode"/>
  298. </xsl:template>
  299. <xsl:template match="biblioid" mode="titlepage.mode">
  300. <xsl:apply-templates mode="titlepage.mode"/>
  301. </xsl:template>
  302. <xsl:template match="itermset" mode="titlepage.mode">
  303. <!-- discard -->
  304. </xsl:template>
  305. <xsl:template match="invpartnumber" mode="titlepage.mode">
  306. <xsl:apply-templates mode="titlepage.mode"/>
  307. </xsl:template>
  308. <xsl:template match="issuenum" mode="titlepage.mode">
  309. <xsl:apply-templates mode="titlepage.mode"/>
  310. </xsl:template>
  311. <xsl:template match="jobtitle" mode="titlepage.mode">
  312. <fo:block>
  313. <xsl:apply-templates mode="titlepage.mode"/>
  314. </fo:block>
  315. </xsl:template>
  316. <xsl:template match="keywordset" mode="titlepage.mode">
  317. </xsl:template>
  318. <xsl:template match="legalnotice" mode="titlepage.mode">
  319. <xsl:variable name="id">
  320. <xsl:call-template name="object.id"/>
  321. </xsl:variable>
  322. <fo:block id="{$id}">
  323. <xsl:if test="title"> <!-- FIXME: add param for using default title? -->
  324. <xsl:call-template name="formal.object.heading"/>
  325. </xsl:if>
  326. <xsl:apply-templates mode="titlepage.mode"/>
  327. </fo:block>
  328. </xsl:template>
  329. <xsl:template match="legalnotice/title" mode="titlepage.mode">
  330. </xsl:template>
  331. <xsl:template match="lineage" mode="titlepage.mode">
  332. <xsl:apply-templates mode="titlepage.mode"/>
  333. </xsl:template>
  334. <xsl:template match="modespec" mode="titlepage.mode">
  335. <!-- discard -->
  336. </xsl:template>
  337. <xsl:template match="orgdiv" mode="titlepage.mode">
  338. <xsl:if test="preceding-sibling::*[1][self::orgname]">
  339. <xsl:text> </xsl:text>
  340. </xsl:if>
  341. <xsl:apply-templates mode="titlepage.mode"/>
  342. </xsl:template>
  343. <xsl:template match="orgname" mode="titlepage.mode">
  344. <xsl:apply-templates mode="titlepage.mode"/>
  345. </xsl:template>
  346. <xsl:template match="othercredit" mode="titlepage.mode">
  347. <xsl:variable name="contrib" select="string(contrib)"/>
  348. <xsl:choose>
  349. <xsl:when test="contrib">
  350. <xsl:if test="not(preceding-sibling::othercredit[string(contrib)=$contrib])">
  351. <fo:block>
  352. <xsl:apply-templates mode="titlepage.mode" select="contrib"/>
  353. <xsl:text>: </xsl:text>
  354. <xsl:call-template name="person.name"/>
  355. <xsl:apply-templates mode="titlepage.mode" select="affiliation"/>
  356. <xsl:apply-templates select="following-sibling::othercredit[string(contrib)=$contrib]" mode="titlepage.othercredits"/>
  357. </fo:block>
  358. </xsl:if>
  359. </xsl:when>
  360. <xsl:otherwise>
  361. <fo:block><xsl:call-template name="person.name"/></fo:block>
  362. <xsl:apply-templates mode="titlepage.mode" select="./affiliation"/>
  363. </xsl:otherwise>
  364. </xsl:choose>
  365. </xsl:template>
  366. <xsl:template match="othercredit" mode="titlepage.othercredits">
  367. <xsl:text>, </xsl:text>
  368. <xsl:call-template name="person.name"/>
  369. </xsl:template>
  370. <xsl:template match="othername" mode="titlepage.mode">
  371. <xsl:apply-templates mode="titlepage.mode"/>
  372. </xsl:template>
  373. <xsl:template match="pagenums" mode="titlepage.mode">
  374. <xsl:apply-templates mode="titlepage.mode"/>
  375. </xsl:template>
  376. <xsl:template match="printhistory" mode="titlepage.mode">
  377. <xsl:apply-templates mode="titlepage.mode"/>
  378. </xsl:template>
  379. <xsl:template match="productname" mode="titlepage.mode">
  380. <xsl:apply-templates mode="titlepage.mode"/>
  381. </xsl:template>
  382. <xsl:template match="productnumber" mode="titlepage.mode">
  383. <xsl:apply-templates mode="titlepage.mode"/>
  384. </xsl:template>
  385. <xsl:template match="pubdate" mode="titlepage.mode">
  386. <xsl:apply-templates mode="titlepage.mode"/>
  387. </xsl:template>
  388. <xsl:template match="publisher" mode="titlepage.mode">
  389. <fo:block>
  390. <xsl:apply-templates mode="titlepage.mode"/>
  391. </fo:block>
  392. </xsl:template>
  393. <xsl:template match="publishername" mode="titlepage.mode">
  394. <xsl:apply-templates mode="titlepage.mode"/>
  395. </xsl:template>
  396. <xsl:template match="pubsnumber" mode="titlepage.mode">
  397. <xsl:apply-templates mode="titlepage.mode"/>
  398. </xsl:template>
  399. <xsl:template match="releaseinfo" mode="titlepage.mode">
  400. <xsl:apply-templates mode="titlepage.mode"/>
  401. </xsl:template>
  402. <xsl:template match="revhistory" mode="titlepage.mode">
  403. <xsl:variable name="explicit.table.width">
  404. <xsl:call-template name="pi.dbfo_table-width"/>
  405. </xsl:variable>
  406. <xsl:variable name="table.width">
  407. <xsl:choose>
  408. <xsl:when test="$explicit.table.width != ''">
  409. <xsl:value-of select="$explicit.table.width"/>
  410. </xsl:when>
  411. <xsl:when test="$default.table.width = ''">
  412. <xsl:text>100%</xsl:text>
  413. </xsl:when>
  414. <xsl:otherwise>
  415. <xsl:value-of select="$default.table.width"/>
  416. </xsl:otherwise>
  417. </xsl:choose>
  418. </xsl:variable>
  419. <fo:table table-layout="fixed" width="{$table.width}" xsl:use-attribute-sets="revhistory.table.properties">
  420. <fo:table-column column-number="1" column-width="proportional-column-width(1)"/>
  421. <fo:table-column column-number="2" column-width="proportional-column-width(1)"/>
  422. <fo:table-column column-number="3" column-width="proportional-column-width(1)"/>
  423. <fo:table-body start-indent="0pt" end-indent="0pt">
  424. <fo:table-row>
  425. <fo:table-cell number-columns-spanned="3" xsl:use-attribute-sets="revhistory.table.cell.properties">
  426. <fo:block xsl:use-attribute-sets="revhistory.title.properties">
  427. <xsl:call-template name="gentext">
  428. <xsl:with-param name="key" select="'RevHistory'"/>
  429. </xsl:call-template>
  430. </fo:block>
  431. </fo:table-cell>
  432. </fo:table-row>
  433. <xsl:apply-templates mode="titlepage.mode"/>
  434. </fo:table-body>
  435. </fo:table>
  436. </xsl:template>
  437. <xsl:template match="revhistory/revision" mode="titlepage.mode">
  438. <xsl:variable name="revnumber" select="revnumber"/>
  439. <xsl:variable name="revdate" select="date"/>
  440. <xsl:variable name="revauthor" select="authorinitials|author"/>
  441. <xsl:variable name="revremark" select="revremark|revdescription"/>
  442. <fo:table-row>
  443. <fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
  444. <fo:block>
  445. <xsl:if test="$revnumber">
  446. <xsl:call-template name="gentext">
  447. <xsl:with-param name="key" select="'Revision'"/>
  448. </xsl:call-template>
  449. <xsl:call-template name="gentext.space"/>
  450. <xsl:apply-templates select="$revnumber[1]" mode="titlepage.mode"/>
  451. </xsl:if>
  452. </fo:block>
  453. </fo:table-cell>
  454. <fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
  455. <fo:block>
  456. <xsl:apply-templates select="$revdate[1]" mode="titlepage.mode"/>
  457. </fo:block>
  458. </fo:table-cell>
  459. <fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
  460. <fo:block>
  461. <xsl:for-each select="$revauthor">
  462. <xsl:apply-templates select="." mode="titlepage.mode"/>
  463. <xsl:if test="position() != last()">
  464. <xsl:text>, </xsl:text>
  465. </xsl:if>
  466. </xsl:for-each>
  467. </fo:block>
  468. </fo:table-cell>
  469. </fo:table-row>
  470. <xsl:if test="$revremark">
  471. <fo:table-row>
  472. <fo:table-cell number-columns-spanned="3" xsl:use-attribute-sets="revhistory.table.cell.properties">
  473. <fo:block>
  474. <xsl:apply-templates select="$revremark[1]" mode="titlepage.mode"/>
  475. </fo:block>
  476. </fo:table-cell>
  477. </fo:table-row>
  478. </xsl:if>
  479. </xsl:template>
  480. <xsl:template match="revision/revnumber" mode="titlepage.mode">
  481. <xsl:apply-templates mode="titlepage.mode"/>
  482. </xsl:template>
  483. <xsl:template match="revision/date" mode="titlepage.mode">
  484. <xsl:apply-templates mode="titlepage.mode"/>
  485. </xsl:template>
  486. <xsl:template match="revision/authorinitials" mode="titlepage.mode">
  487. <xsl:apply-templates mode="titlepage.mode"/>
  488. </xsl:template>
  489. <xsl:template match="revision/author" mode="titlepage.mode">
  490. <xsl:apply-templates mode="titlepage.mode"/>
  491. </xsl:template>
  492. <xsl:template match="revision/revremark" mode="titlepage.mode">
  493. <xsl:apply-templates mode="titlepage.mode"/>
  494. </xsl:template>
  495. <xsl:template match="revision/revdescription" mode="titlepage.mode">
  496. <xsl:apply-templates mode="titlepage.mode"/>
  497. </xsl:template>
  498. <xsl:template match="seriesvolnums" mode="titlepage.mode">
  499. <xsl:apply-templates mode="titlepage.mode"/>
  500. </xsl:template>
  501. <xsl:template match="shortaffil" mode="titlepage.mode">
  502. <xsl:apply-templates mode="titlepage.mode"/>
  503. </xsl:template>
  504. <xsl:template match="subjectset" mode="titlepage.mode">
  505. <!-- discard -->
  506. </xsl:template>
  507. <xsl:template match="subtitle" mode="titlepage.mode">
  508. <xsl:apply-templates mode="titlepage.mode"/>
  509. </xsl:template>
  510. <xsl:template match="surname" mode="titlepage.mode">
  511. <xsl:apply-templates mode="titlepage.mode"/>
  512. </xsl:template>
  513. <xsl:template match="title" mode="titlepage.mode">
  514. <xsl:apply-templates mode="titlepage.mode"/>
  515. </xsl:template>
  516. <xsl:template match="titleabbrev" mode="titlepage.mode">
  517. <xsl:apply-templates mode="titlepage.mode"/>
  518. </xsl:template>
  519. <xsl:template match="volumenum" mode="titlepage.mode">
  520. <xsl:apply-templates mode="titlepage.mode"/>
  521. </xsl:template>
  522. <!-- ==================================================================== -->
  523. <!-- Book templates -->
  524. <!-- Note: these templates cannot use *.titlepage.recto.mode or
  525. *.titlepage.verso.mode. If they do then subsequent use of a custom
  526. titlepage.templates.xml file will not work correctly. -->
  527. <!-- book recto -->
  528. <xsl:template match="bookinfo/authorgroup|info/authorgroup"
  529. mode="titlepage.mode" priority="2">
  530. <fo:block>
  531. <xsl:call-template name="anchor"/>
  532. <xsl:apply-templates mode="titlepage.mode"/>
  533. </fo:block>
  534. </xsl:template>
  535. <!-- book verso -->
  536. <xsl:template name="book.verso.title">
  537. <fo:block>
  538. <xsl:apply-templates mode="titlepage.mode"/>
  539. <xsl:if test="following-sibling::subtitle
  540. |following-sibling::info/subtitle
  541. |following-sibling::bookinfo/subtitle">
  542. <xsl:text>: </xsl:text>
  543. <xsl:apply-templates select="(following-sibling::subtitle
  544. |following-sibling::info/subtitle
  545. |following-sibling::bookinfo/subtitle)[1]"
  546. mode="book.verso.subtitle.mode"/>
  547. </xsl:if>
  548. </fo:block>
  549. </xsl:template>
  550. <xsl:template match="subtitle" mode="book.verso.subtitle.mode">
  551. <xsl:apply-templates mode="titlepage.mode"/>
  552. <xsl:if test="following-sibling::subtitle">
  553. <xsl:text>: </xsl:text>
  554. <xsl:apply-templates select="following-sibling::subtitle[1]"
  555. mode="book.verso.subtitle.mode"/>
  556. </xsl:if>
  557. </xsl:template>
  558. <xsl:template name="verso.authorgroup">
  559. <fo:block>
  560. <xsl:call-template name="gentext">
  561. <xsl:with-param name="key" select="'by'"/>
  562. </xsl:call-template>
  563. <xsl:text> </xsl:text>
  564. <xsl:call-template name="person.name.list">
  565. <xsl:with-param name="person.list" select="author|corpauthor|editor"/>
  566. </xsl:call-template>
  567. </fo:block>
  568. <xsl:apply-templates select="othercredit" mode="titlepage.mode"/>
  569. </xsl:template>
  570. <xsl:template match="bookinfo/author|info/author"
  571. mode="titlepage.mode" priority="2">
  572. <fo:block>
  573. <xsl:call-template name="person.name"/>
  574. </fo:block>
  575. </xsl:template>
  576. <xsl:template match="bookinfo/corpauthor|info/corpauthor"
  577. mode="titlepage.mode" priority="2">
  578. <fo:block>
  579. <xsl:apply-templates/>
  580. </fo:block>
  581. </xsl:template>
  582. <xsl:template match="bookinfo/pubdate|info/pubdate"
  583. mode="titlepage.mode" priority="2">
  584. <fo:block>
  585. <xsl:call-template name="gentext">
  586. <xsl:with-param name="key" select="'published'"/>
  587. </xsl:call-template>
  588. <xsl:text> </xsl:text>
  589. <xsl:apply-templates mode="titlepage.mode"/>
  590. </fo:block>
  591. </xsl:template>
  592. <!-- ==================================================================== -->
  593. </xsl:stylesheet>