sections.xsl 22 KB

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