division.xsl 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963
  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://nwalsh.com/docbook/xsl/ for copyright
  11. and other information.
  12. ******************************************************************** -->
  13. <!-- ==================================================================== -->
  14. <xsl:template name="division.title">
  15. <xsl:param name="node" select="."/>
  16. <xsl:variable name="id">
  17. <xsl:call-template name="object.id">
  18. <xsl:with-param name="object" select="$node"/>
  19. </xsl:call-template>
  20. </xsl:variable>
  21. <xsl:variable name="title">
  22. <xsl:apply-templates select="$node" mode="object.title.markup"/>
  23. </xsl:variable>
  24. <xsl:if test="$passivetex.extensions != 0">
  25. <fotex:bookmark xmlns:fotex="http://www.tug.org/fotex"
  26. fotex-bookmark-level="1"
  27. fotex-bookmark-label="{$id}">
  28. <xsl:value-of select="$title"/>
  29. </fotex:bookmark>
  30. </xsl:if>
  31. <fo:block keep-with-next.within-column="always"
  32. hyphenate="false">
  33. <xsl:if test="$axf.extensions != 0">
  34. <xsl:attribute name="axf:outline-level">
  35. <xsl:choose>
  36. <xsl:when test="count($node/ancestor::*) > 0">
  37. <xsl:value-of select="count($node/ancestor::*)"/>
  38. </xsl:when>
  39. <xsl:otherwise>1</xsl:otherwise>
  40. </xsl:choose>
  41. </xsl:attribute>
  42. <xsl:attribute name="axf:outline-expand">false</xsl:attribute>
  43. <xsl:attribute name="axf:outline-title">
  44. <xsl:value-of select="normalize-space($title)"/>
  45. </xsl:attribute>
  46. </xsl:if>
  47. <xsl:copy-of select="$title"/>
  48. </fo:block>
  49. </xsl:template>
  50. <!-- ==================================================================== -->
  51. <xsl:template match="set">
  52. <xsl:variable name="id">
  53. <xsl:call-template name="object.id"/>
  54. </xsl:variable>
  55. <xsl:variable name="preamble"
  56. select="*[not(self::book or self::setindex)]"/>
  57. <xsl:variable name="content" select="book|setindex"/>
  58. <xsl:variable name="titlepage-master-reference">
  59. <xsl:call-template name="select.pagemaster">
  60. <xsl:with-param name="pageclass" select="'titlepage'"/>
  61. </xsl:call-template>
  62. </xsl:variable>
  63. <xsl:variable name="lot-master-reference">
  64. <xsl:call-template name="select.pagemaster">
  65. <xsl:with-param name="pageclass" select="'lot'"/>
  66. </xsl:call-template>
  67. </xsl:variable>
  68. <xsl:if test="$preamble">
  69. <fo:page-sequence hyphenate="{$hyphenate}"
  70. master-reference="{$titlepage-master-reference}">
  71. <xsl:attribute name="language">
  72. <xsl:call-template name="l10n.language"/>
  73. </xsl:attribute>
  74. <xsl:attribute name="format">
  75. <xsl:call-template name="page.number.format">
  76. <xsl:with-param name="master-reference"
  77. select="$titlepage-master-reference"/>
  78. </xsl:call-template>
  79. </xsl:attribute>
  80. <xsl:attribute name="initial-page-number">
  81. <xsl:call-template name="initial.page.number">
  82. <xsl:with-param name="master-reference"
  83. select="$titlepage-master-reference"/>
  84. </xsl:call-template>
  85. </xsl:attribute>
  86. <xsl:attribute name="force-page-count">
  87. <xsl:call-template name="force.page.count">
  88. <xsl:with-param name="master-reference"
  89. select="$titlepage-master-reference"/>
  90. </xsl:call-template>
  91. </xsl:attribute>
  92. <xsl:attribute name="hyphenation-character">
  93. <xsl:call-template name="gentext">
  94. <xsl:with-param name="key" select="'hyphenation-character'"/>
  95. </xsl:call-template>
  96. </xsl:attribute>
  97. <xsl:attribute name="hyphenation-push-character-count">
  98. <xsl:call-template name="gentext">
  99. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  100. </xsl:call-template>
  101. </xsl:attribute>
  102. <xsl:attribute name="hyphenation-remain-character-count">
  103. <xsl:call-template name="gentext">
  104. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  105. </xsl:call-template>
  106. </xsl:attribute>
  107. <xsl:apply-templates select="." mode="running.head.mode">
  108. <xsl:with-param name="master-reference" select="$titlepage-master-reference"/>
  109. </xsl:apply-templates>
  110. <xsl:apply-templates select="." mode="running.foot.mode">
  111. <xsl:with-param name="master-reference" select="$titlepage-master-reference"/>
  112. </xsl:apply-templates>
  113. <fo:flow flow-name="xsl-region-body">
  114. <xsl:call-template name="set.flow.properties">
  115. <xsl:with-param name="element" select="local-name(.)"/>
  116. <xsl:with-param name="master-reference"
  117. select="$titlepage-master-reference"/>
  118. </xsl:call-template>
  119. <fo:block id="{$id}">
  120. <xsl:call-template name="set.titlepage"/>
  121. </fo:block>
  122. </fo:flow>
  123. </fo:page-sequence>
  124. </xsl:if>
  125. <xsl:variable name="toc.params">
  126. <xsl:call-template name="find.path.params">
  127. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  128. </xsl:call-template>
  129. </xsl:variable>
  130. <xsl:if test="contains($toc.params, 'toc')">
  131. <fo:page-sequence hyphenate="{$hyphenate}"
  132. master-reference="{$lot-master-reference}">
  133. <xsl:attribute name="language">
  134. <xsl:call-template name="l10n.language"/>
  135. </xsl:attribute>
  136. <xsl:attribute name="format">
  137. <xsl:call-template name="page.number.format">
  138. <xsl:with-param name="element" select="'toc'"/>
  139. <xsl:with-param name="master-reference"
  140. select="$lot-master-reference"/>
  141. </xsl:call-template>
  142. </xsl:attribute>
  143. <xsl:attribute name="initial-page-number">
  144. <xsl:call-template name="initial.page.number">
  145. <xsl:with-param name="master-reference"
  146. select="$lot-master-reference"/>
  147. </xsl:call-template>
  148. </xsl:attribute>
  149. <xsl:attribute name="force-page-count">
  150. <xsl:call-template name="force.page.count">
  151. <xsl:with-param name="master-reference"
  152. select="$lot-master-reference"/>
  153. </xsl:call-template>
  154. </xsl:attribute>
  155. <xsl:attribute name="hyphenation-character">
  156. <xsl:call-template name="gentext">
  157. <xsl:with-param name="key" select="'hyphenation-character'"/>
  158. </xsl:call-template>
  159. </xsl:attribute>
  160. <xsl:attribute name="hyphenation-push-character-count">
  161. <xsl:call-template name="gentext">
  162. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  163. </xsl:call-template>
  164. </xsl:attribute>
  165. <xsl:attribute name="hyphenation-remain-character-count">
  166. <xsl:call-template name="gentext">
  167. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  168. </xsl:call-template>
  169. </xsl:attribute>
  170. <xsl:apply-templates select="." mode="running.head.mode">
  171. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  172. </xsl:apply-templates>
  173. <xsl:apply-templates select="." mode="running.foot.mode">
  174. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  175. </xsl:apply-templates>
  176. <fo:flow flow-name="xsl-region-body">
  177. <xsl:call-template name="set.flow.properties">
  178. <xsl:with-param name="element" select="local-name(.)"/>
  179. <xsl:with-param name="master-reference"
  180. select="$lot-master-reference"/>
  181. </xsl:call-template>
  182. <xsl:call-template name="set.toc"/>
  183. </fo:flow>
  184. </fo:page-sequence>
  185. </xsl:if>
  186. <xsl:apply-templates select="$content"/>
  187. </xsl:template>
  188. <xsl:template match="set/setinfo"></xsl:template>
  189. <xsl:template match="set/title"></xsl:template>
  190. <xsl:template match="set/subtitle"></xsl:template>
  191. <xsl:template match="set/titleabbrev"></xsl:template>
  192. <!-- ==================================================================== -->
  193. <xsl:template match="book">
  194. <xsl:variable name="id">
  195. <xsl:call-template name="object.id"/>
  196. </xsl:variable>
  197. <xsl:variable name="preamble"
  198. select="title|subtitle|titleabbrev|bookinfo|info"/>
  199. <xsl:variable name="content"
  200. select="node()[not(self::title or self::subtitle
  201. or self::titleabbrev
  202. or self::info
  203. or self::bookinfo)]"/>
  204. <xsl:variable name="titlepage-master-reference">
  205. <xsl:call-template name="select.pagemaster">
  206. <xsl:with-param name="pageclass" select="'titlepage'"/>
  207. </xsl:call-template>
  208. </xsl:variable>
  209. <xsl:variable name="lot-master-reference">
  210. <xsl:call-template name="select.pagemaster">
  211. <xsl:with-param name="pageclass" select="'lot'"/>
  212. </xsl:call-template>
  213. </xsl:variable>
  214. <xsl:if test="$preamble">
  215. <fo:page-sequence hyphenate="{$hyphenate}"
  216. master-reference="{$titlepage-master-reference}">
  217. <xsl:attribute name="language">
  218. <xsl:call-template name="l10n.language"/>
  219. </xsl:attribute>
  220. <xsl:attribute name="format">
  221. <xsl:call-template name="page.number.format">
  222. <xsl:with-param name="master-reference"
  223. select="$titlepage-master-reference"/>
  224. </xsl:call-template>
  225. </xsl:attribute>
  226. <xsl:attribute name="initial-page-number">
  227. <xsl:call-template name="initial.page.number">
  228. <xsl:with-param name="master-reference"
  229. select="$titlepage-master-reference"/>
  230. </xsl:call-template>
  231. </xsl:attribute>
  232. <xsl:attribute name="force-page-count">
  233. <xsl:call-template name="force.page.count">
  234. <xsl:with-param name="master-reference"
  235. select="$titlepage-master-reference"/>
  236. </xsl:call-template>
  237. </xsl:attribute>
  238. <xsl:attribute name="hyphenation-character">
  239. <xsl:call-template name="gentext">
  240. <xsl:with-param name="key" select="'hyphenation-character'"/>
  241. </xsl:call-template>
  242. </xsl:attribute>
  243. <xsl:attribute name="hyphenation-push-character-count">
  244. <xsl:call-template name="gentext">
  245. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  246. </xsl:call-template>
  247. </xsl:attribute>
  248. <xsl:attribute name="hyphenation-remain-character-count">
  249. <xsl:call-template name="gentext">
  250. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  251. </xsl:call-template>
  252. </xsl:attribute>
  253. <xsl:apply-templates select="." mode="running.head.mode">
  254. <xsl:with-param name="master-reference" select="$titlepage-master-reference"/>
  255. </xsl:apply-templates>
  256. <xsl:apply-templates select="." mode="running.foot.mode">
  257. <xsl:with-param name="master-reference" select="$titlepage-master-reference"/>
  258. </xsl:apply-templates>
  259. <fo:flow flow-name="xsl-region-body">
  260. <xsl:call-template name="set.flow.properties">
  261. <xsl:with-param name="element" select="local-name(.)"/>
  262. <xsl:with-param name="master-reference"
  263. select="$titlepage-master-reference"/>
  264. </xsl:call-template>
  265. <fo:block id="{$id}">
  266. <xsl:call-template name="book.titlepage"/>
  267. </fo:block>
  268. </fo:flow>
  269. </fo:page-sequence>
  270. </xsl:if>
  271. <xsl:apply-templates select="dedication" mode="dedication"/>
  272. <xsl:variable name="toc.params">
  273. <xsl:call-template name="find.path.params">
  274. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  275. </xsl:call-template>
  276. </xsl:variable>
  277. <xsl:if test="contains($toc.params, 'toc')">
  278. <fo:page-sequence hyphenate="{$hyphenate}"
  279. master-reference="{$lot-master-reference}">
  280. <xsl:attribute name="language">
  281. <xsl:call-template name="l10n.language"/>
  282. </xsl:attribute>
  283. <xsl:attribute name="format">
  284. <xsl:call-template name="page.number.format">
  285. <xsl:with-param name="element" select="'toc'"/>
  286. <xsl:with-param name="master-reference"
  287. select="$lot-master-reference"/>
  288. </xsl:call-template>
  289. </xsl:attribute>
  290. <xsl:attribute name="initial-page-number">
  291. <xsl:call-template name="initial.page.number">
  292. <xsl:with-param name="element" select="'toc'"/>
  293. <xsl:with-param name="master-reference"
  294. select="$lot-master-reference"/>
  295. </xsl:call-template>
  296. </xsl:attribute>
  297. <xsl:attribute name="force-page-count">
  298. <xsl:call-template name="force.page.count">
  299. <xsl:with-param name="master-reference"
  300. select="$lot-master-reference"/>
  301. </xsl:call-template>
  302. </xsl:attribute>
  303. <xsl:attribute name="hyphenation-character">
  304. <xsl:call-template name="gentext">
  305. <xsl:with-param name="key" select="'hyphenation-character'"/>
  306. </xsl:call-template>
  307. </xsl:attribute>
  308. <xsl:attribute name="hyphenation-push-character-count">
  309. <xsl:call-template name="gentext">
  310. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  311. </xsl:call-template>
  312. </xsl:attribute>
  313. <xsl:attribute name="hyphenation-remain-character-count">
  314. <xsl:call-template name="gentext">
  315. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  316. </xsl:call-template>
  317. </xsl:attribute>
  318. <xsl:apply-templates select="." mode="running.head.mode">
  319. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  320. <xsl:with-param name="gentext-key" select="'TableofContents'"/>
  321. </xsl:apply-templates>
  322. <xsl:apply-templates select="." mode="running.foot.mode">
  323. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  324. <xsl:with-param name="gentext-key" select="'TableofContents'"/>
  325. </xsl:apply-templates>
  326. <fo:flow flow-name="xsl-region-body">
  327. <xsl:call-template name="set.flow.properties">
  328. <xsl:with-param name="element" select="local-name(.)"/>
  329. <xsl:with-param name="master-reference"
  330. select="$lot-master-reference"/>
  331. </xsl:call-template>
  332. <xsl:call-template name="division.toc">
  333. <xsl:with-param name="toc.title.p"
  334. select="contains($toc.params, 'title')"/>
  335. </xsl:call-template>
  336. </fo:flow>
  337. </fo:page-sequence>
  338. </xsl:if>
  339. <xsl:if test="contains($toc.params,'figure') and .//figure">
  340. <fo:page-sequence hyphenate="{$hyphenate}"
  341. master-reference="{$lot-master-reference}">
  342. <xsl:attribute name="language">
  343. <xsl:call-template name="l10n.language"/>
  344. </xsl:attribute>
  345. <xsl:attribute name="format">
  346. <xsl:call-template name="page.number.format">
  347. <xsl:with-param name="element" select="'toc'"/>
  348. <xsl:with-param name="master-reference"
  349. select="$lot-master-reference"/>
  350. </xsl:call-template>
  351. </xsl:attribute>
  352. <xsl:attribute name="initial-page-number">
  353. <xsl:call-template name="initial.page.number">
  354. <xsl:with-param name="element" select="'toc'"/>
  355. <xsl:with-param name="master-reference"
  356. select="$lot-master-reference"/>
  357. </xsl:call-template>
  358. </xsl:attribute>
  359. <xsl:attribute name="force-page-count">
  360. <xsl:call-template name="force.page.count">
  361. <xsl:with-param name="master-reference"
  362. select="$lot-master-reference"/>
  363. </xsl:call-template>
  364. </xsl:attribute>
  365. <xsl:attribute name="hyphenation-character">
  366. <xsl:call-template name="gentext">
  367. <xsl:with-param name="key" select="'hyphenation-character'"/>
  368. </xsl:call-template>
  369. </xsl:attribute>
  370. <xsl:attribute name="hyphenation-push-character-count">
  371. <xsl:call-template name="gentext">
  372. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  373. </xsl:call-template>
  374. </xsl:attribute>
  375. <xsl:attribute name="hyphenation-remain-character-count">
  376. <xsl:call-template name="gentext">
  377. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  378. </xsl:call-template>
  379. </xsl:attribute>
  380. <xsl:apply-templates select="." mode="running.head.mode">
  381. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  382. <xsl:with-param name="gentext-key" select="'ListofFigures'"/>
  383. </xsl:apply-templates>
  384. <xsl:apply-templates select="." mode="running.foot.mode">
  385. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  386. <xsl:with-param name="gentext-key" select="'ListofFigures'"/>
  387. </xsl:apply-templates>
  388. <fo:flow flow-name="xsl-region-body">
  389. <xsl:call-template name="set.flow.properties">
  390. <xsl:with-param name="element" select="local-name(.)"/>
  391. <xsl:with-param name="master-reference"
  392. select="$lot-master-reference"/>
  393. </xsl:call-template>
  394. <xsl:call-template name="list.of.titles">
  395. <xsl:with-param name="titles" select="'figure'"/>
  396. <xsl:with-param name="nodes" select=".//figure"/>
  397. </xsl:call-template>
  398. </fo:flow>
  399. </fo:page-sequence>
  400. </xsl:if>
  401. <xsl:if test="contains($toc.params,'table') and .//table">
  402. <fo:page-sequence hyphenate="{$hyphenate}"
  403. master-reference="{$lot-master-reference}">
  404. <xsl:attribute name="language">
  405. <xsl:call-template name="l10n.language"/>
  406. </xsl:attribute>
  407. <xsl:attribute name="format">
  408. <xsl:call-template name="page.number.format">
  409. <xsl:with-param name="element" select="'toc'"/>
  410. <xsl:with-param name="master-reference"
  411. select="$lot-master-reference"/>
  412. </xsl:call-template>
  413. </xsl:attribute>
  414. <xsl:attribute name="initial-page-number">
  415. <xsl:call-template name="initial.page.number">
  416. <xsl:with-param name="element" select="'toc'"/>
  417. <xsl:with-param name="master-reference"
  418. select="$lot-master-reference"/>
  419. </xsl:call-template>
  420. </xsl:attribute>
  421. <xsl:attribute name="force-page-count">
  422. <xsl:call-template name="force.page.count">
  423. <xsl:with-param name="master-reference"
  424. select="$lot-master-reference"/>
  425. </xsl:call-template>
  426. </xsl:attribute>
  427. <xsl:attribute name="hyphenation-character">
  428. <xsl:call-template name="gentext">
  429. <xsl:with-param name="key" select="'hyphenation-character'"/>
  430. </xsl:call-template>
  431. </xsl:attribute>
  432. <xsl:attribute name="hyphenation-push-character-count">
  433. <xsl:call-template name="gentext">
  434. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  435. </xsl:call-template>
  436. </xsl:attribute>
  437. <xsl:attribute name="hyphenation-remain-character-count">
  438. <xsl:call-template name="gentext">
  439. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  440. </xsl:call-template>
  441. </xsl:attribute>
  442. <xsl:apply-templates select="." mode="running.head.mode">
  443. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  444. <xsl:with-param name="gentext-key" select="'ListofTables'"/>
  445. </xsl:apply-templates>
  446. <xsl:apply-templates select="." mode="running.foot.mode">
  447. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  448. <xsl:with-param name="gentext-key" select="'ListofTables'"/>
  449. </xsl:apply-templates>
  450. <fo:flow flow-name="xsl-region-body">
  451. <xsl:call-template name="set.flow.properties">
  452. <xsl:with-param name="element" select="local-name(.)"/>
  453. <xsl:with-param name="master-reference"
  454. select="$lot-master-reference"/>
  455. </xsl:call-template>
  456. <xsl:call-template name="list.of.titles">
  457. <xsl:with-param name="titles" select="'table'"/>
  458. <xsl:with-param name="nodes" select=".//table"/>
  459. </xsl:call-template>
  460. </fo:flow>
  461. </fo:page-sequence>
  462. </xsl:if>
  463. <xsl:if test="contains($toc.params,'example') and .//example">
  464. <fo:page-sequence hyphenate="{$hyphenate}"
  465. master-reference="{$lot-master-reference}">
  466. <xsl:attribute name="language">
  467. <xsl:call-template name="l10n.language"/>
  468. </xsl:attribute>
  469. <xsl:attribute name="format">
  470. <xsl:call-template name="page.number.format">
  471. <xsl:with-param name="element" select="'toc'"/>
  472. <xsl:with-param name="master-reference"
  473. select="$lot-master-reference"/>
  474. </xsl:call-template>
  475. </xsl:attribute>
  476. <xsl:attribute name="initial-page-number">
  477. <xsl:call-template name="initial.page.number">
  478. <xsl:with-param name="element" select="'toc'"/>
  479. <xsl:with-param name="master-reference"
  480. select="$lot-master-reference"/>
  481. </xsl:call-template>
  482. </xsl:attribute>
  483. <xsl:attribute name="force-page-count">
  484. <xsl:call-template name="force.page.count">
  485. <xsl:with-param name="master-reference"
  486. select="$lot-master-reference"/>
  487. </xsl:call-template>
  488. </xsl:attribute>
  489. <xsl:attribute name="hyphenation-character">
  490. <xsl:call-template name="gentext">
  491. <xsl:with-param name="key" select="'hyphenation-character'"/>
  492. </xsl:call-template>
  493. </xsl:attribute>
  494. <xsl:attribute name="hyphenation-push-character-count">
  495. <xsl:call-template name="gentext">
  496. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  497. </xsl:call-template>
  498. </xsl:attribute>
  499. <xsl:attribute name="hyphenation-remain-character-count">
  500. <xsl:call-template name="gentext">
  501. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  502. </xsl:call-template>
  503. </xsl:attribute>
  504. <xsl:apply-templates select="." mode="running.head.mode">
  505. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  506. <xsl:with-param name="gentext-key" select="'ListofExamples'"/>
  507. </xsl:apply-templates>
  508. <xsl:apply-templates select="." mode="running.foot.mode">
  509. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  510. <xsl:with-param name="gentext-key" select="'ListofExamples'"/>
  511. </xsl:apply-templates>
  512. <fo:flow flow-name="xsl-region-body">
  513. <xsl:call-template name="set.flow.properties">
  514. <xsl:with-param name="element" select="local-name(.)"/>
  515. <xsl:with-param name="master-reference"
  516. select="$lot-master-reference"/>
  517. </xsl:call-template>
  518. <xsl:call-template name="list.of.titles">
  519. <xsl:with-param name="titles" select="'example'"/>
  520. <xsl:with-param name="nodes" select=".//example"/>
  521. </xsl:call-template>
  522. </fo:flow>
  523. </fo:page-sequence>
  524. </xsl:if>
  525. <xsl:if test="contains($toc.params,'equation') and .//equation">
  526. <fo:page-sequence hyphenate="{$hyphenate}"
  527. master-reference="{$lot-master-reference}">
  528. <xsl:attribute name="language">
  529. <xsl:call-template name="l10n.language"/>
  530. </xsl:attribute>
  531. <xsl:attribute name="format">
  532. <xsl:call-template name="page.number.format">
  533. <xsl:with-param name="element" select="'toc'"/>
  534. <xsl:with-param name="master-reference"
  535. select="$lot-master-reference"/>
  536. </xsl:call-template>
  537. </xsl:attribute>
  538. <xsl:attribute name="initial-page-number">
  539. <xsl:call-template name="initial.page.number">
  540. <xsl:with-param name="element" select="'toc'"/>
  541. <xsl:with-param name="master-reference"
  542. select="$lot-master-reference"/>
  543. </xsl:call-template>
  544. </xsl:attribute>
  545. <xsl:attribute name="force-page-count">
  546. <xsl:call-template name="force.page.count">
  547. <xsl:with-param name="master-reference"
  548. select="$lot-master-reference"/>
  549. </xsl:call-template>
  550. </xsl:attribute>
  551. <xsl:attribute name="hyphenation-character">
  552. <xsl:call-template name="gentext">
  553. <xsl:with-param name="key" select="'hyphenation-character'"/>
  554. </xsl:call-template>
  555. </xsl:attribute>
  556. <xsl:attribute name="hyphenation-push-character-count">
  557. <xsl:call-template name="gentext">
  558. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  559. </xsl:call-template>
  560. </xsl:attribute>
  561. <xsl:attribute name="hyphenation-remain-character-count">
  562. <xsl:call-template name="gentext">
  563. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  564. </xsl:call-template>
  565. </xsl:attribute>
  566. <xsl:apply-templates select="." mode="running.head.mode">
  567. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  568. <xsl:with-param name="gentext-key" select="'ListofEquations'"/>
  569. </xsl:apply-templates>
  570. <xsl:apply-templates select="." mode="running.foot.mode">
  571. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  572. <xsl:with-param name="gentext-key" select="'ListofEquations'"/>
  573. </xsl:apply-templates>
  574. <fo:flow flow-name="xsl-region-body">
  575. <xsl:call-template name="set.flow.properties">
  576. <xsl:with-param name="element" select="local-name(.)"/>
  577. <xsl:with-param name="master-reference"
  578. select="$lot-master-reference"/>
  579. </xsl:call-template>
  580. <xsl:call-template name="list.of.titles">
  581. <xsl:with-param name="titles" select="'equation'"/>
  582. <xsl:with-param name="nodes" select=".//equation[title or info/title]"/>
  583. </xsl:call-template>
  584. </fo:flow>
  585. </fo:page-sequence>
  586. </xsl:if>
  587. <xsl:if test="contains($toc.params,'procedure') and .//procedure">
  588. <fo:page-sequence hyphenate="{$hyphenate}"
  589. master-reference="{$lot-master-reference}">
  590. <xsl:attribute name="language">
  591. <xsl:call-template name="l10n.language"/>
  592. </xsl:attribute>
  593. <xsl:attribute name="format">
  594. <xsl:call-template name="page.number.format">
  595. <xsl:with-param name="element" select="'toc'"/>
  596. <xsl:with-param name="master-reference"
  597. select="$lot-master-reference"/>
  598. </xsl:call-template>
  599. </xsl:attribute>
  600. <xsl:attribute name="initial-page-number">
  601. <xsl:call-template name="initial.page.number">
  602. <xsl:with-param name="element" select="'toc'"/>
  603. <xsl:with-param name="master-reference"
  604. select="$lot-master-reference"/>
  605. </xsl:call-template>
  606. </xsl:attribute>
  607. <xsl:attribute name="force-page-count">
  608. <xsl:call-template name="force.page.count">
  609. <xsl:with-param name="master-reference"
  610. select="$lot-master-reference"/>
  611. </xsl:call-template>
  612. </xsl:attribute>
  613. <xsl:attribute name="hyphenation-character">
  614. <xsl:call-template name="gentext">
  615. <xsl:with-param name="key" select="'hyphenation-character'"/>
  616. </xsl:call-template>
  617. </xsl:attribute>
  618. <xsl:attribute name="hyphenation-push-character-count">
  619. <xsl:call-template name="gentext">
  620. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  621. </xsl:call-template>
  622. </xsl:attribute>
  623. <xsl:attribute name="hyphenation-remain-character-count">
  624. <xsl:call-template name="gentext">
  625. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  626. </xsl:call-template>
  627. </xsl:attribute>
  628. <xsl:apply-templates select="." mode="running.head.mode">
  629. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  630. <xsl:with-param name="gentext-key" select="'ListofProcedures'"/>
  631. </xsl:apply-templates>
  632. <xsl:apply-templates select="." mode="running.foot.mode">
  633. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  634. <xsl:with-param name="gentext-key" select="'ListofProcedures'"/>
  635. </xsl:apply-templates>
  636. <fo:flow flow-name="xsl-region-body">
  637. <xsl:call-template name="set.flow.properties">
  638. <xsl:with-param name="element" select="local-name(.)"/>
  639. <xsl:with-param name="master-reference"
  640. select="$lot-master-reference"/>
  641. </xsl:call-template>
  642. <xsl:call-template name="list.of.titles">
  643. <xsl:with-param name="titles" select="'procedure'"/>
  644. <xsl:with-param name="nodes" select=".//procedure[title]"/>
  645. </xsl:call-template>
  646. </fo:flow>
  647. </fo:page-sequence>
  648. </xsl:if>
  649. <xsl:apply-templates select="$content"/>
  650. </xsl:template>
  651. <xsl:template match="book/bookinfo"></xsl:template>
  652. <xsl:template match="book/info"></xsl:template>
  653. <xsl:template match="book/title"></xsl:template>
  654. <xsl:template match="book/subtitle"></xsl:template>
  655. <xsl:template match="book/titleabbrev"></xsl:template>
  656. <!-- ==================================================================== -->
  657. <xsl:template match="part">
  658. <xsl:if test="not(partintro)">
  659. <xsl:apply-templates select="." mode="part.titlepage.mode"/>
  660. <xsl:call-template name="generate.part.toc"/>
  661. </xsl:if>
  662. <xsl:apply-templates/>
  663. </xsl:template>
  664. <xsl:template match="part" mode="part.titlepage.mode">
  665. <!-- done this way to force the context node to be the part -->
  666. <xsl:param name="additional.content"/>
  667. <xsl:variable name="id">
  668. <xsl:call-template name="object.id"/>
  669. </xsl:variable>
  670. <xsl:variable name="titlepage-master-reference">
  671. <xsl:call-template name="select.pagemaster">
  672. <xsl:with-param name="pageclass" select="'titlepage'"/>
  673. </xsl:call-template>
  674. </xsl:variable>
  675. <fo:page-sequence hyphenate="{$hyphenate}"
  676. master-reference="{$titlepage-master-reference}">
  677. <xsl:attribute name="language">
  678. <xsl:call-template name="l10n.language"/>
  679. </xsl:attribute>
  680. <xsl:attribute name="format">
  681. <xsl:call-template name="page.number.format">
  682. <xsl:with-param name="master-reference"
  683. select="$titlepage-master-reference"/>
  684. </xsl:call-template>
  685. </xsl:attribute>
  686. <xsl:attribute name="initial-page-number">
  687. <xsl:call-template name="initial.page.number">
  688. <xsl:with-param name="master-reference"
  689. select="$titlepage-master-reference"/>
  690. </xsl:call-template>
  691. </xsl:attribute>
  692. <xsl:attribute name="force-page-count">
  693. <xsl:call-template name="force.page.count">
  694. <xsl:with-param name="master-reference"
  695. select="$titlepage-master-reference"/>
  696. </xsl:call-template>
  697. </xsl:attribute>
  698. <xsl:attribute name="hyphenation-character">
  699. <xsl:call-template name="gentext">
  700. <xsl:with-param name="key" select="'hyphenation-character'"/>
  701. </xsl:call-template>
  702. </xsl:attribute>
  703. <xsl:attribute name="hyphenation-push-character-count">
  704. <xsl:call-template name="gentext">
  705. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  706. </xsl:call-template>
  707. </xsl:attribute>
  708. <xsl:attribute name="hyphenation-remain-character-count">
  709. <xsl:call-template name="gentext">
  710. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  711. </xsl:call-template>
  712. </xsl:attribute>
  713. <xsl:apply-templates select="." mode="running.head.mode">
  714. <xsl:with-param name="master-reference" select="$titlepage-master-reference"/>
  715. </xsl:apply-templates>
  716. <xsl:apply-templates select="." mode="running.foot.mode">
  717. <xsl:with-param name="master-reference" select="$titlepage-master-reference"/>
  718. </xsl:apply-templates>
  719. <fo:flow flow-name="xsl-region-body">
  720. <xsl:call-template name="set.flow.properties">
  721. <xsl:with-param name="element" select="local-name(.)"/>
  722. <xsl:with-param name="master-reference"
  723. select="$titlepage-master-reference"/>
  724. </xsl:call-template>
  725. <fo:block id="{$id}">
  726. <xsl:call-template name="part.titlepage"/>
  727. </fo:block>
  728. <xsl:copy-of select="$additional.content"/>
  729. </fo:flow>
  730. </fo:page-sequence>
  731. </xsl:template>
  732. <xsl:template match="part/docinfo|partinfo"></xsl:template>
  733. <xsl:template match="part/info"></xsl:template>
  734. <xsl:template match="part/title"></xsl:template>
  735. <xsl:template match="part/subtitle"></xsl:template>
  736. <xsl:template match="part/titleabbrev"></xsl:template>
  737. <!-- ==================================================================== -->
  738. <xsl:template name="generate.part.toc">
  739. <xsl:param name="part" select="."/>
  740. <xsl:variable name="lot-master-reference">
  741. <xsl:call-template name="select.pagemaster">
  742. <xsl:with-param name="pageclass" select="'lot'"/>
  743. </xsl:call-template>
  744. </xsl:variable>
  745. <xsl:variable name="toc.params">
  746. <xsl:call-template name="find.path.params">
  747. <xsl:with-param name="node" select="$part"/>
  748. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  749. </xsl:call-template>
  750. </xsl:variable>
  751. <xsl:variable name="nodes" select="reference|
  752. preface|
  753. chapter|
  754. appendix|
  755. article|
  756. bibliography|
  757. glossary|
  758. index"/>
  759. <xsl:if test="count($nodes) &gt; 0 and contains($toc.params, 'toc')">
  760. <fo:page-sequence hyphenate="{$hyphenate}"
  761. master-reference="{$lot-master-reference}">
  762. <xsl:attribute name="language">
  763. <xsl:call-template name="l10n.language"/>
  764. </xsl:attribute>
  765. <xsl:attribute name="format">
  766. <xsl:call-template name="page.number.format">
  767. <xsl:with-param name="element" select="'toc'"/>
  768. <xsl:with-param name="master-reference"
  769. select="$lot-master-reference"/>
  770. </xsl:call-template>
  771. </xsl:attribute>
  772. <xsl:attribute name="initial-page-number">
  773. <xsl:call-template name="initial.page.number">
  774. <xsl:with-param name="element" select="'toc'"/>
  775. <xsl:with-param name="master-reference"
  776. select="$lot-master-reference"/>
  777. </xsl:call-template>
  778. </xsl:attribute>
  779. <xsl:attribute name="force-page-count">
  780. <xsl:call-template name="force.page.count">
  781. <xsl:with-param name="master-reference"
  782. select="$lot-master-reference"/>
  783. </xsl:call-template>
  784. </xsl:attribute>
  785. <xsl:attribute name="hyphenation-character">
  786. <xsl:call-template name="gentext">
  787. <xsl:with-param name="key" select="'hyphenation-character'"/>
  788. </xsl:call-template>
  789. </xsl:attribute>
  790. <xsl:attribute name="hyphenation-push-character-count">
  791. <xsl:call-template name="gentext">
  792. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  793. </xsl:call-template>
  794. </xsl:attribute>
  795. <xsl:attribute name="hyphenation-remain-character-count">
  796. <xsl:call-template name="gentext">
  797. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  798. </xsl:call-template>
  799. </xsl:attribute>
  800. <xsl:apply-templates select="$part" mode="running.head.mode">
  801. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  802. </xsl:apply-templates>
  803. <xsl:apply-templates select="$part" mode="running.foot.mode">
  804. <xsl:with-param name="master-reference" select="$lot-master-reference"/>
  805. </xsl:apply-templates>
  806. <fo:flow flow-name="xsl-region-body">
  807. <xsl:call-template name="set.flow.properties">
  808. <xsl:with-param name="element" select="local-name(.)"/>
  809. <xsl:with-param name="master-reference"
  810. select="$lot-master-reference"/>
  811. </xsl:call-template>
  812. <xsl:call-template name="division.toc">
  813. <xsl:with-param name="toc-context" select="$part"/>
  814. <xsl:with-param name="toc.title.p"
  815. select="contains($toc.params, 'title')"/>
  816. </xsl:call-template>
  817. </fo:flow>
  818. </fo:page-sequence>
  819. </xsl:if>
  820. </xsl:template>
  821. <!-- ==================================================================== -->
  822. <xsl:template match="part/partintro">
  823. <xsl:apply-templates select=".." mode="part.titlepage.mode">
  824. <xsl:with-param name="additional.content">
  825. <xsl:if test="title">
  826. <xsl:call-template name="partintro.titlepage"/>
  827. </xsl:if>
  828. <xsl:apply-templates/>
  829. </xsl:with-param>
  830. </xsl:apply-templates>
  831. <xsl:call-template name="generate.part.toc">
  832. <xsl:with-param name="part" select=".."/>
  833. </xsl:call-template>
  834. </xsl:template>
  835. <xsl:template match="partintro/title"></xsl:template>
  836. <xsl:template match="partintro/subtitle"></xsl:template>
  837. <xsl:template match="partintro/titleabbrev"></xsl:template>
  838. <!-- ==================================================================== -->
  839. <xsl:template match="book" mode="division.number">
  840. <xsl:number from="set" count="book" format="1."/>
  841. </xsl:template>
  842. <xsl:template match="part" mode="division.number">
  843. <xsl:number from="book" count="part" format="I."/>
  844. </xsl:template>
  845. </xsl:stylesheet>