component.xsl 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797
  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. xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
  5. version='1.0'>
  6. <!-- ********************************************************************
  7. $Id$
  8. ********************************************************************
  9. This file is part of the XSL DocBook Stylesheet distribution.
  10. See ../README or http://docbook.sf.net/release/xsl/current/ for
  11. copyright and other information.
  12. ******************************************************************** -->
  13. <!-- ==================================================================== -->
  14. <xsl:template name="component.title">
  15. <xsl:param name="node" select="."/>
  16. <xsl:param name="pagewide" select="0"/>
  17. <xsl:variable name="id">
  18. <xsl:call-template name="object.id">
  19. <xsl:with-param name="object" select="$node"/>
  20. </xsl:call-template>
  21. </xsl:variable>
  22. <xsl:variable name="title">
  23. <xsl:apply-templates select="$node" mode="object.title.markup">
  24. <xsl:with-param name="allow-anchors" select="1"/>
  25. </xsl:apply-templates>
  26. </xsl:variable>
  27. <xsl:variable name="titleabbrev">
  28. <xsl:apply-templates select="$node" mode="titleabbrev.markup"/>
  29. </xsl:variable>
  30. <xsl:variable name="level">
  31. <xsl:choose>
  32. <xsl:when test="ancestor::section">
  33. <xsl:value-of select="count(ancestor::section)+1"/>
  34. </xsl:when>
  35. <xsl:when test="ancestor::sect5">6</xsl:when>
  36. <xsl:when test="ancestor::sect4">5</xsl:when>
  37. <xsl:when test="ancestor::sect3">4</xsl:when>
  38. <xsl:when test="ancestor::sect2">3</xsl:when>
  39. <xsl:when test="ancestor::sect1">2</xsl:when>
  40. <xsl:otherwise>1</xsl:otherwise>
  41. </xsl:choose>
  42. </xsl:variable>
  43. <xsl:if test="$passivetex.extensions != 0">
  44. <fotex:bookmark xmlns:fotex="http://www.tug.org/fotex"
  45. fotex-bookmark-level="2"
  46. fotex-bookmark-label="{$id}">
  47. <xsl:value-of select="$titleabbrev"/>
  48. </fotex:bookmark>
  49. </xsl:if>
  50. <fo:block xsl:use-attribute-sets="component.title.properties">
  51. <xsl:if test="$pagewide != 0">
  52. <!-- Doesn't work to use 'all' here since not a child of fo:flow -->
  53. <xsl:attribute name="span">inherit</xsl:attribute>
  54. </xsl:if>
  55. <xsl:attribute name="hyphenation-character">
  56. <xsl:call-template name="gentext">
  57. <xsl:with-param name="key" select="'hyphenation-character'"/>
  58. </xsl:call-template>
  59. </xsl:attribute>
  60. <xsl:attribute name="hyphenation-push-character-count">
  61. <xsl:call-template name="gentext">
  62. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  63. </xsl:call-template>
  64. </xsl:attribute>
  65. <xsl:attribute name="hyphenation-remain-character-count">
  66. <xsl:call-template name="gentext">
  67. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  68. </xsl:call-template>
  69. </xsl:attribute>
  70. <xsl:if test="$axf.extensions != 0">
  71. <xsl:attribute name="axf:outline-level">
  72. <xsl:value-of select="count($node/ancestor::*)"/>
  73. </xsl:attribute>
  74. <xsl:attribute name="axf:outline-expand">false</xsl:attribute>
  75. <xsl:attribute name="axf:outline-title">
  76. <xsl:value-of select="normalize-space($title)"/>
  77. </xsl:attribute>
  78. </xsl:if>
  79. <!-- Let's handle the case where a component (bibliography, for example)
  80. occurs inside a section; will we need parameters for this?
  81. Danger Will Robinson: using section.title.level*.properties here
  82. runs the risk that someone will set something other than
  83. font-size there... -->
  84. <xsl:choose>
  85. <xsl:when test="$level=2">
  86. <fo:block xsl:use-attribute-sets="section.title.level2.properties">
  87. <xsl:copy-of select="$title"/>
  88. </fo:block>
  89. </xsl:when>
  90. <xsl:when test="$level=3">
  91. <fo:block xsl:use-attribute-sets="section.title.level3.properties">
  92. <xsl:copy-of select="$title"/>
  93. </fo:block>
  94. </xsl:when>
  95. <xsl:when test="$level=4">
  96. <fo:block xsl:use-attribute-sets="section.title.level4.properties">
  97. <xsl:copy-of select="$title"/>
  98. </fo:block>
  99. </xsl:when>
  100. <xsl:when test="$level=5">
  101. <fo:block xsl:use-attribute-sets="section.title.level5.properties">
  102. <xsl:copy-of select="$title"/>
  103. </fo:block>
  104. </xsl:when>
  105. <xsl:when test="$level=6">
  106. <fo:block xsl:use-attribute-sets="section.title.level6.properties">
  107. <xsl:copy-of select="$title"/>
  108. </fo:block>
  109. </xsl:when>
  110. <xsl:otherwise>
  111. <!-- not in a section: do nothing special -->
  112. <xsl:copy-of select="$title"/>
  113. </xsl:otherwise>
  114. </xsl:choose>
  115. </fo:block>
  116. </xsl:template>
  117. <!-- ==================================================================== -->
  118. <xsl:template match="dedication" mode="dedication">
  119. <xsl:variable name="id">
  120. <xsl:call-template name="object.id"/>
  121. </xsl:variable>
  122. <xsl:variable name="master-reference">
  123. <xsl:call-template name="select.pagemaster"/>
  124. </xsl:variable>
  125. <fo:page-sequence hyphenate="{$hyphenate}"
  126. master-reference="{$master-reference}">
  127. <xsl:attribute name="language">
  128. <xsl:call-template name="l10n.language"/>
  129. </xsl:attribute>
  130. <xsl:attribute name="format">
  131. <xsl:call-template name="page.number.format">
  132. <xsl:with-param name="master-reference" select="$master-reference"/>
  133. </xsl:call-template>
  134. </xsl:attribute>
  135. <xsl:attribute name="initial-page-number">
  136. <xsl:call-template name="initial.page.number">
  137. <xsl:with-param name="master-reference" select="$master-reference"/>
  138. </xsl:call-template>
  139. </xsl:attribute>
  140. <xsl:attribute name="force-page-count">
  141. <xsl:call-template name="force.page.count">
  142. <xsl:with-param name="master-reference" select="$master-reference"/>
  143. </xsl:call-template>
  144. </xsl:attribute>
  145. <xsl:attribute name="hyphenation-character">
  146. <xsl:call-template name="gentext">
  147. <xsl:with-param name="key" select="'hyphenation-character'"/>
  148. </xsl:call-template>
  149. </xsl:attribute>
  150. <xsl:attribute name="hyphenation-push-character-count">
  151. <xsl:call-template name="gentext">
  152. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  153. </xsl:call-template>
  154. </xsl:attribute>
  155. <xsl:attribute name="hyphenation-remain-character-count">
  156. <xsl:call-template name="gentext">
  157. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  158. </xsl:call-template>
  159. </xsl:attribute>
  160. <xsl:apply-templates select="." mode="running.head.mode">
  161. <xsl:with-param name="master-reference" select="$master-reference"/>
  162. </xsl:apply-templates>
  163. <xsl:apply-templates select="." mode="running.foot.mode">
  164. <xsl:with-param name="master-reference" select="$master-reference"/>
  165. </xsl:apply-templates>
  166. <fo:flow flow-name="xsl-region-body">
  167. <xsl:call-template name="set.flow.properties">
  168. <xsl:with-param name="element" select="local-name(.)"/>
  169. <xsl:with-param name="master-reference" select="$master-reference"/>
  170. </xsl:call-template>
  171. <fo:block id="{$id}"
  172. xsl:use-attribute-sets="component.titlepage.properties">
  173. <xsl:call-template name="dedication.titlepage"/>
  174. </fo:block>
  175. <xsl:apply-templates/>
  176. </fo:flow>
  177. </fo:page-sequence>
  178. </xsl:template>
  179. <xsl:template match="dedication"></xsl:template> <!-- see mode="dedication" -->
  180. <xsl:template match="dedication/docinfo"></xsl:template>
  181. <xsl:template match="dedication/title"></xsl:template>
  182. <xsl:template match="dedication/subtitle"></xsl:template>
  183. <xsl:template match="dedication/titleabbrev"></xsl:template>
  184. <!-- ==================================================================== -->
  185. <xsl:template match="colophon">
  186. <xsl:variable name="id">
  187. <xsl:call-template name="object.id"/>
  188. </xsl:variable>
  189. <xsl:variable name="master-reference">
  190. <xsl:call-template name="select.pagemaster"/>
  191. </xsl:variable>
  192. <fo:page-sequence hyphenate="{$hyphenate}"
  193. master-reference="{$master-reference}">
  194. <xsl:attribute name="language">
  195. <xsl:call-template name="l10n.language"/>
  196. </xsl:attribute>
  197. <xsl:attribute name="format">
  198. <xsl:call-template name="page.number.format">
  199. <xsl:with-param name="master-reference" select="$master-reference"/>
  200. </xsl:call-template>
  201. </xsl:attribute>
  202. <xsl:attribute name="initial-page-number">
  203. <xsl:call-template name="initial.page.number">
  204. <xsl:with-param name="master-reference" select="$master-reference"/>
  205. </xsl:call-template>
  206. </xsl:attribute>
  207. <xsl:attribute name="force-page-count">
  208. <xsl:call-template name="force.page.count">
  209. <xsl:with-param name="master-reference" select="$master-reference"/>
  210. </xsl:call-template>
  211. </xsl:attribute>
  212. <xsl:attribute name="hyphenation-character">
  213. <xsl:call-template name="gentext">
  214. <xsl:with-param name="key" select="'hyphenation-character'"/>
  215. </xsl:call-template>
  216. </xsl:attribute>
  217. <xsl:attribute name="hyphenation-push-character-count">
  218. <xsl:call-template name="gentext">
  219. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  220. </xsl:call-template>
  221. </xsl:attribute>
  222. <xsl:attribute name="hyphenation-remain-character-count">
  223. <xsl:call-template name="gentext">
  224. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  225. </xsl:call-template>
  226. </xsl:attribute>
  227. <xsl:apply-templates select="." mode="running.head.mode">
  228. <xsl:with-param name="master-reference" select="$master-reference"/>
  229. </xsl:apply-templates>
  230. <xsl:apply-templates select="." mode="running.foot.mode">
  231. <xsl:with-param name="master-reference" select="$master-reference"/>
  232. </xsl:apply-templates>
  233. <fo:flow flow-name="xsl-region-body">
  234. <xsl:call-template name="set.flow.properties">
  235. <xsl:with-param name="element" select="local-name(.)"/>
  236. <xsl:with-param name="master-reference" select="$master-reference"/>
  237. </xsl:call-template>
  238. <fo:block id="{$id}"
  239. xsl:use-attribute-sets="component.titlepage.properties">
  240. <xsl:call-template name="colophon.titlepage"/>
  241. </fo:block>
  242. <xsl:apply-templates/>
  243. </fo:flow>
  244. </fo:page-sequence>
  245. </xsl:template>
  246. <xsl:template match="colophon/title"></xsl:template>
  247. <xsl:template match="colophon/subtitle"></xsl:template>
  248. <xsl:template match="colophon/titleabbrev"></xsl:template>
  249. <!-- ==================================================================== -->
  250. <xsl:template match="preface">
  251. <xsl:variable name="id">
  252. <xsl:call-template name="object.id"/>
  253. </xsl:variable>
  254. <xsl:variable name="master-reference">
  255. <xsl:call-template name="select.pagemaster"/>
  256. </xsl:variable>
  257. <fo:page-sequence hyphenate="{$hyphenate}"
  258. master-reference="{$master-reference}">
  259. <xsl:attribute name="language">
  260. <xsl:call-template name="l10n.language"/>
  261. </xsl:attribute>
  262. <xsl:attribute name="format">
  263. <xsl:call-template name="page.number.format">
  264. <xsl:with-param name="master-reference" select="$master-reference"/>
  265. </xsl:call-template>
  266. </xsl:attribute>
  267. <xsl:attribute name="initial-page-number">
  268. <xsl:call-template name="initial.page.number">
  269. <xsl:with-param name="master-reference" select="$master-reference"/>
  270. </xsl:call-template>
  271. </xsl:attribute>
  272. <xsl:attribute name="force-page-count">
  273. <xsl:call-template name="force.page.count">
  274. <xsl:with-param name="master-reference" select="$master-reference"/>
  275. </xsl:call-template>
  276. </xsl:attribute>
  277. <xsl:attribute name="hyphenation-character">
  278. <xsl:call-template name="gentext">
  279. <xsl:with-param name="key" select="'hyphenation-character'"/>
  280. </xsl:call-template>
  281. </xsl:attribute>
  282. <xsl:attribute name="hyphenation-push-character-count">
  283. <xsl:call-template name="gentext">
  284. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  285. </xsl:call-template>
  286. </xsl:attribute>
  287. <xsl:attribute name="hyphenation-remain-character-count">
  288. <xsl:call-template name="gentext">
  289. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  290. </xsl:call-template>
  291. </xsl:attribute>
  292. <xsl:apply-templates select="." mode="running.head.mode">
  293. <xsl:with-param name="master-reference" select="$master-reference"/>
  294. </xsl:apply-templates>
  295. <xsl:apply-templates select="." mode="running.foot.mode">
  296. <xsl:with-param name="master-reference" select="$master-reference"/>
  297. </xsl:apply-templates>
  298. <fo:flow flow-name="xsl-region-body">
  299. <xsl:call-template name="set.flow.properties">
  300. <xsl:with-param name="element" select="local-name(.)"/>
  301. <xsl:with-param name="master-reference" select="$master-reference"/>
  302. </xsl:call-template>
  303. <fo:block id="{$id}"
  304. xsl:use-attribute-sets="component.titlepage.properties">
  305. <xsl:call-template name="preface.titlepage"/>
  306. </fo:block>
  307. <xsl:variable name="toc.params">
  308. <xsl:call-template name="find.path.params">
  309. <xsl:with-param name="table"
  310. select="normalize-space($generate.toc)"/>
  311. </xsl:call-template>
  312. </xsl:variable>
  313. <xsl:if test="contains($toc.params, 'toc')">
  314. <xsl:call-template name="component.toc">
  315. <xsl:with-param name="toc.title.p"
  316. select="contains($toc.params, 'title')"/>
  317. </xsl:call-template>
  318. <xsl:call-template name="component.toc.separator"/>
  319. </xsl:if>
  320. <xsl:apply-templates/>
  321. </fo:flow>
  322. </fo:page-sequence>
  323. </xsl:template>
  324. <xsl:template match="preface/docinfo|prefaceinfo"></xsl:template>
  325. <xsl:template match="preface/info"></xsl:template>
  326. <xsl:template match="preface/title"></xsl:template>
  327. <xsl:template match="preface/titleabbrev"></xsl:template>
  328. <xsl:template match="preface/subtitle"></xsl:template>
  329. <!-- ==================================================================== -->
  330. <xsl:template match="chapter">
  331. <xsl:variable name="id">
  332. <xsl:call-template name="object.id"/>
  333. </xsl:variable>
  334. <xsl:variable name="master-reference">
  335. <xsl:call-template name="select.pagemaster"/>
  336. </xsl:variable>
  337. <fo:page-sequence hyphenate="{$hyphenate}"
  338. master-reference="{$master-reference}">
  339. <xsl:attribute name="language">
  340. <xsl:call-template name="l10n.language"/>
  341. </xsl:attribute>
  342. <xsl:attribute name="format">
  343. <xsl:call-template name="page.number.format">
  344. <xsl:with-param name="master-reference" select="$master-reference"/>
  345. </xsl:call-template>
  346. </xsl:attribute>
  347. <xsl:attribute name="initial-page-number">
  348. <xsl:call-template name="initial.page.number">
  349. <xsl:with-param name="master-reference" select="$master-reference"/>
  350. </xsl:call-template>
  351. </xsl:attribute>
  352. <xsl:attribute name="force-page-count">
  353. <xsl:call-template name="force.page.count">
  354. <xsl:with-param name="master-reference" select="$master-reference"/>
  355. </xsl:call-template>
  356. </xsl:attribute>
  357. <xsl:attribute name="hyphenation-character">
  358. <xsl:call-template name="gentext">
  359. <xsl:with-param name="key" select="'hyphenation-character'"/>
  360. </xsl:call-template>
  361. </xsl:attribute>
  362. <xsl:attribute name="hyphenation-push-character-count">
  363. <xsl:call-template name="gentext">
  364. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  365. </xsl:call-template>
  366. </xsl:attribute>
  367. <xsl:attribute name="hyphenation-remain-character-count">
  368. <xsl:call-template name="gentext">
  369. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  370. </xsl:call-template>
  371. </xsl:attribute>
  372. <xsl:apply-templates select="." mode="running.head.mode">
  373. <xsl:with-param name="master-reference" select="$master-reference"/>
  374. </xsl:apply-templates>
  375. <xsl:apply-templates select="." mode="running.foot.mode">
  376. <xsl:with-param name="master-reference" select="$master-reference"/>
  377. </xsl:apply-templates>
  378. <fo:flow flow-name="xsl-region-body">
  379. <xsl:call-template name="set.flow.properties">
  380. <xsl:with-param name="element" select="local-name(.)"/>
  381. <xsl:with-param name="master-reference" select="$master-reference"/>
  382. </xsl:call-template>
  383. <fo:block id="{$id}"
  384. xsl:use-attribute-sets="component.titlepage.properties">
  385. <xsl:call-template name="chapter.titlepage"/>
  386. </fo:block>
  387. <xsl:variable name="toc.params">
  388. <xsl:call-template name="find.path.params">
  389. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  390. </xsl:call-template>
  391. </xsl:variable>
  392. <xsl:if test="contains($toc.params, 'toc')">
  393. <xsl:call-template name="component.toc">
  394. <xsl:with-param name="toc.title.p"
  395. select="contains($toc.params, 'title')"/>
  396. </xsl:call-template>
  397. <xsl:call-template name="component.toc.separator"/>
  398. </xsl:if>
  399. <xsl:apply-templates/>
  400. </fo:flow>
  401. </fo:page-sequence>
  402. </xsl:template>
  403. <xsl:template match="chapter/docinfo|chapterinfo"></xsl:template>
  404. <xsl:template match="chapter/info"></xsl:template>
  405. <xsl:template match="chapter/title"></xsl:template>
  406. <xsl:template match="chapter/titleabbrev"></xsl:template>
  407. <xsl:template match="chapter/subtitle"></xsl:template>
  408. <!-- ==================================================================== -->
  409. <xsl:template match="appendix">
  410. <xsl:variable name="id">
  411. <xsl:call-template name="object.id"/>
  412. </xsl:variable>
  413. <xsl:variable name="master-reference">
  414. <xsl:call-template name="select.pagemaster"/>
  415. </xsl:variable>
  416. <fo:page-sequence hyphenate="{$hyphenate}"
  417. master-reference="{$master-reference}">
  418. <xsl:attribute name="language">
  419. <xsl:call-template name="l10n.language"/>
  420. </xsl:attribute>
  421. <xsl:attribute name="format">
  422. <xsl:call-template name="page.number.format">
  423. <xsl:with-param name="master-reference" select="$master-reference"/>
  424. </xsl:call-template>
  425. </xsl:attribute>
  426. <xsl:attribute name="initial-page-number">
  427. <xsl:call-template name="initial.page.number">
  428. <xsl:with-param name="master-reference" select="$master-reference"/>
  429. </xsl:call-template>
  430. </xsl:attribute>
  431. <xsl:attribute name="force-page-count">
  432. <xsl:call-template name="force.page.count">
  433. <xsl:with-param name="master-reference" select="$master-reference"/>
  434. </xsl:call-template>
  435. </xsl:attribute>
  436. <xsl:attribute name="hyphenation-character">
  437. <xsl:call-template name="gentext">
  438. <xsl:with-param name="key" select="'hyphenation-character'"/>
  439. </xsl:call-template>
  440. </xsl:attribute>
  441. <xsl:attribute name="hyphenation-push-character-count">
  442. <xsl:call-template name="gentext">
  443. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  444. </xsl:call-template>
  445. </xsl:attribute>
  446. <xsl:attribute name="hyphenation-remain-character-count">
  447. <xsl:call-template name="gentext">
  448. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  449. </xsl:call-template>
  450. </xsl:attribute>
  451. <xsl:apply-templates select="." mode="running.head.mode">
  452. <xsl:with-param name="master-reference" select="$master-reference"/>
  453. </xsl:apply-templates>
  454. <xsl:apply-templates select="." mode="running.foot.mode">
  455. <xsl:with-param name="master-reference" select="$master-reference"/>
  456. </xsl:apply-templates>
  457. <fo:flow flow-name="xsl-region-body">
  458. <xsl:call-template name="set.flow.properties">
  459. <xsl:with-param name="element" select="local-name(.)"/>
  460. <xsl:with-param name="master-reference" select="$master-reference"/>
  461. </xsl:call-template>
  462. <fo:block id="{$id}"
  463. xsl:use-attribute-sets="component.titlepage.properties">
  464. <xsl:call-template name="appendix.titlepage"/>
  465. </fo:block>
  466. <xsl:variable name="toc.params">
  467. <xsl:call-template name="find.path.params">
  468. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  469. </xsl:call-template>
  470. </xsl:variable>
  471. <xsl:if test="contains($toc.params, 'toc')">
  472. <xsl:call-template name="component.toc">
  473. <xsl:with-param name="toc.title.p"
  474. select="contains($toc.params, 'title')"/>
  475. </xsl:call-template>
  476. <xsl:call-template name="component.toc.separator"/>
  477. </xsl:if>
  478. <xsl:apply-templates/>
  479. </fo:flow>
  480. </fo:page-sequence>
  481. </xsl:template>
  482. <xsl:template match="appendix/docinfo|appendixinfo"></xsl:template>
  483. <xsl:template match="appendix/info"></xsl:template>
  484. <xsl:template match="appendix/title"></xsl:template>
  485. <xsl:template match="appendix/titleabbrev"></xsl:template>
  486. <xsl:template match="appendix/subtitle"></xsl:template>
  487. <!-- ==================================================================== -->
  488. <xsl:template match="article">
  489. <xsl:variable name="id">
  490. <xsl:call-template name="object.id"/>
  491. </xsl:variable>
  492. <xsl:variable name="master-reference">
  493. <xsl:call-template name="select.pagemaster"/>
  494. </xsl:variable>
  495. <fo:page-sequence hyphenate="{$hyphenate}"
  496. master-reference="{$master-reference}">
  497. <xsl:attribute name="language">
  498. <xsl:call-template name="l10n.language"/>
  499. </xsl:attribute>
  500. <xsl:attribute name="format">
  501. <xsl:call-template name="page.number.format">
  502. <xsl:with-param name="master-reference" select="$master-reference"/>
  503. </xsl:call-template>
  504. </xsl:attribute>
  505. <xsl:attribute name="initial-page-number">
  506. <xsl:call-template name="initial.page.number">
  507. <xsl:with-param name="master-reference" select="$master-reference"/>
  508. </xsl:call-template>
  509. </xsl:attribute>
  510. <xsl:attribute name="force-page-count">
  511. <xsl:call-template name="force.page.count">
  512. <xsl:with-param name="master-reference" select="$master-reference"/>
  513. </xsl:call-template>
  514. </xsl:attribute>
  515. <xsl:attribute name="hyphenation-character">
  516. <xsl:call-template name="gentext">
  517. <xsl:with-param name="key" select="'hyphenation-character'"/>
  518. </xsl:call-template>
  519. </xsl:attribute>
  520. <xsl:attribute name="hyphenation-push-character-count">
  521. <xsl:call-template name="gentext">
  522. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  523. </xsl:call-template>
  524. </xsl:attribute>
  525. <xsl:attribute name="hyphenation-remain-character-count">
  526. <xsl:call-template name="gentext">
  527. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  528. </xsl:call-template>
  529. </xsl:attribute>
  530. <xsl:apply-templates select="." mode="running.head.mode">
  531. <xsl:with-param name="master-reference" select="$master-reference"/>
  532. </xsl:apply-templates>
  533. <xsl:apply-templates select="." mode="running.foot.mode">
  534. <xsl:with-param name="master-reference" select="$master-reference"/>
  535. </xsl:apply-templates>
  536. <fo:flow flow-name="xsl-region-body">
  537. <xsl:call-template name="set.flow.properties">
  538. <xsl:with-param name="element" select="local-name(.)"/>
  539. <xsl:with-param name="master-reference" select="$master-reference"/>
  540. </xsl:call-template>
  541. <fo:block id="{$id}"
  542. xsl:use-attribute-sets="component.titlepage.properties">
  543. <xsl:call-template name="article.titlepage"/>
  544. </fo:block>
  545. <xsl:variable name="toc.params">
  546. <xsl:call-template name="find.path.params">
  547. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  548. </xsl:call-template>
  549. </xsl:variable>
  550. <xsl:if test="contains($toc.params, 'toc')">
  551. <xsl:call-template name="component.toc">
  552. <xsl:with-param name="toc.title.p"
  553. select="contains($toc.params, 'title')"/>
  554. </xsl:call-template>
  555. <xsl:call-template name="component.toc.separator"/>
  556. </xsl:if>
  557. <xsl:apply-templates/>
  558. </fo:flow>
  559. </fo:page-sequence>
  560. </xsl:template>
  561. <xsl:template match="article/artheader"></xsl:template>
  562. <xsl:template match="article/articleinfo"></xsl:template>
  563. <xsl:template match="article/info"></xsl:template>
  564. <xsl:template match="article/title"></xsl:template>
  565. <xsl:template match="article/subtitle"></xsl:template>
  566. <xsl:template match="article/titleabbrev"></xsl:template>
  567. <xsl:template match="article/appendix">
  568. <xsl:variable name="id">
  569. <xsl:call-template name="object.id"/>
  570. </xsl:variable>
  571. <xsl:variable name="title">
  572. <xsl:apply-templates select="." mode="object.title.markup"/>
  573. </xsl:variable>
  574. <xsl:variable name="titleabbrev">
  575. <xsl:apply-templates select="." mode="titleabbrev.markup"/>
  576. </xsl:variable>
  577. <fo:block id='{$id}'>
  578. <xsl:if test="$axf.extensions != 0">
  579. <xsl:attribute name="axf:outline-level">
  580. <xsl:value-of select="count(ancestor::*)+2"/>
  581. </xsl:attribute>
  582. <xsl:attribute name="axf:outline-expand">false</xsl:attribute>
  583. <xsl:attribute name="axf:outline-title">
  584. <xsl:value-of select="normalize-space($titleabbrev)"/>
  585. </xsl:attribute>
  586. </xsl:if>
  587. <xsl:if test="$passivetex.extensions != 0">
  588. <fotex:bookmark xmlns:fotex="http://www.tug.org/fotex"
  589. fotex-bookmark-level="{count(ancestor::*)+2}"
  590. fotex-bookmark-label="{$id}">
  591. <xsl:value-of select="$titleabbrev"/>
  592. </fotex:bookmark>
  593. </xsl:if>
  594. <fo:block xsl:use-attribute-sets="article.appendix.title.properties">
  595. <fo:marker marker-class-name="section.head.marker">
  596. <xsl:choose>
  597. <xsl:when test="$titleabbrev = ''">
  598. <xsl:value-of select="$title"/>
  599. </xsl:when>
  600. <xsl:otherwise>
  601. <xsl:value-of select="$titleabbrev"/>
  602. </xsl:otherwise>
  603. </xsl:choose>
  604. </fo:marker>
  605. <xsl:copy-of select="$title"/>
  606. </fo:block>
  607. <xsl:apply-templates/>
  608. </fo:block>
  609. </xsl:template>
  610. <!-- ==================================================================== -->
  611. <!-- Utility template to create a page sequence for an element -->
  612. <xsl:template match="*" mode="page.sequence" name="page.sequence">
  613. <xsl:param name="content">
  614. <xsl:apply-templates/>
  615. </xsl:param>
  616. <xsl:param name="master-reference">
  617. <xsl:call-template name="select.pagemaster"/>
  618. </xsl:param>
  619. <xsl:param name="element" select="local-name(.)"/>
  620. <xsl:param name="gentext-key" select="local-name(.)"/>
  621. <xsl:param name="language">
  622. <xsl:call-template name="l10n.language"/>
  623. </xsl:param>
  624. <xsl:param name="format">
  625. <xsl:call-template name="page.number.format">
  626. <xsl:with-param name="master-reference" select="$master-reference"/>
  627. <xsl:with-param name="element" select="$element"/>
  628. </xsl:call-template>
  629. </xsl:param>
  630. <xsl:param name="initial-page-number">
  631. <xsl:call-template name="initial.page.number">
  632. <xsl:with-param name="master-reference" select="$master-reference"/>
  633. <xsl:with-param name="element" select="$element"/>
  634. </xsl:call-template>
  635. </xsl:param>
  636. <xsl:param name="force-page-count">
  637. <xsl:call-template name="force.page.count">
  638. <xsl:with-param name="master-reference" select="$master-reference"/>
  639. <xsl:with-param name="element" select="$element"/>
  640. </xsl:call-template>
  641. </xsl:param>
  642. <fo:page-sequence hyphenate="{$hyphenate}"
  643. master-reference="{$master-reference}">
  644. <xsl:attribute name="language">
  645. <xsl:value-of select="$language"/>
  646. </xsl:attribute>
  647. <xsl:attribute name="format">
  648. <xsl:value-of select="$format"/>
  649. </xsl:attribute>
  650. <xsl:attribute name="initial-page-number">
  651. <xsl:value-of select="$initial-page-number"/>
  652. </xsl:attribute>
  653. <xsl:attribute name="force-page-count">
  654. <xsl:value-of select="$force-page-count"/>
  655. </xsl:attribute>
  656. <xsl:attribute name="hyphenation-character">
  657. <xsl:call-template name="gentext">
  658. <xsl:with-param name="key" select="'hyphenation-character'"/>
  659. </xsl:call-template>
  660. </xsl:attribute>
  661. <xsl:attribute name="hyphenation-push-character-count">
  662. <xsl:call-template name="gentext">
  663. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  664. </xsl:call-template>
  665. </xsl:attribute>
  666. <xsl:attribute name="hyphenation-remain-character-count">
  667. <xsl:call-template name="gentext">
  668. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  669. </xsl:call-template>
  670. </xsl:attribute>
  671. <xsl:apply-templates select="." mode="running.head.mode">
  672. <xsl:with-param name="master-reference" select="$master-reference"/>
  673. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  674. </xsl:apply-templates>
  675. <xsl:apply-templates select="." mode="running.foot.mode">
  676. <xsl:with-param name="master-reference" select="$master-reference"/>
  677. <xsl:with-param name="gentext-key" select="$gentext-key"/>
  678. </xsl:apply-templates>
  679. <fo:flow flow-name="xsl-region-body">
  680. <xsl:call-template name="set.flow.properties">
  681. <xsl:with-param name="element" select="local-name(.)"/>
  682. <xsl:with-param name="master-reference" select="$master-reference"/>
  683. </xsl:call-template>
  684. <xsl:copy-of select="$content"/>
  685. </fo:flow>
  686. </fo:page-sequence>
  687. </xsl:template>
  688. </xsl:stylesheet>