lists.xsl 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225
  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: lists.xsl 9307 2012-04-28 03:55:07Z 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="itemizedlist">
  14. <!-- Handle spacing="compact" as multiple class attribute instead
  15. of the deprecated HTML compact attribute -->
  16. <xsl:variable name="default.class">
  17. <xsl:value-of select="local-name()"/>
  18. <xsl:if test="@spacing = 'compact'">
  19. <xsl:text> compact</xsl:text>
  20. </xsl:if>
  21. </xsl:variable>
  22. <xsl:variable name="style.value">
  23. <xsl:variable name="type">
  24. <xsl:call-template name="list.itemsymbol"/>
  25. </xsl:variable>
  26. <xsl:text>list-style-type: </xsl:text>
  27. <xsl:value-of select="$type"/>
  28. <xsl:text>; </xsl:text>
  29. </xsl:variable>
  30. <div>
  31. <xsl:call-template name="common.html.attributes"/>
  32. <xsl:call-template name="id.attribute"/>
  33. <xsl:call-template name="anchor"/>
  34. <xsl:if test="title|info/title">
  35. <xsl:call-template name="formal.object.heading"/>
  36. </xsl:if>
  37. <!-- Preserve order of PIs and comments -->
  38. <xsl:apply-templates select="*[not(self::listitem or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::listitem)] |processing-instruction()[not(preceding-sibling::listitem)]"/>
  39. <ul>
  40. <xsl:call-template name="generate.class.attribute">
  41. <xsl:with-param name="class" select="$default.class"/>
  42. </xsl:call-template>
  43. <xsl:choose>
  44. <xsl:when test="$css.decoration != 0">
  45. <xsl:attribute name="style">
  46. <xsl:value-of select="$style.value"/>
  47. </xsl:attribute>
  48. </xsl:when>
  49. <xsl:when test="$make.clean.html != 0">
  50. <!-- styled by separate css only -->
  51. </xsl:when>
  52. <xsl:otherwise>
  53. <!-- use the old @type attribute -->
  54. <xsl:attribute name="type">
  55. <xsl:call-template name="list.itemsymbol"/>
  56. </xsl:attribute>
  57. </xsl:otherwise>
  58. </xsl:choose>
  59. <xsl:apply-templates select="listitem |comment()[preceding-sibling::listitem] |processing-instruction()[preceding-sibling::listitem]"/>
  60. </ul>
  61. </div>
  62. </xsl:template>
  63. <xsl:template match="itemizedlist/title">
  64. <!-- nop -->
  65. </xsl:template>
  66. <xsl:template match="itemizedlist/listitem">
  67. <xsl:variable name="mark" select="../@mark"/>
  68. <xsl:variable name="override" select="@override"/>
  69. <xsl:variable name="usemark">
  70. <xsl:choose>
  71. <xsl:when test="$override != ''">
  72. <xsl:value-of select="$override"/>
  73. </xsl:when>
  74. <xsl:otherwise>
  75. <xsl:value-of select="$mark"/>
  76. </xsl:otherwise>
  77. </xsl:choose>
  78. </xsl:variable>
  79. <xsl:variable name="cssmark">
  80. <xsl:choose>
  81. <xsl:when test="$usemark = 'opencircle'">circle</xsl:when>
  82. <xsl:when test="$usemark = 'bullet'">disc</xsl:when>
  83. <xsl:when test="$usemark = 'box'">square</xsl:when>
  84. <xsl:otherwise>
  85. <xsl:value-of select="$usemark"/>
  86. </xsl:otherwise>
  87. </xsl:choose>
  88. </xsl:variable>
  89. <li>
  90. <xsl:call-template name="common.html.attributes"/>
  91. <xsl:call-template name="id.attribute"/>
  92. <xsl:if test="$css.decoration = '1' and $cssmark != ''">
  93. <xsl:attribute name="style">
  94. <xsl:text>list-style-type: </xsl:text>
  95. <xsl:value-of select="$cssmark"/>
  96. </xsl:attribute>
  97. </xsl:if>
  98. <!-- we can't just drop the anchor in since some browsers (Opera)
  99. get confused about line breaks if we do. So if the first child
  100. is a para, assume the para will put in the anchor. Otherwise,
  101. put the anchor in anyway. -->
  102. <xsl:if test="local-name(child::*[1]) != 'para'">
  103. <xsl:call-template name="anchor"/>
  104. </xsl:if>
  105. <xsl:choose>
  106. <xsl:when test="$show.revisionflag != 0 and @revisionflag">
  107. <div class="{@revisionflag}">
  108. <xsl:apply-templates/>
  109. </div>
  110. </xsl:when>
  111. <xsl:otherwise>
  112. <xsl:apply-templates/>
  113. </xsl:otherwise>
  114. </xsl:choose>
  115. </li>
  116. </xsl:template>
  117. <xsl:template match="orderedlist">
  118. <!-- Handle spacing="compact" as multiple class attribute instead
  119. of the deprecated HTML compact attribute -->
  120. <xsl:variable name="default.class">
  121. <xsl:value-of select="local-name()"/>
  122. <xsl:if test="@spacing = 'compact'">
  123. <xsl:text> compact</xsl:text>
  124. </xsl:if>
  125. </xsl:variable>
  126. <xsl:variable name="start">
  127. <xsl:call-template name="orderedlist-starting-number"/>
  128. </xsl:variable>
  129. <xsl:variable name="numeration">
  130. <xsl:call-template name="list.numeration"/>
  131. </xsl:variable>
  132. <xsl:variable name="type">
  133. <xsl:choose>
  134. <xsl:when test="$numeration='arabic'">1</xsl:when>
  135. <xsl:when test="$numeration='loweralpha'">a</xsl:when>
  136. <xsl:when test="$numeration='lowerroman'">i</xsl:when>
  137. <xsl:when test="$numeration='upperalpha'">A</xsl:when>
  138. <xsl:when test="$numeration='upperroman'">I</xsl:when>
  139. <!-- What!? This should never happen -->
  140. <xsl:otherwise>
  141. <xsl:message>
  142. <xsl:text>Unexpected numeration: </xsl:text>
  143. <xsl:value-of select="$numeration"/>
  144. </xsl:message>
  145. <xsl:value-of select="1"/>
  146. </xsl:otherwise>
  147. </xsl:choose>
  148. </xsl:variable>
  149. <div>
  150. <xsl:call-template name="common.html.attributes"/>
  151. <xsl:call-template name="id.attribute"/>
  152. <xsl:call-template name="anchor"/>
  153. <xsl:if test="title|info/title">
  154. <xsl:call-template name="formal.object.heading"/>
  155. </xsl:if>
  156. <!-- Preserve order of PIs and comments -->
  157. <xsl:apply-templates select="*[not(self::listitem or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::listitem)] |processing-instruction()[not(preceding-sibling::listitem)]"/>
  158. <xsl:choose>
  159. <xsl:when test="@inheritnum='inherit' and ancestor::listitem[parent::orderedlist]">
  160. <table border="{$table.border.off}">
  161. <xsl:call-template name="generate.class.attribute">
  162. <xsl:with-param name="class" select="$default.class"/>
  163. </xsl:call-template>
  164. <colgroup>
  165. <col align="{$direction.align.start}" valign="top"/>
  166. <col/>
  167. </colgroup>
  168. <tbody>
  169. <xsl:apply-templates mode="orderedlist-table" select="listitem |comment()[preceding-sibling::listitem] |processing-instruction()[preceding-sibling::listitem]"/>
  170. </tbody>
  171. </table>
  172. </xsl:when>
  173. <xsl:otherwise>
  174. <ol>
  175. <xsl:call-template name="generate.class.attribute">
  176. <xsl:with-param name="class" select="$default.class"/>
  177. </xsl:call-template>
  178. <xsl:if test="$start != '1'">
  179. <xsl:attribute name="start">
  180. <xsl:value-of select="$start"/>
  181. </xsl:attribute>
  182. </xsl:if>
  183. <xsl:if test="$numeration != ''">
  184. <xsl:attribute name="type">
  185. <xsl:value-of select="$type"/>
  186. </xsl:attribute>
  187. </xsl:if>
  188. <xsl:apply-templates select="listitem |comment()[preceding-sibling::listitem] |processing-instruction()[preceding-sibling::listitem]"/>
  189. </ol>
  190. </xsl:otherwise>
  191. </xsl:choose>
  192. </div>
  193. </xsl:template>
  194. <xsl:template match="orderedlist/title">
  195. <!-- nop -->
  196. </xsl:template>
  197. <xsl:template match="orderedlist/listitem">
  198. <li>
  199. <xsl:call-template name="common.html.attributes"/>
  200. <xsl:call-template name="id.attribute"/>
  201. <xsl:if test="@override">
  202. <xsl:attribute name="value">
  203. <xsl:value-of select="@override"/>
  204. </xsl:attribute>
  205. </xsl:if>
  206. <!-- we can't just drop the anchor in since some browsers (Opera)
  207. get confused about line breaks if we do. So if the first child
  208. is a para, assume the para will put in the anchor. Otherwise,
  209. put the anchor in anyway. -->
  210. <xsl:if test="local-name(child::*[1]) != 'para'">
  211. <xsl:call-template name="anchor"/>
  212. </xsl:if>
  213. <xsl:choose>
  214. <xsl:when test="$show.revisionflag != 0 and @revisionflag">
  215. <div class="{@revisionflag}">
  216. <xsl:apply-templates/>
  217. </div>
  218. </xsl:when>
  219. <xsl:otherwise>
  220. <xsl:apply-templates/>
  221. </xsl:otherwise>
  222. </xsl:choose>
  223. </li>
  224. </xsl:template>
  225. <xsl:template match="orderedlist/listitem" mode="orderedlist-table">
  226. <tr>
  227. <td>
  228. <xsl:apply-templates select="." mode="item-number"/>
  229. </td>
  230. <td>
  231. <xsl:if test="local-name(child::*[1]) != 'para'">
  232. <xsl:call-template name="id.attribute"/>
  233. <xsl:call-template name="anchor"/>
  234. </xsl:if>
  235. <xsl:choose>
  236. <xsl:when test="$show.revisionflag != 0 and @revisionflag">
  237. <div class="{@revisionflag}">
  238. <xsl:apply-templates/>
  239. </div>
  240. </xsl:when>
  241. <xsl:otherwise>
  242. <xsl:apply-templates/>
  243. </xsl:otherwise>
  244. </xsl:choose>
  245. </td>
  246. </tr>
  247. </xsl:template>
  248. <xsl:template match="variablelist">
  249. <xsl:variable name="pi-presentation">
  250. <xsl:call-template name="pi.dbhtml_list-presentation"/>
  251. </xsl:variable>
  252. <!-- Handle spacing="compact" as multiple class attribute instead
  253. of the deprecated HTML compact attribute -->
  254. <xsl:variable name="default.class">
  255. <xsl:value-of select="local-name()"/>
  256. <xsl:if test="@spacing = 'compact'">
  257. <xsl:text> compact</xsl:text>
  258. </xsl:if>
  259. </xsl:variable>
  260. <xsl:variable name="presentation">
  261. <xsl:choose>
  262. <xsl:when test="$pi-presentation != ''">
  263. <xsl:value-of select="$pi-presentation"/>
  264. </xsl:when>
  265. <xsl:when test="$variablelist.as.table != 0">
  266. <xsl:value-of select="'table'"/>
  267. </xsl:when>
  268. <xsl:otherwise>
  269. <xsl:value-of select="'list'"/>
  270. </xsl:otherwise>
  271. </xsl:choose>
  272. </xsl:variable>
  273. <xsl:variable name="list-width">
  274. <xsl:call-template name="pi.dbhtml_list-width"/>
  275. </xsl:variable>
  276. <xsl:variable name="term-width">
  277. <xsl:call-template name="pi.dbhtml_term-width"/>
  278. </xsl:variable>
  279. <xsl:variable name="table-summary">
  280. <xsl:call-template name="pi.dbhtml_table-summary"/>
  281. </xsl:variable>
  282. <div>
  283. <xsl:call-template name="common.html.attributes"/>
  284. <xsl:call-template name="id.attribute"/>
  285. <xsl:call-template name="anchor"/>
  286. <xsl:if test="title|info/title">
  287. <xsl:call-template name="formal.object.heading"/>
  288. </xsl:if>
  289. <xsl:choose>
  290. <xsl:when test="$presentation = 'table'">
  291. <!-- Preserve order of PIs and comments -->
  292. <xsl:apply-templates select="*[not(self::varlistentry or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::varlistentry)] |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
  293. <table border="{$table.border.off}">
  294. <xsl:call-template name="generate.class.attribute">
  295. <xsl:with-param name="class" select="$default.class"/>
  296. </xsl:call-template>
  297. <xsl:if test="$list-width != ''">
  298. <xsl:attribute name="width">
  299. <xsl:value-of select="$list-width"/>
  300. </xsl:attribute>
  301. </xsl:if>
  302. <xsl:if test="$table-summary != ''">
  303. <xsl:attribute name="summary">
  304. <xsl:value-of select="$table-summary"/>
  305. </xsl:attribute>
  306. </xsl:if>
  307. <colgroup>
  308. <col align="{$direction.align.start}" valign="top">
  309. <xsl:if test="$term-width != ''">
  310. <xsl:attribute name="width">
  311. <xsl:value-of select="$term-width"/>
  312. </xsl:attribute>
  313. </xsl:if>
  314. </col>
  315. <col/>
  316. </colgroup>
  317. <tbody>
  318. <xsl:apply-templates mode="varlist-table" select="varlistentry |comment()[preceding-sibling::varlistentry] |processing-instruction()[preceding-sibling::varlistentry]"/>
  319. </tbody>
  320. </table>
  321. </xsl:when>
  322. <xsl:otherwise>
  323. <!-- Preserve order of PIs and comments -->
  324. <xsl:apply-templates select="*[not(self::varlistentry or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::varlistentry)] |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
  325. <dl>
  326. <xsl:call-template name="generate.class.attribute">
  327. <xsl:with-param name="class" select="$default.class"/>
  328. </xsl:call-template>
  329. <xsl:apply-templates select="varlistentry |comment()[preceding-sibling::varlistentry] |processing-instruction()[preceding-sibling::varlistentry]"/>
  330. </dl>
  331. </xsl:otherwise>
  332. </xsl:choose>
  333. </div>
  334. </xsl:template>
  335. <xsl:template match="variablelist/title">
  336. <!-- nop -->
  337. </xsl:template>
  338. <xsl:template match="itemizedlist/titleabbrev|orderedlist/titleabbrev">
  339. <!--nop-->
  340. </xsl:template>
  341. <xsl:template match="variablelist/titleabbrev">
  342. <!--nop-->
  343. </xsl:template>
  344. <xsl:template match="listitem" mode="xref">
  345. <xsl:number format="1"/>
  346. </xsl:template>
  347. <xsl:template match="listitem/simpara" priority="2">
  348. <!-- If a listitem contains only a single simpara, don't output
  349. the <p> wrapper; this has the effect of creating an li
  350. with simple text content. -->
  351. <xsl:choose>
  352. <xsl:when test="not(preceding-sibling::*) and not (following-sibling::*)">
  353. <xsl:call-template name="anchor"/>
  354. <xsl:apply-templates/>
  355. </xsl:when>
  356. <xsl:otherwise>
  357. <p>
  358. <xsl:call-template name="id.attribute"/>
  359. <xsl:choose>
  360. <xsl:when test="@role and $para.propagates.style != 0">
  361. <xsl:call-template name="common.html.attributes">
  362. <xsl:with-param name="class" select="@role"/>
  363. </xsl:call-template>
  364. </xsl:when>
  365. <xsl:otherwise>
  366. <xsl:call-template name="common.html.attributes"/>
  367. </xsl:otherwise>
  368. </xsl:choose>
  369. <xsl:call-template name="anchor"/>
  370. <xsl:apply-templates/>
  371. </p>
  372. </xsl:otherwise>
  373. </xsl:choose>
  374. </xsl:template>
  375. <xsl:template match="varlistentry">
  376. <dt>
  377. <xsl:call-template name="id.attribute"/>
  378. <xsl:call-template name="anchor"/>
  379. <xsl:apply-templates select="term"/>
  380. </dt>
  381. <dd>
  382. <xsl:apply-templates select="listitem"/>
  383. </dd>
  384. </xsl:template>
  385. <xsl:template match="varlistentry" mode="varlist-table">
  386. <xsl:variable name="presentation">
  387. <xsl:call-template name="pi.dbhtml_term-presentation">
  388. <xsl:with-param name="node" select=".."/>
  389. </xsl:call-template>
  390. </xsl:variable>
  391. <xsl:variable name="separator">
  392. <xsl:call-template name="pi.dbhtml_term-separator">
  393. <xsl:with-param name="node" select=".."/>
  394. </xsl:call-template>
  395. </xsl:variable>
  396. <tr>
  397. <xsl:call-template name="tr.attributes">
  398. <xsl:with-param name="rownum">
  399. <xsl:number from="variablelist" count="varlistentry"/>
  400. </xsl:with-param>
  401. </xsl:call-template>
  402. <td>
  403. <xsl:call-template name="id.attribute"/>
  404. <p>
  405. <xsl:call-template name="anchor"/>
  406. <xsl:choose>
  407. <xsl:when test="$presentation = 'bold'">
  408. <strong>
  409. <xsl:apply-templates select="term"/>
  410. <xsl:value-of select="$separator"/>
  411. </strong>
  412. </xsl:when>
  413. <xsl:when test="$presentation = 'italic'">
  414. <em>
  415. <xsl:apply-templates select="term"/>
  416. <xsl:value-of select="$separator"/>
  417. </em>
  418. </xsl:when>
  419. <xsl:when test="$presentation = 'bold-italic'">
  420. <strong>
  421. <em>
  422. <xsl:apply-templates select="term"/>
  423. <xsl:value-of select="$separator"/>
  424. </em>
  425. </strong>
  426. </xsl:when>
  427. <xsl:otherwise>
  428. <xsl:apply-templates select="term"/>
  429. <xsl:value-of select="$separator"/>
  430. </xsl:otherwise>
  431. </xsl:choose>
  432. </p>
  433. </td>
  434. <td>
  435. <xsl:apply-templates select="listitem"/>
  436. </td>
  437. </tr>
  438. </xsl:template>
  439. <xsl:template match="varlistentry/term">
  440. <span>
  441. <xsl:call-template name="common.html.attributes"/>
  442. <xsl:call-template name="id.attribute"/>
  443. <xsl:call-template name="anchor"/>
  444. <xsl:call-template name="simple.xlink">
  445. <xsl:with-param name="content">
  446. <xsl:apply-templates/>
  447. </xsl:with-param>
  448. </xsl:call-template>
  449. <xsl:choose>
  450. <xsl:when test="position() = last()"/> <!-- do nothing -->
  451. <xsl:otherwise>
  452. <!-- * if we have multiple terms in the same varlistentry, generate -->
  453. <!-- * a separator (", " by default) and/or an additional line -->
  454. <!-- * break after each one except the last -->
  455. <xsl:value-of select="$variablelist.term.separator"/>
  456. <xsl:if test="not($variablelist.term.break.after = '0')">
  457. <br/>
  458. </xsl:if>
  459. </xsl:otherwise>
  460. </xsl:choose>
  461. </span>
  462. </xsl:template>
  463. <xsl:template match="varlistentry/listitem">
  464. <!-- we can't just drop the anchor in since some browsers (Opera)
  465. get confused about line breaks if we do. So if the first child
  466. is a para, assume the para will put in the anchor. Otherwise,
  467. put the anchor in anyway. -->
  468. <xsl:if test="local-name(child::*[1]) != 'para'">
  469. <xsl:call-template name="anchor"/>
  470. </xsl:if>
  471. <xsl:choose>
  472. <xsl:when test="$show.revisionflag != 0 and @revisionflag">
  473. <div class="{@revisionflag}">
  474. <xsl:apply-templates/>
  475. </div>
  476. </xsl:when>
  477. <xsl:otherwise>
  478. <xsl:apply-templates/>
  479. </xsl:otherwise>
  480. </xsl:choose>
  481. </xsl:template>
  482. <!-- ==================================================================== -->
  483. <xsl:template match="simplelist">
  484. <!-- with no type specified, the default is 'vert' -->
  485. <xsl:call-template name="anchor"/>
  486. <table border="{$table.border.off}">
  487. <xsl:if test="$div.element != 'section'">
  488. <xsl:attribute name="summary">Simple list</xsl:attribute>
  489. </xsl:if>
  490. <xsl:call-template name="common.html.attributes"/>
  491. <xsl:call-template name="id.attribute"/>
  492. <xsl:call-template name="simplelist.vert">
  493. <xsl:with-param name="cols">
  494. <xsl:choose>
  495. <xsl:when test="@columns">
  496. <xsl:value-of select="@columns"/>
  497. </xsl:when>
  498. <xsl:otherwise>1</xsl:otherwise>
  499. </xsl:choose>
  500. </xsl:with-param>
  501. </xsl:call-template>
  502. </table>
  503. </xsl:template>
  504. <xsl:template match="simplelist[@type='inline']">
  505. <span>
  506. <xsl:call-template name="common.html.attributes"/>
  507. <xsl:call-template name="id.attribute"/>
  508. <!-- if dbchoice PI exists, use that to determine the choice separator -->
  509. <!-- (that is, equivalent of "and" or "or" in current locale), or literal -->
  510. <!-- value of "choice" otherwise -->
  511. <xsl:variable name="localized-choice-separator">
  512. <xsl:choose>
  513. <xsl:when test="processing-instruction('dbchoice')">
  514. <xsl:call-template name="select.choice.separator"/>
  515. </xsl:when>
  516. <xsl:otherwise>
  517. <!-- empty -->
  518. </xsl:otherwise>
  519. </xsl:choose>
  520. </xsl:variable>
  521. <xsl:for-each select="member">
  522. <xsl:call-template name="simple.xlink">
  523. <xsl:with-param name="content">
  524. <xsl:apply-templates/>
  525. </xsl:with-param>
  526. </xsl:call-template>
  527. <xsl:choose>
  528. <xsl:when test="position() = last()"/> <!-- do nothing -->
  529. <xsl:otherwise>
  530. <xsl:text>, </xsl:text>
  531. <xsl:if test="position() = last() - 1">
  532. <xsl:if test="$localized-choice-separator != ''">
  533. <xsl:value-of select="$localized-choice-separator"/>
  534. <xsl:text> </xsl:text>
  535. </xsl:if>
  536. </xsl:if>
  537. </xsl:otherwise>
  538. </xsl:choose>
  539. </xsl:for-each>
  540. </span>
  541. </xsl:template>
  542. <xsl:template match="simplelist[@type='horiz']">
  543. <xsl:call-template name="anchor"/>
  544. <table border="{$table.border.off}">
  545. <xsl:if test="$div.element != 'section'">
  546. <xsl:attribute name="summary">Simple list</xsl:attribute>
  547. </xsl:if>
  548. <xsl:call-template name="common.html.attributes"/>
  549. <xsl:call-template name="id.attribute"/>
  550. <xsl:call-template name="simplelist.horiz">
  551. <xsl:with-param name="cols">
  552. <xsl:choose>
  553. <xsl:when test="@columns">
  554. <xsl:value-of select="@columns"/>
  555. </xsl:when>
  556. <xsl:otherwise>1</xsl:otherwise>
  557. </xsl:choose>
  558. </xsl:with-param>
  559. </xsl:call-template>
  560. </table>
  561. </xsl:template>
  562. <xsl:template match="simplelist[@type='vert']">
  563. <xsl:call-template name="anchor"/>
  564. <table border="{$table.border.off}">
  565. <xsl:if test="$div.element != 'section'">
  566. <xsl:attribute name="summary">Simple list</xsl:attribute>
  567. </xsl:if>
  568. <xsl:call-template name="common.html.attributes"/>
  569. <xsl:call-template name="id.attribute"/>
  570. <xsl:call-template name="simplelist.vert">
  571. <xsl:with-param name="cols">
  572. <xsl:choose>
  573. <xsl:when test="@columns">
  574. <xsl:value-of select="@columns"/>
  575. </xsl:when>
  576. <xsl:otherwise>1</xsl:otherwise>
  577. </xsl:choose>
  578. </xsl:with-param>
  579. </xsl:call-template>
  580. </table>
  581. </xsl:template>
  582. <xsl:template name="simplelist.horiz">
  583. <xsl:param name="cols">1</xsl:param>
  584. <xsl:param name="cell">1</xsl:param>
  585. <xsl:param name="members" select="./member"/>
  586. <xsl:if test="$cell &lt;= count($members)">
  587. <tr>
  588. <xsl:call-template name="tr.attributes">
  589. <xsl:with-param name="row" select="$members[1]"/>
  590. <xsl:with-param name="rownum" select="(($cell - 1) div $cols) + 1"/>
  591. </xsl:call-template>
  592. <xsl:call-template name="simplelist.horiz.row">
  593. <xsl:with-param name="cols" select="$cols"/>
  594. <xsl:with-param name="cell" select="$cell"/>
  595. <xsl:with-param name="members" select="$members"/>
  596. </xsl:call-template>
  597. </tr>
  598. <xsl:call-template name="simplelist.horiz">
  599. <xsl:with-param name="cols" select="$cols"/>
  600. <xsl:with-param name="cell" select="$cell + $cols"/>
  601. <xsl:with-param name="members" select="$members"/>
  602. </xsl:call-template>
  603. </xsl:if>
  604. </xsl:template>
  605. <xsl:template name="simplelist.horiz.row">
  606. <xsl:param name="cols">1</xsl:param>
  607. <xsl:param name="cell">1</xsl:param>
  608. <xsl:param name="members" select="./member"/>
  609. <xsl:param name="curcol">1</xsl:param>
  610. <xsl:if test="$curcol &lt;= $cols">
  611. <td>
  612. <xsl:choose>
  613. <xsl:when test="$members[position()=$cell]">
  614. <xsl:apply-templates select="$members[position()=$cell]"/>
  615. </xsl:when>
  616. <xsl:otherwise>
  617. <xsl:text>&#160;</xsl:text>
  618. </xsl:otherwise>
  619. </xsl:choose>
  620. </td>
  621. <xsl:call-template name="simplelist.horiz.row">
  622. <xsl:with-param name="cols" select="$cols"/>
  623. <xsl:with-param name="cell" select="$cell+1"/>
  624. <xsl:with-param name="members" select="$members"/>
  625. <xsl:with-param name="curcol" select="$curcol+1"/>
  626. </xsl:call-template>
  627. </xsl:if>
  628. </xsl:template>
  629. <xsl:template name="simplelist.vert">
  630. <xsl:param name="cols">1</xsl:param>
  631. <xsl:param name="cell">1</xsl:param>
  632. <xsl:param name="members" select="./member"/>
  633. <xsl:param name="rows" select="floor((count($members)+$cols - 1) div $cols)"/>
  634. <xsl:if test="$cell &lt;= $rows">
  635. <tr>
  636. <xsl:call-template name="tr.attributes">
  637. <xsl:with-param name="row" select="$members[1]"/>
  638. <xsl:with-param name="rownum" select="$cell"/>
  639. </xsl:call-template>
  640. <xsl:call-template name="simplelist.vert.row">
  641. <xsl:with-param name="cols" select="$cols"/>
  642. <xsl:with-param name="rows" select="$rows"/>
  643. <xsl:with-param name="cell" select="$cell"/>
  644. <xsl:with-param name="members" select="$members"/>
  645. </xsl:call-template>
  646. </tr>
  647. <xsl:call-template name="simplelist.vert">
  648. <xsl:with-param name="cols" select="$cols"/>
  649. <xsl:with-param name="cell" select="$cell+1"/>
  650. <xsl:with-param name="members" select="$members"/>
  651. <xsl:with-param name="rows" select="$rows"/>
  652. </xsl:call-template>
  653. </xsl:if>
  654. </xsl:template>
  655. <xsl:template name="simplelist.vert.row">
  656. <xsl:param name="cols">1</xsl:param>
  657. <xsl:param name="rows">1</xsl:param>
  658. <xsl:param name="cell">1</xsl:param>
  659. <xsl:param name="members" select="./member"/>
  660. <xsl:param name="curcol">1</xsl:param>
  661. <xsl:if test="$curcol &lt;= $cols">
  662. <td>
  663. <xsl:choose>
  664. <xsl:when test="$members[position()=$cell]">
  665. <xsl:apply-templates select="$members[position()=$cell]"/>
  666. </xsl:when>
  667. <xsl:otherwise>
  668. <xsl:text>&#160;</xsl:text>
  669. </xsl:otherwise>
  670. </xsl:choose>
  671. </td>
  672. <xsl:call-template name="simplelist.vert.row">
  673. <xsl:with-param name="cols" select="$cols"/>
  674. <xsl:with-param name="rows" select="$rows"/>
  675. <xsl:with-param name="cell" select="$cell+$rows"/>
  676. <xsl:with-param name="members" select="$members"/>
  677. <xsl:with-param name="curcol" select="$curcol+1"/>
  678. </xsl:call-template>
  679. </xsl:if>
  680. </xsl:template>
  681. <xsl:template match="member">
  682. <xsl:call-template name="anchor"/>
  683. <xsl:call-template name="simple.xlink">
  684. <xsl:with-param name="content">
  685. <xsl:apply-templates/>
  686. </xsl:with-param>
  687. </xsl:call-template>
  688. </xsl:template>
  689. <!-- ==================================================================== -->
  690. <xsl:template match="procedure">
  691. <xsl:variable name="param.placement" select="substring-after(normalize-space($formal.title.placement), concat(local-name(.), ' '))"/>
  692. <xsl:variable name="placement">
  693. <xsl:choose>
  694. <xsl:when test="contains($param.placement, ' ')">
  695. <xsl:value-of select="substring-before($param.placement, ' ')"/>
  696. </xsl:when>
  697. <xsl:when test="$param.placement = ''">before</xsl:when>
  698. <xsl:otherwise>
  699. <xsl:value-of select="$param.placement"/>
  700. </xsl:otherwise>
  701. </xsl:choose>
  702. </xsl:variable>
  703. <!-- Preserve order of PIs and comments -->
  704. <xsl:variable name="preamble" select="*[not(self::step or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::step)] |processing-instruction()[not(preceding-sibling::step)]"/>
  705. <div>
  706. <xsl:call-template name="common.html.attributes"/>
  707. <xsl:call-template name="id.attribute">
  708. <xsl:with-param name="conditional">
  709. <xsl:choose>
  710. <xsl:when test="title">0</xsl:when>
  711. <xsl:otherwise>1</xsl:otherwise>
  712. </xsl:choose>
  713. </xsl:with-param>
  714. </xsl:call-template>
  715. <xsl:call-template name="anchor">
  716. <xsl:with-param name="conditional">
  717. <xsl:choose>
  718. <xsl:when test="title">0</xsl:when>
  719. <xsl:otherwise>1</xsl:otherwise>
  720. </xsl:choose>
  721. </xsl:with-param>
  722. </xsl:call-template>
  723. <xsl:if test="(title or info/title) and $placement = 'before'">
  724. <xsl:call-template name="formal.object.heading"/>
  725. </xsl:if>
  726. <xsl:apply-templates select="$preamble"/>
  727. <xsl:choose>
  728. <xsl:when test="count(step) = 1">
  729. <ul>
  730. <xsl:call-template name="generate.class.attribute"/>
  731. <xsl:apply-templates select="step |comment()[preceding-sibling::step] |processing-instruction()[preceding-sibling::step]"/>
  732. </ul>
  733. </xsl:when>
  734. <xsl:otherwise>
  735. <ol>
  736. <xsl:call-template name="generate.class.attribute"/>
  737. <xsl:attribute name="type">
  738. <xsl:value-of select="substring($procedure.step.numeration.formats,1,1)"/>
  739. </xsl:attribute>
  740. <xsl:apply-templates select="step |comment()[preceding-sibling::step] |processing-instruction()[preceding-sibling::step]"/>
  741. </ol>
  742. </xsl:otherwise>
  743. </xsl:choose>
  744. <xsl:if test="(title or info/title) and $placement != 'before'">
  745. <xsl:call-template name="formal.object.heading"/>
  746. </xsl:if>
  747. </div>
  748. </xsl:template>
  749. <xsl:template match="procedure/title">
  750. <!-- nop -->
  751. </xsl:template>
  752. <xsl:template match="substeps">
  753. <xsl:variable name="numeration">
  754. <xsl:call-template name="procedure.step.numeration"/>
  755. </xsl:variable>
  756. <xsl:call-template name="anchor"/>
  757. <ol type="{$numeration}">
  758. <xsl:call-template name="common.html.attributes"/>
  759. <xsl:call-template name="id.attribute"/>
  760. <xsl:apply-templates/>
  761. </ol>
  762. </xsl:template>
  763. <xsl:template match="step">
  764. <li>
  765. <xsl:call-template name="common.html.attributes"/>
  766. <xsl:call-template name="id.attribute"/>
  767. <xsl:call-template name="anchor"/>
  768. <xsl:apply-templates/>
  769. </li>
  770. </xsl:template>
  771. <xsl:template match="stepalternatives">
  772. <xsl:call-template name="anchor"/>
  773. <ul>
  774. <xsl:call-template name="common.html.attributes"/>
  775. <xsl:call-template name="id.attribute"/>
  776. <xsl:apply-templates/>
  777. </ul>
  778. </xsl:template>
  779. <xsl:template match="step/title">
  780. <p>
  781. <xsl:call-template name="common.html.attributes"/>
  782. <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
  783. <xsl:apply-templates/>
  784. </strong>
  785. </p>
  786. </xsl:template>
  787. <!-- ==================================================================== -->
  788. <xsl:template match="segmentedlist">
  789. <xsl:variable name="presentation">
  790. <xsl:call-template name="pi.dbhtml_list-presentation"/>
  791. </xsl:variable>
  792. <div>
  793. <xsl:call-template name="common.html.attributes"/>
  794. <xsl:call-template name="id.attribute"/>
  795. <xsl:call-template name="anchor"/>
  796. <xsl:choose>
  797. <xsl:when test="$presentation = 'table'">
  798. <xsl:apply-templates select="." mode="seglist-table"/>
  799. </xsl:when>
  800. <xsl:when test="$presentation = 'list'">
  801. <xsl:apply-templates/>
  802. </xsl:when>
  803. <xsl:when test="$segmentedlist.as.table != 0">
  804. <xsl:apply-templates select="." mode="seglist-table"/>
  805. </xsl:when>
  806. <xsl:otherwise>
  807. <xsl:apply-templates/>
  808. </xsl:otherwise>
  809. </xsl:choose>
  810. </div>
  811. </xsl:template>
  812. <xsl:template match="segmentedlist/title">
  813. <div>
  814. <xsl:call-template name="common.html.attributes"/>
  815. <strong>
  816. <span>
  817. <xsl:call-template name="generate.class.attribute"/>
  818. <xsl:apply-templates/>
  819. </span>
  820. </strong>
  821. </div>
  822. </xsl:template>
  823. <xsl:template match="segtitle">
  824. </xsl:template>
  825. <xsl:template match="segtitle" mode="segtitle-in-seg">
  826. <xsl:apply-templates/>
  827. </xsl:template>
  828. <xsl:template match="seglistitem">
  829. <div>
  830. <xsl:call-template name="common.html.attributes"/>
  831. <xsl:call-template name="id.attribute"/>
  832. <xsl:call-template name="anchor"/>
  833. <xsl:apply-templates/>
  834. </div>
  835. </xsl:template>
  836. <xsl:template match="seg">
  837. <xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
  838. <xsl:variable name="seglist" select="ancestor::segmentedlist"/>
  839. <xsl:variable name="segtitles" select="$seglist/segtitle"/>
  840. <!--
  841. Note: segtitle is only going to be the right thing in a well formed
  842. SegmentedList. If there are too many Segs or too few SegTitles,
  843. you'll get something odd...maybe an error
  844. -->
  845. <div>
  846. <xsl:call-template name="common.html.attributes"/>
  847. <xsl:call-template name="id.attribute"/>
  848. <strong>
  849. <span class="segtitle">
  850. <xsl:apply-templates select="$segtitles[$segnum=position()]" mode="segtitle-in-seg"/>
  851. <xsl:text>: </xsl:text>
  852. </span>
  853. </strong>
  854. <xsl:apply-templates/>
  855. </div>
  856. </xsl:template>
  857. <xsl:template match="segmentedlist" mode="seglist-table">
  858. <xsl:variable name="table-summary">
  859. <xsl:call-template name="pi.dbhtml_table-summary"/>
  860. </xsl:variable>
  861. <xsl:variable name="list-width">
  862. <xsl:call-template name="pi.dbhtml_list-width"/>
  863. </xsl:variable>
  864. <xsl:apply-templates select="title"/>
  865. <table border="{$table.border.off}">
  866. <xsl:if test="$list-width != ''">
  867. <xsl:attribute name="width">
  868. <xsl:value-of select="$list-width"/>
  869. </xsl:attribute>
  870. </xsl:if>
  871. <xsl:if test="$table-summary != '' and $div.element != 'section'">
  872. <xsl:attribute name="summary">
  873. <xsl:value-of select="$table-summary"/>
  874. </xsl:attribute>
  875. </xsl:if>
  876. <thead>
  877. <tr class="segtitle">
  878. <xsl:call-template name="tr.attributes">
  879. <xsl:with-param name="row" select="segtitle[1]"/>
  880. <xsl:with-param name="rownum" select="1"/>
  881. </xsl:call-template>
  882. <xsl:apply-templates select="segtitle" mode="seglist-table"/>
  883. </tr>
  884. </thead>
  885. <tbody>
  886. <xsl:apply-templates select="seglistitem" mode="seglist-table"/>
  887. </tbody>
  888. </table>
  889. </xsl:template>
  890. <xsl:template match="segtitle" mode="seglist-table">
  891. <th><xsl:apply-templates/></th>
  892. </xsl:template>
  893. <xsl:template match="seglistitem" mode="seglist-table">
  894. <xsl:variable name="seglinum">
  895. <xsl:number from="segmentedlist" count="seglistitem"/>
  896. </xsl:variable>
  897. <tr>
  898. <xsl:call-template name="common.html.attributes"/>
  899. <xsl:call-template name="id.attribute"/>
  900. <xsl:call-template name="tr.attributes">
  901. <xsl:with-param name="rownum" select="$seglinum + 1"/>
  902. </xsl:call-template>
  903. <xsl:apply-templates mode="seglist-table"/>
  904. </tr>
  905. </xsl:template>
  906. <xsl:template match="seg" mode="seglist-table">
  907. <td>
  908. <xsl:call-template name="common.html.attributes"/>
  909. <xsl:call-template name="id.attribute"/>
  910. <xsl:apply-templates/>
  911. </td>
  912. </xsl:template>
  913. <xsl:template match="seg[1]" mode="seglist-table">
  914. <td>
  915. <xsl:call-template name="common.html.attributes"/>
  916. <xsl:call-template name="id.attribute"/>
  917. <xsl:call-template name="anchor">
  918. <xsl:with-param name="node" select="ancestor::seglistitem"/>
  919. </xsl:call-template>
  920. <xsl:apply-templates/>
  921. </td>
  922. </xsl:template>
  923. <!-- ==================================================================== -->
  924. <xsl:template match="calloutlist">
  925. <div>
  926. <xsl:call-template name="common.html.attributes"/>
  927. <xsl:call-template name="id.attribute"/>
  928. <xsl:call-template name="anchor"/>
  929. <xsl:if test="title|info/title">
  930. <xsl:call-template name="formal.object.heading"/>
  931. </xsl:if>
  932. <!-- Preserve order of PIs and comments -->
  933. <xsl:apply-templates select="*[not(self::callout or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::callout)] |processing-instruction()[not(preceding-sibling::callout)]"/>
  934. <xsl:choose>
  935. <xsl:when test="$callout.list.table != 0">
  936. <table border="{$table.border.off}">
  937. <xsl:if test="$div.element != 'section'">
  938. <xsl:attribute name="summary">Callout list</xsl:attribute>
  939. </xsl:if>
  940. <xsl:apply-templates select="callout |comment()[preceding-sibling::callout] |processing-instruction()[preceding-sibling::callout]"/>
  941. </table>
  942. </xsl:when>
  943. <xsl:otherwise>
  944. <dl>
  945. <xsl:apply-templates select="." mode="class.attribute"/>
  946. <xsl:apply-templates select="callout |comment()[preceding-sibling::callout] |processing-instruction()[preceding-sibling::callout]"/>
  947. </dl>
  948. </xsl:otherwise>
  949. </xsl:choose>
  950. </div>
  951. </xsl:template>
  952. <xsl:template match="calloutlist/title">
  953. </xsl:template>
  954. <xsl:template match="callout">
  955. <xsl:choose>
  956. <xsl:when test="$callout.list.table != 0">
  957. <tr>
  958. <xsl:call-template name="tr.attributes">
  959. <xsl:with-param name="rownum">
  960. <xsl:number from="calloutlist" count="callout"/>
  961. </xsl:with-param>
  962. </xsl:call-template>
  963. <td width="5%" valign="top" align="{$direction.align.start}">
  964. <xsl:call-template name="id.attribute"/>
  965. <p>
  966. <xsl:call-template name="anchor"/>
  967. <xsl:call-template name="callout.arearefs">
  968. <xsl:with-param name="arearefs" select="@arearefs"/>
  969. </xsl:call-template>
  970. </p>
  971. </td>
  972. <td valign="top" align="{$direction.align.start}">
  973. <xsl:apply-templates/>
  974. </td>
  975. </tr>
  976. </xsl:when>
  977. <xsl:otherwise>
  978. <dt>
  979. <xsl:call-template name="id.attribute"/>
  980. <xsl:call-template name="anchor"/>
  981. <xsl:call-template name="callout.arearefs">
  982. <xsl:with-param name="arearefs" select="@arearefs"/>
  983. </xsl:call-template>
  984. </dt>
  985. <dd><xsl:apply-templates/></dd>
  986. </xsl:otherwise>
  987. </xsl:choose>
  988. </xsl:template>
  989. <xsl:template match="callout/simpara" priority="2">
  990. <!-- If a callout contains only a single simpara, don't output
  991. the <p> wrapper; this has the effect of creating an li
  992. with simple text content. -->
  993. <xsl:choose>
  994. <xsl:when test="not(preceding-sibling::*) and not (following-sibling::*)">
  995. <xsl:call-template name="anchor"/>
  996. <xsl:apply-templates/>
  997. </xsl:when>
  998. <xsl:otherwise>
  999. <p>
  1000. <xsl:call-template name="id.attribute"/>
  1001. <xsl:if test="@role and $para.propagates.style != 0">
  1002. <xsl:choose>
  1003. <xsl:when test="@role and $para.propagates.style != 0">
  1004. <xsl:call-template name="common.html.attributes">
  1005. <xsl:with-param name="class" select="@role"/>
  1006. </xsl:call-template>
  1007. </xsl:when>
  1008. <xsl:otherwise>
  1009. <xsl:call-template name="common.html.attributes"/>
  1010. </xsl:otherwise>
  1011. </xsl:choose>
  1012. </xsl:if>
  1013. <xsl:call-template name="anchor"/>
  1014. <xsl:apply-templates/>
  1015. </p>
  1016. </xsl:otherwise>
  1017. </xsl:choose>
  1018. </xsl:template>
  1019. <xsl:template name="callout.arearefs">
  1020. <xsl:param name="arearefs"/>
  1021. <xsl:if test="$arearefs!=''">
  1022. <xsl:choose>
  1023. <xsl:when test="substring-before($arearefs,' ')=''">
  1024. <xsl:call-template name="callout.arearef">
  1025. <xsl:with-param name="arearef" select="$arearefs"/>
  1026. </xsl:call-template>
  1027. </xsl:when>
  1028. <xsl:otherwise>
  1029. <xsl:call-template name="callout.arearef">
  1030. <xsl:with-param name="arearef" select="substring-before($arearefs,' ')"/>
  1031. </xsl:call-template>
  1032. </xsl:otherwise>
  1033. </xsl:choose>
  1034. <xsl:call-template name="callout.arearefs">
  1035. <xsl:with-param name="arearefs" select="substring-after($arearefs,' ')"/>
  1036. </xsl:call-template>
  1037. </xsl:if>
  1038. </xsl:template>
  1039. <xsl:template name="callout.arearef">
  1040. <xsl:param name="arearef"/>
  1041. <xsl:variable name="targets" select="key('id',$arearef)"/>
  1042. <xsl:variable name="target" select="$targets[1]"/>
  1043. <xsl:call-template name="check.id.unique">
  1044. <xsl:with-param name="linkend" select="$arearef"/>
  1045. </xsl:call-template>
  1046. <xsl:choose>
  1047. <xsl:when test="count($target)=0">
  1048. <xsl:text>???</xsl:text>
  1049. </xsl:when>
  1050. <xsl:when test="local-name($target)='co'">
  1051. <a>
  1052. <xsl:attribute name="href">
  1053. <xsl:text>#</xsl:text>
  1054. <xsl:value-of select="$arearef"/>
  1055. </xsl:attribute>
  1056. <xsl:apply-templates select="$target" mode="callout-bug"/>
  1057. </a>
  1058. <xsl:text> </xsl:text>
  1059. </xsl:when>
  1060. <xsl:when test="local-name($target)='areaset'">
  1061. <xsl:call-template name="callout-bug">
  1062. <xsl:with-param name="conum">
  1063. <xsl:apply-templates select="$target" mode="conumber"/>
  1064. </xsl:with-param>
  1065. </xsl:call-template>
  1066. </xsl:when>
  1067. <xsl:when test="local-name($target)='area'">
  1068. <xsl:choose>
  1069. <xsl:when test="$target/parent::areaset">
  1070. <xsl:call-template name="callout-bug">
  1071. <xsl:with-param name="conum">
  1072. <xsl:apply-templates select="$target/parent::areaset" mode="conumber"/>
  1073. </xsl:with-param>
  1074. </xsl:call-template>
  1075. </xsl:when>
  1076. <xsl:otherwise>
  1077. <xsl:call-template name="callout-bug">
  1078. <xsl:with-param name="conum">
  1079. <xsl:apply-templates select="$target" mode="conumber"/>
  1080. </xsl:with-param>
  1081. </xsl:call-template>
  1082. </xsl:otherwise>
  1083. </xsl:choose>
  1084. </xsl:when>
  1085. <xsl:otherwise>
  1086. <xsl:text>???</xsl:text>
  1087. </xsl:otherwise>
  1088. </xsl:choose>
  1089. </xsl:template>
  1090. <!-- ==================================================================== -->
  1091. <xsl:template name="orderedlist-starting-number">
  1092. <xsl:param name="list" select="."/>
  1093. <xsl:variable name="pi-start">
  1094. <xsl:call-template name="pi.dbhtml_start">
  1095. <xsl:with-param name="node" select="$list"/>
  1096. </xsl:call-template>
  1097. </xsl:variable>
  1098. <xsl:call-template name="output-orderedlist-starting-number">
  1099. <xsl:with-param name="list" select="$list"/>
  1100. <xsl:with-param name="pi-start" select="$pi-start"/>
  1101. </xsl:call-template>
  1102. </xsl:template>
  1103. </xsl:stylesheet>