sections.xsl 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. <?xml version="1.0" encoding="ASCII"?>
  2. <!--This file was created automatically by html2xhtml-->
  3. <!--from the HTML stylesheets.-->
  4. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
  5. <!-- ********************************************************************
  6. $Id: sections.xsl 9392 2012-06-02 20:10:58Z bobstayton $
  7. ********************************************************************
  8. This file is part of the XSL DocBook Stylesheet distribution.
  9. See ../README or http://docbook.sf.net/release/xsl/current/ for
  10. copyright and other information.
  11. ******************************************************************** -->
  12. <!-- ==================================================================== -->
  13. <xsl:template match="section">
  14. <xsl:variable name="depth" select="count(ancestor::section)+1"/>
  15. <xsl:call-template name="id.warning"/>
  16. <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
  17. <xsl:call-template name="common.html.attributes">
  18. <xsl:with-param name="inherit" select="1"/>
  19. </xsl:call-template>
  20. <xsl:call-template name="id.attribute">
  21. <xsl:with-param name="conditional" select="0"/>
  22. </xsl:call-template>
  23. <xsl:call-template name="section.titlepage"/>
  24. <xsl:variable name="toc.params">
  25. <xsl:call-template name="find.path.params">
  26. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  27. </xsl:call-template>
  28. </xsl:variable>
  29. <xsl:if test="contains($toc.params, 'toc') and $depth &lt;= $generate.section.toc.level">
  30. <xsl:call-template name="section.toc">
  31. <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
  32. </xsl:call-template>
  33. <xsl:call-template name="section.toc.separator"/>
  34. </xsl:if>
  35. <xsl:apply-templates/>
  36. <xsl:call-template name="process.chunk.footnotes"/>
  37. </xsl:element>
  38. </xsl:template>
  39. <xsl:template name="section.title">
  40. <!-- the context node should be the title of a section when called -->
  41. <xsl:variable name="section" select="(ancestor::section |ancestor::simplesect |ancestor::sect1 |ancestor::sect2 |ancestor::sect3 |ancestor::sect4 |ancestor::sect5)[last()]"/>
  42. <xsl:variable name="renderas">
  43. <xsl:choose>
  44. <xsl:when test="$section/@renderas = 'sect1'">1</xsl:when>
  45. <xsl:when test="$section/@renderas = 'sect2'">2</xsl:when>
  46. <xsl:when test="$section/@renderas = 'sect3'">3</xsl:when>
  47. <xsl:when test="$section/@renderas = 'sect4'">4</xsl:when>
  48. <xsl:when test="$section/@renderas = 'sect5'">5</xsl:when>
  49. <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
  50. </xsl:choose>
  51. </xsl:variable>
  52. <xsl:variable name="level">
  53. <xsl:choose>
  54. <xsl:when test="$renderas != ''">
  55. <xsl:value-of select="$renderas"/>
  56. </xsl:when>
  57. <xsl:otherwise>
  58. <xsl:call-template name="section.level">
  59. <xsl:with-param name="node" select="$section"/>
  60. </xsl:call-template>
  61. </xsl:otherwise>
  62. </xsl:choose>
  63. </xsl:variable>
  64. <xsl:call-template name="section.heading">
  65. <xsl:with-param name="section" select="$section"/>
  66. <xsl:with-param name="level" select="$level"/>
  67. <xsl:with-param name="title">
  68. <xsl:apply-templates select="$section" mode="object.title.markup">
  69. <xsl:with-param name="allow-anchors" select="1"/>
  70. </xsl:apply-templates>
  71. </xsl:with-param>
  72. </xsl:call-template>
  73. </xsl:template>
  74. <xsl:template match="section/title |section/info/title |sectioninfo/title" mode="titlepage.mode" priority="2">
  75. <xsl:call-template name="section.title"/>
  76. </xsl:template>
  77. <xsl:template match="sect1">
  78. <xsl:call-template name="id.warning"/>
  79. <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
  80. <xsl:call-template name="common.html.attributes">
  81. <xsl:with-param name="inherit" select="1"/>
  82. </xsl:call-template>
  83. <xsl:call-template name="id.attribute">
  84. <xsl:with-param name="conditional" select="0"/>
  85. </xsl:call-template>
  86. <xsl:choose>
  87. <xsl:when test="@renderas = 'sect2'">
  88. <xsl:call-template name="sect2.titlepage"/>
  89. </xsl:when>
  90. <xsl:when test="@renderas = 'sect3'">
  91. <xsl:call-template name="sect3.titlepage"/>
  92. </xsl:when>
  93. <xsl:when test="@renderas = 'sect4'">
  94. <xsl:call-template name="sect4.titlepage"/>
  95. </xsl:when>
  96. <xsl:when test="@renderas = 'sect5'">
  97. <xsl:call-template name="sect5.titlepage"/>
  98. </xsl:when>
  99. <xsl:otherwise>
  100. <xsl:call-template name="sect1.titlepage"/>
  101. </xsl:otherwise>
  102. </xsl:choose>
  103. <xsl:variable name="toc.params">
  104. <xsl:call-template name="find.path.params">
  105. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  106. </xsl:call-template>
  107. </xsl:variable>
  108. <xsl:if test="contains($toc.params, 'toc') and $generate.section.toc.level &gt;= 1">
  109. <xsl:call-template name="section.toc">
  110. <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
  111. </xsl:call-template>
  112. <xsl:call-template name="section.toc.separator"/>
  113. </xsl:if>
  114. <xsl:apply-templates/>
  115. <xsl:call-template name="process.chunk.footnotes"/>
  116. </xsl:element>
  117. </xsl:template>
  118. <xsl:template match="sect1/title |sect1/info/title |sect1info/title" mode="titlepage.mode" priority="2">
  119. <xsl:call-template name="section.title"/>
  120. </xsl:template>
  121. <xsl:template match="sect2">
  122. <xsl:call-template name="id.warning"/>
  123. <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
  124. <xsl:call-template name="common.html.attributes">
  125. <xsl:with-param name="inherit" select="1"/>
  126. </xsl:call-template>
  127. <xsl:call-template name="id.attribute">
  128. <xsl:with-param name="conditional" select="0"/>
  129. </xsl:call-template>
  130. <xsl:choose>
  131. <xsl:when test="@renderas = 'sect1'">
  132. <xsl:call-template name="sect1.titlepage"/>
  133. </xsl:when>
  134. <xsl:when test="@renderas = 'sect3'">
  135. <xsl:call-template name="sect3.titlepage"/>
  136. </xsl:when>
  137. <xsl:when test="@renderas = 'sect4'">
  138. <xsl:call-template name="sect4.titlepage"/>
  139. </xsl:when>
  140. <xsl:when test="@renderas = 'sect5'">
  141. <xsl:call-template name="sect5.titlepage"/>
  142. </xsl:when>
  143. <xsl:otherwise>
  144. <xsl:call-template name="sect2.titlepage"/>
  145. </xsl:otherwise>
  146. </xsl:choose>
  147. <xsl:variable name="toc.params">
  148. <xsl:call-template name="find.path.params">
  149. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  150. </xsl:call-template>
  151. </xsl:variable>
  152. <xsl:if test="contains($toc.params, 'toc') and $generate.section.toc.level &gt;= 2">
  153. <xsl:call-template name="section.toc">
  154. <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
  155. </xsl:call-template>
  156. <xsl:call-template name="section.toc.separator"/>
  157. </xsl:if>
  158. <xsl:apply-templates/>
  159. <xsl:call-template name="process.chunk.footnotes"/>
  160. </xsl:element>
  161. </xsl:template>
  162. <xsl:template match="sect2/title |sect2/info/title |sect2info/title" mode="titlepage.mode" priority="2">
  163. <xsl:call-template name="section.title"/>
  164. </xsl:template>
  165. <xsl:template match="sect3">
  166. <xsl:call-template name="id.warning"/>
  167. <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
  168. <xsl:call-template name="common.html.attributes">
  169. <xsl:with-param name="inherit" select="1"/>
  170. </xsl:call-template>
  171. <xsl:call-template name="id.attribute">
  172. <xsl:with-param name="conditional" select="0"/>
  173. </xsl:call-template>
  174. <xsl:choose>
  175. <xsl:when test="@renderas = 'sect1'">
  176. <xsl:call-template name="sect1.titlepage"/>
  177. </xsl:when>
  178. <xsl:when test="@renderas = 'sect2'">
  179. <xsl:call-template name="sect2.titlepage"/>
  180. </xsl:when>
  181. <xsl:when test="@renderas = 'sect4'">
  182. <xsl:call-template name="sect4.titlepage"/>
  183. </xsl:when>
  184. <xsl:when test="@renderas = 'sect5'">
  185. <xsl:call-template name="sect5.titlepage"/>
  186. </xsl:when>
  187. <xsl:otherwise>
  188. <xsl:call-template name="sect3.titlepage"/>
  189. </xsl:otherwise>
  190. </xsl:choose>
  191. <xsl:variable name="toc.params">
  192. <xsl:call-template name="find.path.params">
  193. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  194. </xsl:call-template>
  195. </xsl:variable>
  196. <xsl:if test="contains($toc.params, 'toc') and $generate.section.toc.level &gt;= 3">
  197. <xsl:call-template name="section.toc">
  198. <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
  199. </xsl:call-template>
  200. <xsl:call-template name="section.toc.separator"/>
  201. </xsl:if>
  202. <xsl:apply-templates/>
  203. <xsl:call-template name="process.chunk.footnotes"/>
  204. </xsl:element>
  205. </xsl:template>
  206. <xsl:template match="sect3/title |sect3/info/title |sect3info/title" mode="titlepage.mode" priority="2">
  207. <xsl:call-template name="section.title"/>
  208. </xsl:template>
  209. <xsl:template match="sect4">
  210. <xsl:call-template name="id.warning"/>
  211. <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
  212. <xsl:call-template name="common.html.attributes">
  213. <xsl:with-param name="inherit" select="1"/>
  214. </xsl:call-template>
  215. <xsl:call-template name="id.attribute">
  216. <xsl:with-param name="conditional" select="0"/>
  217. </xsl:call-template>
  218. <xsl:choose>
  219. <xsl:when test="@renderas = 'sect1'">
  220. <xsl:call-template name="sect1.titlepage"/>
  221. </xsl:when>
  222. <xsl:when test="@renderas = 'sect2'">
  223. <xsl:call-template name="sect2.titlepage"/>
  224. </xsl:when>
  225. <xsl:when test="@renderas = 'sect3'">
  226. <xsl:call-template name="sect3.titlepage"/>
  227. </xsl:when>
  228. <xsl:when test="@renderas = 'sect5'">
  229. <xsl:call-template name="sect5.titlepage"/>
  230. </xsl:when>
  231. <xsl:otherwise>
  232. <xsl:call-template name="sect4.titlepage"/>
  233. </xsl:otherwise>
  234. </xsl:choose>
  235. <xsl:variable name="toc.params">
  236. <xsl:call-template name="find.path.params">
  237. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  238. </xsl:call-template>
  239. </xsl:variable>
  240. <xsl:if test="contains($toc.params, 'toc') and $generate.section.toc.level &gt;= 4">
  241. <xsl:call-template name="section.toc">
  242. <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
  243. </xsl:call-template>
  244. <xsl:call-template name="section.toc.separator"/>
  245. </xsl:if>
  246. <xsl:apply-templates/>
  247. <xsl:call-template name="process.chunk.footnotes"/>
  248. </xsl:element>
  249. </xsl:template>
  250. <xsl:template match="sect4/title |sect4/info/title |sect4info/title" mode="titlepage.mode" priority="2">
  251. <xsl:call-template name="section.title"/>
  252. </xsl:template>
  253. <xsl:template match="sect5">
  254. <xsl:call-template name="id.warning"/>
  255. <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
  256. <xsl:call-template name="common.html.attributes">
  257. <xsl:with-param name="inherit" select="1"/>
  258. </xsl:call-template>
  259. <xsl:call-template name="id.attribute">
  260. <xsl:with-param name="conditional" select="0"/>
  261. </xsl:call-template>
  262. <xsl:choose>
  263. <xsl:when test="@renderas = 'sect1'">
  264. <xsl:call-template name="sect1.titlepage"/>
  265. </xsl:when>
  266. <xsl:when test="@renderas = 'sect2'">
  267. <xsl:call-template name="sect2.titlepage"/>
  268. </xsl:when>
  269. <xsl:when test="@renderas = 'sect3'">
  270. <xsl:call-template name="sect3.titlepage"/>
  271. </xsl:when>
  272. <xsl:when test="@renderas = 'sect4'">
  273. <xsl:call-template name="sect4.titlepage"/>
  274. </xsl:when>
  275. <xsl:otherwise>
  276. <xsl:call-template name="sect5.titlepage"/>
  277. </xsl:otherwise>
  278. </xsl:choose>
  279. <xsl:variable name="toc.params">
  280. <xsl:call-template name="find.path.params">
  281. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  282. </xsl:call-template>
  283. </xsl:variable>
  284. <xsl:if test="contains($toc.params, 'toc') and $generate.section.toc.level &gt;= 5">
  285. <xsl:call-template name="section.toc">
  286. <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
  287. </xsl:call-template>
  288. <xsl:call-template name="section.toc.separator"/>
  289. </xsl:if>
  290. <xsl:apply-templates/>
  291. <xsl:call-template name="process.chunk.footnotes"/>
  292. </xsl:element>
  293. </xsl:template>
  294. <xsl:template match="sect5/title |sect5/info/title |sect5info/title" mode="titlepage.mode" priority="2">
  295. <xsl:call-template name="section.title"/>
  296. </xsl:template>
  297. <xsl:template match="simplesect">
  298. <xsl:call-template name="id.warning"/>
  299. <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
  300. <xsl:call-template name="common.html.attributes">
  301. <xsl:with-param name="inherit" select="1"/>
  302. </xsl:call-template>
  303. <xsl:call-template name="id.attribute">
  304. <xsl:with-param name="conditional" select="0"/>
  305. </xsl:call-template>
  306. <xsl:call-template name="simplesect.titlepage"/>
  307. <xsl:apply-templates/>
  308. </xsl:element>
  309. </xsl:template>
  310. <xsl:template match="simplesect/title|simplesect/info/title" mode="titlepage.mode" priority="2">
  311. <xsl:call-template name="section.title"/>
  312. </xsl:template>
  313. <xsl:template match="section/title"/>
  314. <xsl:template match="section/titleabbrev"/>
  315. <xsl:template match="section/subtitle"/>
  316. <xsl:template match="sectioninfo"/>
  317. <xsl:template match="section/info"/>
  318. <xsl:template match="sect1/title"/>
  319. <xsl:template match="sect1/titleabbrev"/>
  320. <xsl:template match="sect1/subtitle"/>
  321. <xsl:template match="sect1info"/>
  322. <xsl:template match="sect1/info"/>
  323. <xsl:template match="sect2/title"/>
  324. <xsl:template match="sect2/subtitle"/>
  325. <xsl:template match="sect2/titleabbrev"/>
  326. <xsl:template match="sect2info"/>
  327. <xsl:template match="sect2/info"/>
  328. <xsl:template match="sect3/title"/>
  329. <xsl:template match="sect3/subtitle"/>
  330. <xsl:template match="sect3/titleabbrev"/>
  331. <xsl:template match="sect3info"/>
  332. <xsl:template match="sect3/info"/>
  333. <xsl:template match="sect4/title"/>
  334. <xsl:template match="sect4/subtitle"/>
  335. <xsl:template match="sect4/titleabbrev"/>
  336. <xsl:template match="sect4info"/>
  337. <xsl:template match="sect4/info"/>
  338. <xsl:template match="sect5/title"/>
  339. <xsl:template match="sect5/subtitle"/>
  340. <xsl:template match="sect5/titleabbrev"/>
  341. <xsl:template match="sect5info"/>
  342. <xsl:template match="sect5/info"/>
  343. <xsl:template match="simplesect/title"/>
  344. <xsl:template match="simplesect/subtitle"/>
  345. <xsl:template match="simplesect/titleabbrev"/>
  346. <xsl:template match="simplesect/info"/>
  347. <!-- ==================================================================== -->
  348. <xsl:template name="section.heading">
  349. <xsl:param name="section" select="."/>
  350. <xsl:param name="level" select="1"/>
  351. <xsl:param name="allow-anchors" select="1"/>
  352. <xsl:param name="title"/>
  353. <xsl:param name="class" select="'title'"/>
  354. <xsl:variable name="id">
  355. <xsl:choose>
  356. <!-- Make sure the subtitle doesn't get the same id as the title -->
  357. <xsl:when test="self::subtitle">
  358. <xsl:call-template name="object.id">
  359. <xsl:with-param name="object" select="."/>
  360. </xsl:call-template>
  361. </xsl:when>
  362. <!-- if title is in an *info wrapper, get the grandparent -->
  363. <xsl:when test="contains(local-name(..), 'info')">
  364. <xsl:call-template name="object.id">
  365. <xsl:with-param name="object" select="../.."/>
  366. </xsl:call-template>
  367. </xsl:when>
  368. <xsl:otherwise>
  369. <xsl:call-template name="object.id">
  370. <xsl:with-param name="object" select=".."/>
  371. </xsl:call-template>
  372. </xsl:otherwise>
  373. </xsl:choose>
  374. </xsl:variable>
  375. <!-- HTML H level is one higher than section level -->
  376. <xsl:variable name="hlevel">
  377. <xsl:choose>
  378. <!-- highest valid HTML H level is H6; so anything nested deeper
  379. than 5 levels down just becomes H6 -->
  380. <xsl:when test="$level &gt; 5">6</xsl:when>
  381. <xsl:otherwise>
  382. <xsl:value-of select="$level + 1"/>
  383. </xsl:otherwise>
  384. </xsl:choose>
  385. </xsl:variable>
  386. <xsl:element name="h{$hlevel}" namespace="http://www.w3.org/1999/xhtml">
  387. <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
  388. <xsl:if test="$css.decoration != '0'">
  389. <xsl:if test="$hlevel&lt;3">
  390. <xsl:attribute name="style">clear: both</xsl:attribute>
  391. </xsl:if>
  392. </xsl:if>
  393. <xsl:if test="$allow-anchors != 0">
  394. <xsl:call-template name="anchor">
  395. <xsl:with-param name="node" select="$section"/>
  396. <xsl:with-param name="conditional" select="0"/>
  397. </xsl:call-template>
  398. </xsl:if>
  399. <xsl:copy-of select="$title"/>
  400. </xsl:element>
  401. </xsl:template>
  402. <!-- ==================================================================== -->
  403. <xsl:template match="bridgehead">
  404. <xsl:variable name="container" select="(ancestor::appendix |ancestor::article |ancestor::bibliography |ancestor::chapter |ancestor::glossary |ancestor::glossdiv |ancestor::index |ancestor::partintro |ancestor::preface |ancestor::refsect1 |ancestor::refsect2 |ancestor::refsect3 |ancestor::sect1 |ancestor::sect2 |ancestor::sect3 |ancestor::sect4 |ancestor::sect5 |ancestor::section |ancestor::setindex |ancestor::simplesect)[last()]"/>
  405. <xsl:variable name="clevel">
  406. <xsl:choose>
  407. <xsl:when test="local-name($container) = 'appendix' or local-name($container) = 'chapter' or local-name($container) = 'article' or local-name($container) = 'bibliography' or local-name($container) = 'glossary' or local-name($container) = 'index' or local-name($container) = 'partintro' or local-name($container) = 'preface' or local-name($container) = 'setindex'">1</xsl:when>
  408. <xsl:when test="local-name($container) = 'glossdiv'">
  409. <xsl:value-of select="count(ancestor::glossdiv)+1"/>
  410. </xsl:when>
  411. <xsl:when test="local-name($container) = 'sect1' or local-name($container) = 'sect2' or local-name($container) = 'sect3' or local-name($container) = 'sect4' or local-name($container) = 'sect5' or local-name($container) = 'refsect1' or local-name($container) = 'refsect2' or local-name($container) = 'refsect3' or local-name($container) = 'section' or local-name($container) = 'simplesect'">
  412. <xsl:variable name="slevel">
  413. <xsl:call-template name="section.level">
  414. <xsl:with-param name="node" select="$container"/>
  415. </xsl:call-template>
  416. </xsl:variable>
  417. <xsl:value-of select="$slevel + 1"/>
  418. </xsl:when>
  419. <xsl:otherwise>1</xsl:otherwise>
  420. </xsl:choose>
  421. </xsl:variable>
  422. <!-- HTML H level is one higher than section level -->
  423. <xsl:variable name="hlevel">
  424. <xsl:choose>
  425. <xsl:when test="@renderas = 'sect1'">2</xsl:when>
  426. <xsl:when test="@renderas = 'sect2'">3</xsl:when>
  427. <xsl:when test="@renderas = 'sect3'">4</xsl:when>
  428. <xsl:when test="@renderas = 'sect4'">5</xsl:when>
  429. <xsl:when test="@renderas = 'sect5'">6</xsl:when>
  430. <xsl:otherwise>
  431. <xsl:value-of select="$clevel + 1"/>
  432. </xsl:otherwise>
  433. </xsl:choose>
  434. </xsl:variable>
  435. <xsl:element name="h{$hlevel}" namespace="http://www.w3.org/1999/xhtml">
  436. <xsl:call-template name="id.attribute">
  437. <xsl:with-param name="conditional" select="0"/>
  438. </xsl:call-template>
  439. <xsl:call-template name="anchor">
  440. <xsl:with-param name="conditional" select="0"/>
  441. </xsl:call-template>
  442. <xsl:apply-templates/>
  443. </xsl:element>
  444. </xsl:template>
  445. <xsl:template match="section/subtitle" mode="titlepage.mode" priority="2">
  446. <xsl:call-template name="section.subtitle"/>
  447. </xsl:template>
  448. <xsl:template match="simplesect/subtitle" mode="titlepage.mode" priority="2">
  449. <xsl:call-template name="section.subtitle"/>
  450. </xsl:template>
  451. <xsl:template match="sect1/subtitle" mode="titlepage.mode" priority="2">
  452. <xsl:call-template name="section.subtitle"/>
  453. </xsl:template>
  454. <xsl:template match="sect2/subtitle" mode="titlepage.mode" priority="2">
  455. <xsl:call-template name="section.subtitle"/>
  456. </xsl:template>
  457. <xsl:template match="sect3/subtitle" mode="titlepage.mode" priority="2">
  458. <xsl:call-template name="section.subtitle"/>
  459. </xsl:template>
  460. <xsl:template match="sect4/subtitle" mode="titlepage.mode" priority="2">
  461. <xsl:call-template name="section.subtitle"/>
  462. </xsl:template>
  463. <xsl:template match="sect5/subtitle" mode="titlepage.mode" priority="2">
  464. <xsl:call-template name="section.subtitle"/>
  465. </xsl:template>
  466. <xsl:template name="section.subtitle">
  467. <!-- the context node should be the subtitle of a section when called -->
  468. <xsl:variable name="section" select="(ancestor::section |ancestor::simplesect |ancestor::sect1 |ancestor::sect2 |ancestor::sect3 |ancestor::sect4 |ancestor::sect5)[last()]"/>
  469. <xsl:variable name="level">
  470. <xsl:call-template name="section.level">
  471. <xsl:with-param name="node" select="$section"/>
  472. </xsl:call-template>
  473. </xsl:variable>
  474. <xsl:call-template name="section.heading">
  475. <xsl:with-param name="section" select=".."/>
  476. <xsl:with-param name="allow-anchors" select="0"/>
  477. <!-- subtitle heading level one higher than section level -->
  478. <xsl:with-param name="level" select="$level + 1"/>
  479. <xsl:with-param name="class" select="'subtitle'"/>
  480. <xsl:with-param name="title">
  481. <xsl:apply-templates select="$section" mode="object.subtitle.markup">
  482. <xsl:with-param name="allow-anchors" select="0"/>
  483. </xsl:apply-templates>
  484. </xsl:with-param>
  485. </xsl:call-template>
  486. </xsl:template>
  487. </xsl:stylesheet>