lists.xsl 41 KB

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