lists.xsl 41 KB

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