refentry.xsl 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  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 match="reference">
  15. <xsl:if test="not(partintro)">
  16. <xsl:variable name="id">
  17. <xsl:call-template name="object.id"/>
  18. </xsl:variable>
  19. <xsl:variable name="master-reference">
  20. <xsl:call-template name="select.pagemaster"/>
  21. </xsl:variable>
  22. <fo:page-sequence hyphenate="{$hyphenate}"
  23. master-reference="{$master-reference}">
  24. <xsl:attribute name="language">
  25. <xsl:call-template name="l10n.language"/>
  26. </xsl:attribute>
  27. <xsl:attribute name="format">
  28. <xsl:call-template name="page.number.format">
  29. <xsl:with-param name="master-reference" select="$master-reference"/>
  30. </xsl:call-template>
  31. </xsl:attribute>
  32. <xsl:attribute name="initial-page-number">
  33. <xsl:call-template name="initial.page.number">
  34. <xsl:with-param name="master-reference" select="$master-reference"/>
  35. </xsl:call-template>
  36. </xsl:attribute>
  37. <xsl:attribute name="force-page-count">
  38. <xsl:call-template name="force.page.count">
  39. <xsl:with-param name="master-reference" select="$master-reference"/>
  40. </xsl:call-template>
  41. </xsl:attribute>
  42. <xsl:attribute name="hyphenation-character">
  43. <xsl:call-template name="gentext">
  44. <xsl:with-param name="key" select="'hyphenation-character'"/>
  45. </xsl:call-template>
  46. </xsl:attribute>
  47. <xsl:attribute name="hyphenation-push-character-count">
  48. <xsl:call-template name="gentext">
  49. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  50. </xsl:call-template>
  51. </xsl:attribute>
  52. <xsl:attribute name="hyphenation-remain-character-count">
  53. <xsl:call-template name="gentext">
  54. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  55. </xsl:call-template>
  56. </xsl:attribute>
  57. <xsl:apply-templates select="." mode="running.head.mode">
  58. <xsl:with-param name="master-reference" select="$master-reference"/>
  59. </xsl:apply-templates>
  60. <xsl:apply-templates select="." mode="running.foot.mode">
  61. <xsl:with-param name="master-reference" select="$master-reference"/>
  62. </xsl:apply-templates>
  63. <fo:flow flow-name="xsl-region-body">
  64. <xsl:call-template name="set.flow.properties">
  65. <xsl:with-param name="element" select="local-name(.)"/>
  66. <xsl:with-param name="master-reference" select="$master-reference"/>
  67. </xsl:call-template>
  68. <fo:block id="{$id}">
  69. <xsl:call-template name="reference.titlepage"/>
  70. </fo:block>
  71. <!-- Create one page sequence if no pagebreaks needed -->
  72. <xsl:if test="$refentry.pagebreak = 0">
  73. <xsl:apply-templates select="refentry"/>
  74. </xsl:if>
  75. </fo:flow>
  76. </fo:page-sequence>
  77. </xsl:if>
  78. <xsl:apply-templates select="partintro"/>
  79. <xsl:if test="$refentry.pagebreak != 0">
  80. <xsl:apply-templates select="refentry"/>
  81. </xsl:if>
  82. </xsl:template>
  83. <xsl:template match="reference" mode="reference.titlepage.mode">
  84. <xsl:call-template name="reference.titlepage"/>
  85. </xsl:template>
  86. <xsl:template match="reference/partintro">
  87. <xsl:variable name="id">
  88. <xsl:call-template name="object.id">
  89. <xsl:with-param name="object" select="ancestor::reference"/>
  90. </xsl:call-template>
  91. </xsl:variable>
  92. <xsl:variable name="master-reference">
  93. <xsl:call-template name="select.pagemaster"/>
  94. </xsl:variable>
  95. <fo:page-sequence hyphenate="{$hyphenate}"
  96. master-reference="{$master-reference}">
  97. <xsl:attribute name="language">
  98. <xsl:call-template name="l10n.language"/>
  99. </xsl:attribute>
  100. <xsl:attribute name="format">
  101. <xsl:call-template name="page.number.format">
  102. <xsl:with-param name="master-reference" select="$master-reference"/>
  103. </xsl:call-template>
  104. </xsl:attribute>
  105. <xsl:attribute name="initial-page-number">
  106. <xsl:call-template name="initial.page.number">
  107. <xsl:with-param name="master-reference" select="$master-reference"/>
  108. </xsl:call-template>
  109. </xsl:attribute>
  110. <xsl:attribute name="force-page-count">
  111. <xsl:call-template name="force.page.count">
  112. <xsl:with-param name="master-reference" select="$master-reference"/>
  113. </xsl:call-template>
  114. </xsl:attribute>
  115. <xsl:attribute name="hyphenation-character">
  116. <xsl:call-template name="gentext">
  117. <xsl:with-param name="key" select="'hyphenation-character'"/>
  118. </xsl:call-template>
  119. </xsl:attribute>
  120. <xsl:attribute name="hyphenation-push-character-count">
  121. <xsl:call-template name="gentext">
  122. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  123. </xsl:call-template>
  124. </xsl:attribute>
  125. <xsl:attribute name="hyphenation-remain-character-count">
  126. <xsl:call-template name="gentext">
  127. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  128. </xsl:call-template>
  129. </xsl:attribute>
  130. <xsl:apply-templates select="." mode="running.head.mode">
  131. <xsl:with-param name="master-reference" select="$master-reference"/>
  132. </xsl:apply-templates>
  133. <xsl:apply-templates select="." mode="running.foot.mode">
  134. <xsl:with-param name="master-reference" select="$master-reference"/>
  135. </xsl:apply-templates>
  136. <fo:flow flow-name="xsl-region-body">
  137. <xsl:call-template name="set.flow.properties">
  138. <xsl:with-param name="element" select="local-name(.)"/>
  139. <xsl:with-param name="master-reference" select="$master-reference"/>
  140. </xsl:call-template>
  141. <fo:block id="{$id}">
  142. <xsl:apply-templates select=".." mode="reference.titlepage.mode"/>
  143. </fo:block>
  144. <xsl:if test="title">
  145. <xsl:call-template name="partintro.titlepage"/>
  146. </xsl:if>
  147. <xsl:apply-templates/>
  148. <!-- Create one page sequence if no pagebreaks needed -->
  149. <xsl:if test="$refentry.pagebreak = 0">
  150. <xsl:apply-templates select="../refentry"/>
  151. </xsl:if>
  152. </fo:flow>
  153. </fo:page-sequence>
  154. </xsl:template>
  155. <xsl:template match="reference/docinfo|refentry/refentryinfo"></xsl:template>
  156. <xsl:template match="reference/info"></xsl:template>
  157. <xsl:template match="reference/title"></xsl:template>
  158. <xsl:template match="reference/subtitle"></xsl:template>
  159. <!-- ==================================================================== -->
  160. <xsl:template match="refentry">
  161. <xsl:variable name="id">
  162. <xsl:call-template name="object.id"/>
  163. </xsl:variable>
  164. <xsl:variable name="master-reference">
  165. <xsl:call-template name="select.pagemaster"/>
  166. </xsl:variable>
  167. <xsl:variable name="refentry.content">
  168. <fo:block id="{$id}">
  169. <xsl:apply-templates/>
  170. </fo:block>
  171. </xsl:variable>
  172. <xsl:choose>
  173. <xsl:when test="not(parent::*) or
  174. (parent::reference and $refentry.pagebreak != 0) or
  175. parent::part">
  176. <!-- make a page sequence -->
  177. <fo:page-sequence hyphenate="{$hyphenate}"
  178. master-reference="{$master-reference}">
  179. <xsl:attribute name="language">
  180. <xsl:call-template name="l10n.language"/>
  181. </xsl:attribute>
  182. <xsl:attribute name="format">
  183. <xsl:call-template name="page.number.format">
  184. <xsl:with-param name="master-reference" select="$master-reference"/>
  185. </xsl:call-template>
  186. </xsl:attribute>
  187. <xsl:attribute name="initial-page-number">
  188. <xsl:call-template name="initial.page.number">
  189. <xsl:with-param name="master-reference" select="$master-reference"/>
  190. </xsl:call-template>
  191. </xsl:attribute>
  192. <xsl:attribute name="force-page-count">
  193. <xsl:call-template name="force.page.count">
  194. <xsl:with-param name="master-reference" select="$master-reference"/>
  195. </xsl:call-template>
  196. </xsl:attribute>
  197. <xsl:attribute name="hyphenation-character">
  198. <xsl:call-template name="gentext">
  199. <xsl:with-param name="key" select="'hyphenation-character'"/>
  200. </xsl:call-template>
  201. </xsl:attribute>
  202. <xsl:attribute name="hyphenation-push-character-count">
  203. <xsl:call-template name="gentext">
  204. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  205. </xsl:call-template>
  206. </xsl:attribute>
  207. <xsl:attribute name="hyphenation-remain-character-count">
  208. <xsl:call-template name="gentext">
  209. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  210. </xsl:call-template>
  211. </xsl:attribute>
  212. <xsl:apply-templates select="." mode="running.head.mode">
  213. <xsl:with-param name="master-reference" select="$master-reference"/>
  214. </xsl:apply-templates>
  215. <xsl:apply-templates select="." mode="running.foot.mode">
  216. <xsl:with-param name="master-reference" select="$master-reference"/>
  217. </xsl:apply-templates>
  218. <fo:flow flow-name="xsl-region-body">
  219. <xsl:call-template name="set.flow.properties">
  220. <xsl:with-param name="element" select="local-name(.)"/>
  221. <xsl:with-param name="master-reference" select="$master-reference"/>
  222. </xsl:call-template>
  223. <xsl:copy-of select="$refentry.content"/>
  224. </fo:flow>
  225. </fo:page-sequence>
  226. </xsl:when>
  227. <xsl:otherwise>
  228. <fo:block>
  229. <xsl:if test="$refentry.pagebreak != 0">
  230. <xsl:attribute name="break-before">page</xsl:attribute>
  231. </xsl:if>
  232. <xsl:copy-of select="$refentry.content"/>
  233. </fo:block>
  234. </xsl:otherwise>
  235. </xsl:choose>
  236. </xsl:template>
  237. <xsl:template match="refmeta">
  238. </xsl:template>
  239. <xsl:template match="manvolnum">
  240. <xsl:if test="$refentry.xref.manvolnum != 0">
  241. <xsl:text>(</xsl:text>
  242. <xsl:apply-templates/>
  243. <xsl:text>)</xsl:text>
  244. </xsl:if>
  245. </xsl:template>
  246. <xsl:template match="refmiscinfo">
  247. </xsl:template>
  248. <xsl:template match="refentrytitle">
  249. <xsl:call-template name="inline.charseq"/>
  250. </xsl:template>
  251. <xsl:template match="refnamediv">
  252. <xsl:variable name="id">
  253. <xsl:call-template name="object.id"/>
  254. </xsl:variable>
  255. <fo:block id="{$id}">
  256. <!-- if refentry.generate.name is non-zero, then we need to generate a -->
  257. <!-- localized "Name" subheading for this refnamdiv (unless it has a -->
  258. <!-- preceding sibling that is a refnamediv, in which case we have already -->
  259. <!-- generated a "Name" subheading, so we don't need to do it again -->
  260. <xsl:if test="$refentry.generate.name != 0">
  261. <xsl:choose>
  262. <xsl:when test="preceding-sibling::refnamediv">
  263. <!-- no generated title on secondary refnamedivs! -->
  264. </xsl:when>
  265. <xsl:otherwise>
  266. <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
  267. xsl:use-attribute-sets="refnamediv.titlepage.recto.style"
  268. font-family="{$title.fontset}">
  269. <!-- Contents of what is now the format.refentry.subheading -->
  270. <!-- template were formerly intended to be used only to -->
  271. <!-- process those subsections of Refentry that have "real" -->
  272. <!-- title children. So as a kludge to get around the fact -->
  273. <!-- that the template still basically "expects" to be -->
  274. <!-- processing that kind of a node, when we call the -->
  275. <!-- template to process generated titles, we must call it -->
  276. <!-- with values for the "offset" and "section" parameters -->
  277. <!-- that are different from the default values in the -->
  278. <!-- format.refentry.subheading template itself. Because -->
  279. <!-- those defaults are the values appropriate for processing -->
  280. <!-- "real" title nodes. -->
  281. <xsl:call-template name="format.refentry.subheading">
  282. <xsl:with-param name="section" select="self::*"/>
  283. <xsl:with-param name="offset" select="1"/>
  284. <xsl:with-param name="gentext.key" select="'RefName'"/>
  285. </xsl:call-template>
  286. </fo:block>
  287. </xsl:otherwise>
  288. </xsl:choose>
  289. </xsl:if>
  290. <xsl:if test="$refentry.generate.title != 0">
  291. <xsl:variable name="section.level">
  292. <xsl:call-template name="refentry.level">
  293. <xsl:with-param name="node" select="ancestor::refentry"/>
  294. </xsl:call-template>
  295. </xsl:variable>
  296. <xsl:variable name="reftitle">
  297. <xsl:choose>
  298. <xsl:when test="../refmeta/refentrytitle">
  299. <xsl:apply-templates select="../refmeta/refentrytitle"/>
  300. </xsl:when>
  301. <xsl:otherwise>
  302. <xsl:apply-templates select="refname[1]"/>
  303. </xsl:otherwise>
  304. </xsl:choose>
  305. </xsl:variable>
  306. <!-- xsl:use-attribute-sets takes only a Qname, not a variable -->
  307. <xsl:choose>
  308. <xsl:when test="preceding-sibling::refnamediv">
  309. <!-- no title on secondary refnamedivs! -->
  310. </xsl:when>
  311. <xsl:when test="$section.level = 1">
  312. <fo:block xsl:use-attribute-sets="refentry.title.properties">
  313. <fo:block xsl:use-attribute-sets="section.title.level1.properties">
  314. <xsl:value-of select="$reftitle"/>
  315. </fo:block>
  316. </fo:block>
  317. </xsl:when>
  318. <xsl:when test="$section.level = 2">
  319. <fo:block xsl:use-attribute-sets="refentry.title.properties">
  320. <fo:block xsl:use-attribute-sets="section.title.level2.properties">
  321. <xsl:value-of select="$reftitle"/>
  322. </fo:block>
  323. </fo:block>
  324. </xsl:when>
  325. <xsl:when test="$section.level = 3">
  326. <fo:block xsl:use-attribute-sets="refentry.title.properties">
  327. <fo:block xsl:use-attribute-sets="section.title.level3.properties">
  328. <xsl:value-of select="$reftitle"/>
  329. </fo:block>
  330. </fo:block>
  331. </xsl:when>
  332. <xsl:when test="$section.level = 4">
  333. <fo:block xsl:use-attribute-sets="refentry.title.properties">
  334. <fo:block xsl:use-attribute-sets="section.title.level4.properties">
  335. <xsl:value-of select="$reftitle"/>
  336. </fo:block>
  337. </fo:block>
  338. </xsl:when>
  339. <xsl:when test="$section.level = 5">
  340. <fo:block xsl:use-attribute-sets="refentry.title.properties">
  341. <fo:block xsl:use-attribute-sets="section.title.level5.properties">
  342. <xsl:value-of select="$reftitle"/>
  343. </fo:block>
  344. </fo:block>
  345. </xsl:when>
  346. <xsl:otherwise>
  347. <fo:block xsl:use-attribute-sets="refentry.title.properties">
  348. <fo:block xsl:use-attribute-sets="section.title.level6.properties">
  349. <xsl:value-of select="$reftitle"/>
  350. </fo:block>
  351. </fo:block>
  352. </xsl:otherwise>
  353. </xsl:choose>
  354. </xsl:if>
  355. <fo:block>
  356. <xsl:if test="not(following-sibling::refnamediv)">
  357. <xsl:attribute name="space-after">1em</xsl:attribute>
  358. </xsl:if>
  359. <xsl:apply-templates/>
  360. </fo:block>
  361. </fo:block>
  362. </xsl:template>
  363. <xsl:template match="refname">
  364. <xsl:if test="not(preceding-sibling::refdescriptor)">
  365. <xsl:apply-templates/>
  366. <xsl:if test="following-sibling::refname">
  367. <xsl:text>, </xsl:text>
  368. </xsl:if>
  369. </xsl:if>
  370. </xsl:template>
  371. <xsl:template match="refpurpose">
  372. <xsl:if test="node()">
  373. <xsl:text> </xsl:text>
  374. <xsl:call-template name="dingbat">
  375. <xsl:with-param name="dingbat">em-dash</xsl:with-param>
  376. </xsl:call-template>
  377. <xsl:text> </xsl:text>
  378. <xsl:apply-templates/>
  379. </xsl:if>
  380. </xsl:template>
  381. <xsl:template match="refdescriptor">
  382. <xsl:apply-templates/>
  383. </xsl:template>
  384. <xsl:template match="refclass">
  385. <xsl:if test="$refclass.suppress = 0">
  386. <fo:block font-weight="bold">
  387. <xsl:if test="@role">
  388. <xsl:value-of select="@role"/>
  389. <xsl:text>: </xsl:text>
  390. </xsl:if>
  391. <xsl:apply-templates/>
  392. </fo:block>
  393. </xsl:if>
  394. </xsl:template>
  395. <xsl:template match="refsynopsisdiv">
  396. <xsl:variable name="id">
  397. <xsl:call-template name="object.id"/>
  398. </xsl:variable>
  399. <fo:block id="{$id}">
  400. <xsl:if test="not(refsynopsisdivinfo/title|docinfo/title|info/title|title)">
  401. <!-- * if we there is no appropriate title for this Refsynopsisdiv, -->
  402. <!-- * then we need to call format.refentry.subheading to generate one -->
  403. <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
  404. xsl:use-attribute-sets="refsynopsisdiv.titlepage.recto.style"
  405. font-family="{$title.fontset}">
  406. <!-- Contents of what is now the format.refentry.subheading -->
  407. <!-- template were formerly intended to be used only to -->
  408. <!-- process those subsections of Refentry that have "real" -->
  409. <!-- title children. So as a kludge to get around the fact -->
  410. <!-- that the template still basically "expects" to be -->
  411. <!-- processing that kind of a node, when we call the -->
  412. <!-- template to process generated titles, we must call it -->
  413. <!-- with values for the "offset" and "section" parameters -->
  414. <!-- that are different from the default values in the -->
  415. <!-- format.refentry.subheading template itself. Because -->
  416. <!-- those defaults are the values appropriate for processing -->
  417. <!-- "real" title nodes. -->
  418. <xsl:call-template name="format.refentry.subheading">
  419. <xsl:with-param name="section" select="parent::*"/>
  420. <xsl:with-param name="offset" select="1"/>
  421. <xsl:with-param name="gentext.key" select="'RefSynopsisDiv'"/>
  422. </xsl:call-template>
  423. </fo:block>
  424. </xsl:if>
  425. <xsl:call-template name="refsynopsisdiv.titlepage"/>
  426. <xsl:apply-templates/>
  427. </fo:block>
  428. </xsl:template>
  429. <xsl:template match="refsection">
  430. <xsl:variable name="id">
  431. <xsl:call-template name="object.id"/>
  432. </xsl:variable>
  433. <fo:block id="{$id}">
  434. <xsl:call-template name="refsection.titlepage"/>
  435. <xsl:apply-templates/>
  436. </fo:block>
  437. </xsl:template>
  438. <xsl:template match="refsect1">
  439. <xsl:variable name="id">
  440. <xsl:call-template name="object.id"/>
  441. </xsl:variable>
  442. <fo:block id="{$id}">
  443. <xsl:call-template name="refsect1.titlepage"/>
  444. <xsl:apply-templates/>
  445. </fo:block>
  446. </xsl:template>
  447. <xsl:template match="refsect2">
  448. <xsl:variable name="id">
  449. <xsl:call-template name="object.id"/>
  450. </xsl:variable>
  451. <fo:block id="{$id}">
  452. <xsl:call-template name="refsect2.titlepage"/>
  453. <xsl:apply-templates/>
  454. </fo:block>
  455. </xsl:template>
  456. <xsl:template match="refsect3">
  457. <xsl:variable name="id">
  458. <xsl:call-template name="object.id"/>
  459. </xsl:variable>
  460. <fo:block id="{$id}">
  461. <xsl:call-template name="refsect3.titlepage"/>
  462. <xsl:apply-templates/>
  463. </fo:block>
  464. </xsl:template>
  465. <xsl:template match="refsynopsisdiv/title
  466. |refsection/title
  467. |refsect1/title
  468. |refsect2/title
  469. |refsect3/title">
  470. <!-- nop; titlepage.mode instead -->
  471. </xsl:template>
  472. <xsl:template match="refsynopsisdiv/title
  473. |refsection/title
  474. |refsect1/title
  475. |refsect2/title
  476. |refsect3/title
  477. |refsynopsisdiv/info/title
  478. |refsection/info/title
  479. |refsect1/info/title
  480. |refsect2/info/title
  481. |refsect3/info/title"
  482. mode="titlepage.mode"
  483. priority="2">
  484. <xsl:call-template name="format.refentry.subheading"/>
  485. </xsl:template>
  486. <xsl:template name="format.refentry.subheading">
  487. <!-- This template is now called to process generated titles for -->
  488. <!-- Refnamediv and Refsynopsisdiv, as well as "real" titles for -->
  489. <!-- Refsynopsisdiv, Refsection, and Refsect[1-3]. -->
  490. <!-- -->
  491. <!-- But the contents of this template were formerly intended to be used -->
  492. <!-- only to process those subsections of Refentry that have "real" title -->
  493. <!-- children. So as a kludge to get around the fact that the template -->
  494. <!-- still basically "expects" to be processing that kind of a node, the -->
  495. <!-- "offset" parameter was added and the "section" variable was changed to -->
  496. <!-- a parameter so that when called for a generated title on a Refnamediv -->
  497. <!-- or Refsynopsisdiv, we can call it like this: -->
  498. <!-- -->
  499. <!-- <xsl:call-template name="format.refentry.subheading"> -->
  500. <!-- <xsl:with-param name="section" select="self::*"/> -->
  501. <!-- <xsl:with-param name="offset" select="1"/> -->
  502. <!-- <xsl:with-param name="gentext.key" select="'RefName'"/> -->
  503. <!-- </xsl:call-template> -->
  504. <!-- -->
  505. <xsl:param name="section"
  506. select="(ancestor::refsynopsysdiv
  507. |ancestor::refsection
  508. |ancestor::refsect1
  509. |ancestor::refsect2
  510. |ancestor::refsect3)[last()]"/>
  511. <xsl:param name="offset" select="0"/>
  512. <xsl:param name="gentext.key"/>
  513. <fo:block keep-with-next.within-column="always">
  514. <xsl:variable name="id">
  515. <xsl:call-template name="object.id">
  516. <xsl:with-param name="object" select="$section"/>
  517. </xsl:call-template>
  518. </xsl:variable>
  519. <xsl:variable name="level">
  520. <xsl:call-template name="section.level">
  521. <xsl:with-param name="node" select="$section"/>
  522. </xsl:call-template>
  523. </xsl:variable>
  524. <xsl:variable name="title">
  525. <!-- If we have a non-empty value for the $gentext.key param, then we -->
  526. <!-- generate an appropriate title here. Otherwise, we have a real -->
  527. <!-- title child, so we copy contents of that to the result tree. -->
  528. <xsl:choose>
  529. <xsl:when test="$gentext.key != ''">
  530. <xsl:call-template name="gentext">
  531. <xsl:with-param name="key" select="$gentext.key"/>
  532. </xsl:call-template>
  533. </xsl:when>
  534. <xsl:otherwise>
  535. <xsl:apply-templates select="$section" mode="object.title.markup">
  536. <xsl:with-param name="allow-anchors" select="1"/>
  537. </xsl:apply-templates>
  538. </xsl:otherwise>
  539. </xsl:choose>
  540. </xsl:variable>
  541. <xsl:if test="$passivetex.extensions != 0">
  542. <fotex:bookmark xmlns:fotex="http://www.tug.org/fotex"
  543. fotex-bookmark-level="{$level + 2 + $offset}"
  544. fotex-bookmark-label="{$id}">
  545. <xsl:value-of select="$title"/>
  546. </fotex:bookmark>
  547. </xsl:if>
  548. <xsl:if test="$axf.extensions != 0">
  549. <xsl:attribute name="axf:outline-level">
  550. <xsl:value-of select="count(ancestor::*)-1 + $offset"/>
  551. </xsl:attribute>
  552. <xsl:attribute name="axf:outline-expand">false</xsl:attribute>
  553. <xsl:attribute name="axf:outline-title">
  554. <xsl:value-of select="$title"/>
  555. </xsl:attribute>
  556. </xsl:if>
  557. <xsl:call-template name="section.heading">
  558. <xsl:with-param name="level" select="$level + $offset"/>
  559. <xsl:with-param name="title" select="$title"/>
  560. </xsl:call-template>
  561. </fo:block>
  562. </xsl:template>
  563. <xsl:template match="refsectioninfo|refsection/info"></xsl:template>
  564. <xsl:template match="refsect1info|refsect1/info"></xsl:template>
  565. <xsl:template match="refsect2info|refsect2/info"></xsl:template>
  566. <xsl:template match="refsect3info|refsect3/info"></xsl:template>
  567. <!-- ==================================================================== -->
  568. </xsl:stylesheet>