glossary.xsl 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139
  1. <?xml version='1.0'?>
  2. <!DOCTYPE xsl:stylesheet [
  3. <!ENTITY % common.entities SYSTEM "../common/entities.ent">
  4. %common.entities;
  5. ]>
  6. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  7. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  8. version='1.0'>
  9. <!-- ********************************************************************
  10. $Id$
  11. ********************************************************************
  12. This file is part of the XSL DocBook Stylesheet distribution.
  13. See ../README or http://docbook.sf.net/release/xsl/current/ for
  14. copyright and other information.
  15. ******************************************************************** -->
  16. <!-- ==================================================================== -->
  17. <xsl:template match="glossary">
  18. <xsl:call-template name="make-glossary"/>
  19. </xsl:template>
  20. <xsl:template match="glossdiv/title"/>
  21. <xsl:template match="glossdiv/subtitle"/>
  22. <xsl:template match="glossdiv/titleabbrev"/>
  23. <!-- ==================================================================== -->
  24. <xsl:template name="make-glossary">
  25. <xsl:param name="divs" select="glossdiv"/>
  26. <xsl:param name="entries" select="glossentry"/>
  27. <xsl:param name="preamble" select="*[not(self::title
  28. or self::subtitle
  29. or self::glossdiv
  30. or self::glossentry)]"/>
  31. &setup-language-variable;
  32. <xsl:variable name="id">
  33. <xsl:call-template name="object.id"/>
  34. </xsl:variable>
  35. <xsl:variable name="presentation">
  36. <xsl:call-template name="pi.dbfo_glossary-presentation"/>
  37. </xsl:variable>
  38. <xsl:variable name="term-width">
  39. <xsl:call-template name="pi.dbfo_glossterm-width"/>
  40. </xsl:variable>
  41. <xsl:variable name="width">
  42. <xsl:choose>
  43. <xsl:when test="$term-width = ''">
  44. <xsl:value-of select="$glossterm.width"/>
  45. </xsl:when>
  46. <xsl:otherwise>
  47. <xsl:value-of select="$term-width"/>
  48. </xsl:otherwise>
  49. </xsl:choose>
  50. </xsl:variable>
  51. <fo:block id="{$id}">
  52. <xsl:call-template name="glossary.titlepage"/>
  53. </fo:block>
  54. <xsl:if test="$preamble">
  55. <xsl:apply-templates select="$preamble"/>
  56. </xsl:if>
  57. <xsl:choose>
  58. <xsl:when test="$presentation = 'list'">
  59. <xsl:apply-templates select="$divs" mode="glossary.as.list">
  60. <xsl:with-param name="width" select="$width"/>
  61. </xsl:apply-templates>
  62. <xsl:if test="$entries">
  63. <fo:list-block provisional-distance-between-starts="{$width}"
  64. provisional-label-separation="{$glossterm.separation}"
  65. xsl:use-attribute-sets="normal.para.spacing">
  66. <xsl:choose>
  67. <xsl:when test="$glossary.sort != 0">
  68. <xsl:apply-templates select="$entries" mode="glossary.as.list">
  69. <xsl:sort lang="{$language}"
  70. select="translate(glossterm, $lowercase,
  71. $uppercase)"/>
  72. </xsl:apply-templates>
  73. </xsl:when>
  74. <xsl:otherwise>
  75. <xsl:apply-templates select="$entries" mode="glossary.as.list"/>
  76. </xsl:otherwise>
  77. </xsl:choose>
  78. </fo:list-block>
  79. </xsl:if>
  80. </xsl:when>
  81. <xsl:when test="$presentation = 'blocks'">
  82. <xsl:apply-templates select="$divs" mode="glossary.as.blocks"/>
  83. <xsl:choose>
  84. <xsl:when test="$glossary.sort != 0">
  85. <xsl:apply-templates select="$entries" mode="glossary.as.blocks">
  86. <xsl:sort lang="{$language}"
  87. select="translate(glossterm, $lowercase,
  88. $uppercase)"/>
  89. </xsl:apply-templates>
  90. </xsl:when>
  91. <xsl:otherwise>
  92. <xsl:apply-templates select="$entries" mode="glossary.as.blocks"/>
  93. </xsl:otherwise>
  94. </xsl:choose>
  95. </xsl:when>
  96. <xsl:when test="$glossary.as.blocks != 0">
  97. <xsl:apply-templates select="$divs" mode="glossary.as.blocks"/>
  98. <xsl:choose>
  99. <xsl:when test="$glossary.sort != 0">
  100. <xsl:apply-templates select="$entries" mode="glossary.as.blocks">
  101. <xsl:sort lang="{$language}"
  102. select="translate(glossterm, $lowercase,
  103. $uppercase)"/>
  104. </xsl:apply-templates>
  105. </xsl:when>
  106. <xsl:otherwise>
  107. <xsl:apply-templates select="$entries" mode="glossary.as.blocks"/>
  108. </xsl:otherwise>
  109. </xsl:choose>
  110. </xsl:when>
  111. <xsl:otherwise>
  112. <xsl:apply-templates select="$divs" mode="glossary.as.list">
  113. <xsl:with-param name="width" select="$width"/>
  114. </xsl:apply-templates>
  115. <xsl:if test="$entries">
  116. <fo:list-block provisional-distance-between-starts="{$width}"
  117. provisional-label-separation="{$glossterm.separation}"
  118. xsl:use-attribute-sets="normal.para.spacing">
  119. <xsl:choose>
  120. <xsl:when test="$glossary.sort != 0">
  121. <xsl:apply-templates select="$entries" mode="glossary.as.list">
  122. <xsl:sort lang="{$language}"
  123. select="translate(glossterm, $lowercase,
  124. $uppercase)"/>
  125. </xsl:apply-templates>
  126. </xsl:when>
  127. <xsl:otherwise>
  128. <xsl:apply-templates select="$entries" mode="glossary.as.list"/>
  129. </xsl:otherwise>
  130. </xsl:choose>
  131. </fo:list-block>
  132. </xsl:if>
  133. </xsl:otherwise>
  134. </xsl:choose>
  135. </xsl:template>
  136. <xsl:template match="book/glossary|part/glossary|/glossary" priority="2">
  137. <xsl:variable name="id">
  138. <xsl:call-template name="object.id"/>
  139. </xsl:variable>
  140. <xsl:variable name="master-reference">
  141. <xsl:call-template name="select.pagemaster"/>
  142. </xsl:variable>
  143. <fo:page-sequence hyphenate="{$hyphenate}"
  144. master-reference="{$master-reference}">
  145. <xsl:attribute name="language">
  146. <xsl:call-template name="l10n.language"/>
  147. </xsl:attribute>
  148. <xsl:attribute name="format">
  149. <xsl:call-template name="page.number.format">
  150. <xsl:with-param name="master-reference" select="$master-reference"/>
  151. </xsl:call-template>
  152. </xsl:attribute>
  153. <xsl:attribute name="initial-page-number">
  154. <xsl:call-template name="initial.page.number">
  155. <xsl:with-param name="master-reference" select="$master-reference"/>
  156. </xsl:call-template>
  157. </xsl:attribute>
  158. <xsl:attribute name="force-page-count">
  159. <xsl:call-template name="force.page.count">
  160. <xsl:with-param name="master-reference" select="$master-reference"/>
  161. </xsl:call-template>
  162. </xsl:attribute>
  163. <xsl:attribute name="hyphenation-character">
  164. <xsl:call-template name="gentext">
  165. <xsl:with-param name="key" select="'hyphenation-character'"/>
  166. </xsl:call-template>
  167. </xsl:attribute>
  168. <xsl:attribute name="hyphenation-push-character-count">
  169. <xsl:call-template name="gentext">
  170. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  171. </xsl:call-template>
  172. </xsl:attribute>
  173. <xsl:attribute name="hyphenation-remain-character-count">
  174. <xsl:call-template name="gentext">
  175. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  176. </xsl:call-template>
  177. </xsl:attribute>
  178. <xsl:apply-templates select="." mode="running.head.mode">
  179. <xsl:with-param name="master-reference" select="$master-reference"/>
  180. </xsl:apply-templates>
  181. <xsl:apply-templates select="." mode="running.foot.mode">
  182. <xsl:with-param name="master-reference" select="$master-reference"/>
  183. </xsl:apply-templates>
  184. <fo:flow flow-name="xsl-region-body">
  185. <xsl:call-template name="set.flow.properties">
  186. <xsl:with-param name="element" select="local-name(.)"/>
  187. <xsl:with-param name="master-reference" select="$master-reference"/>
  188. </xsl:call-template>
  189. <xsl:call-template name="make-glossary"/>
  190. </fo:flow>
  191. </fo:page-sequence>
  192. </xsl:template>
  193. <xsl:template match="glossary/glossaryinfo"></xsl:template>
  194. <xsl:template match="glossary/info"></xsl:template>
  195. <xsl:template match="glossary/title"></xsl:template>
  196. <xsl:template match="glossary/subtitle"></xsl:template>
  197. <xsl:template match="glossary/titleabbrev"></xsl:template>
  198. <!-- ==================================================================== -->
  199. <xsl:template match="glosslist">
  200. &setup-language-variable;
  201. <xsl:variable name="presentation">
  202. <xsl:call-template name="pi.dbfo_glosslist-presentation"/>
  203. </xsl:variable>
  204. <xsl:variable name="term-width">
  205. <xsl:call-template name="pi.dbfo_glossterm-width"/>
  206. </xsl:variable>
  207. <xsl:variable name="width">
  208. <xsl:choose>
  209. <xsl:when test="$term-width = ''">
  210. <xsl:value-of select="$glossterm.width"/>
  211. </xsl:when>
  212. <xsl:otherwise>
  213. <xsl:value-of select="$term-width"/>
  214. </xsl:otherwise>
  215. </xsl:choose>
  216. </xsl:variable>
  217. <xsl:if test="title or info/title">
  218. <xsl:apply-templates select="(title|info/title)[1]" mode="list.title.mode"/>
  219. </xsl:if>
  220. <xsl:choose>
  221. <xsl:when test="$presentation = 'list'">
  222. <fo:list-block provisional-distance-between-starts="{$width}"
  223. provisional-label-separation="{$glossterm.separation}"
  224. xsl:use-attribute-sets="normal.para.spacing">
  225. <xsl:choose>
  226. <xsl:when test="$glossary.sort != 0">
  227. <xsl:apply-templates select="glossentry" mode="glossary.as.list">
  228. <xsl:sort lang="{$language}"
  229. select="translate(glossterm, $lowercase,
  230. $uppercase)"/>
  231. </xsl:apply-templates>
  232. </xsl:when>
  233. <xsl:otherwise>
  234. <xsl:apply-templates select="glossentry" mode="glossary.as.list"/>
  235. </xsl:otherwise>
  236. </xsl:choose>
  237. </fo:list-block>
  238. </xsl:when>
  239. <xsl:when test="$presentation = 'blocks'">
  240. <xsl:choose>
  241. <xsl:when test="$glossary.sort != 0">
  242. <xsl:apply-templates select="glossentry" mode="glossary.as.blocks">
  243. <xsl:sort lang="{$language}"
  244. select="translate(glossterm, $lowercase,
  245. $uppercase)"/>
  246. </xsl:apply-templates>
  247. </xsl:when>
  248. <xsl:otherwise>
  249. <xsl:apply-templates select="glossentry" mode="glossary.as.blocks"/>
  250. </xsl:otherwise>
  251. </xsl:choose>
  252. </xsl:when>
  253. <xsl:when test="$glosslist.as.blocks != 0">
  254. <xsl:choose>
  255. <xsl:when test="$glossary.sort != 0">
  256. <xsl:apply-templates select="glossentry" mode="glossary.as.blocks">
  257. <xsl:sort lang="{$language}"
  258. select="translate(glossterm, $lowercase,
  259. $uppercase)"/>
  260. </xsl:apply-templates>
  261. </xsl:when>
  262. <xsl:otherwise>
  263. <xsl:apply-templates select="glossentry" mode="glossary.as.blocks"/>
  264. </xsl:otherwise>
  265. </xsl:choose>
  266. </xsl:when>
  267. <xsl:otherwise>
  268. <fo:list-block provisional-distance-between-starts="{$width}"
  269. provisional-label-separation="{$glossterm.separation}"
  270. xsl:use-attribute-sets="normal.para.spacing">
  271. <xsl:choose>
  272. <xsl:when test="$glossary.sort != 0">
  273. <xsl:apply-templates select="glossentry" mode="glossary.as.list">
  274. <xsl:sort lang="{$language}"
  275. select="translate(glossterm, $lowercase,
  276. $uppercase)"/>
  277. </xsl:apply-templates>
  278. </xsl:when>
  279. <xsl:otherwise>
  280. <xsl:apply-templates select="glossentry" mode="glossary.as.list"/>
  281. </xsl:otherwise>
  282. </xsl:choose>
  283. </fo:list-block>
  284. </xsl:otherwise>
  285. </xsl:choose>
  286. </xsl:template>
  287. <!-- ==================================================================== -->
  288. <!-- Glossary collection -->
  289. <xsl:template match="glossary[@role='auto']" priority="2">
  290. <xsl:variable name="collection" select="document($glossary.collection, .)"/>
  291. <xsl:if test="$glossary.collection = ''">
  292. <xsl:message>
  293. <xsl:text>Warning: processing automatic glossary </xsl:text>
  294. <xsl:text>without a glossary.collection file.</xsl:text>
  295. </xsl:message>
  296. </xsl:if>
  297. <xsl:if test="not($collection) and $glossary.collection != ''">
  298. <xsl:message>
  299. <xsl:text>Warning: processing automatic glossary but unable to </xsl:text>
  300. <xsl:text>open glossary.collection file '</xsl:text>
  301. <xsl:value-of select="$glossary.collection"/>
  302. <xsl:text>'</xsl:text>
  303. </xsl:message>
  304. </xsl:if>
  305. <xsl:call-template name="make-auto-glossary"/>
  306. </xsl:template>
  307. <xsl:template name="make-auto-glossary">
  308. <xsl:param name="collection" select="document($glossary.collection, .)"/>
  309. <xsl:param name="terms" select="//glossterm[not(parent::glossdef)]|//firstterm"/>
  310. <xsl:param name="preamble" select="*[not(self::title
  311. or self::subtitle
  312. or self::glossdiv
  313. or self::glossentry)]"/>
  314. &setup-language-variable;
  315. <xsl:variable name="id">
  316. <xsl:call-template name="object.id"/>
  317. </xsl:variable>
  318. <xsl:variable name="presentation">
  319. <xsl:call-template name="pi.dbfo_glossary-presentation"/>
  320. </xsl:variable>
  321. <xsl:variable name="term-width">
  322. <xsl:call-template name="pi.dbfo_glossterm-width"/>
  323. </xsl:variable>
  324. <xsl:variable name="width">
  325. <xsl:choose>
  326. <xsl:when test="$term-width = ''">
  327. <xsl:value-of select="$glossterm.width"/>
  328. </xsl:when>
  329. <xsl:otherwise>
  330. <xsl:value-of select="$term-width"/>
  331. </xsl:otherwise>
  332. </xsl:choose>
  333. </xsl:variable>
  334. <xsl:if test="$glossary.collection = ''">
  335. <xsl:message>
  336. <xsl:text>Warning: processing automatic glossary </xsl:text>
  337. <xsl:text>without a glossary.collection file.</xsl:text>
  338. </xsl:message>
  339. </xsl:if>
  340. <fo:block id="{$id}">
  341. <xsl:call-template name="glossary.titlepage"/>
  342. </fo:block>
  343. <xsl:if test="$preamble">
  344. <xsl:apply-templates select="$preamble"/>
  345. </xsl:if>
  346. <xsl:choose>
  347. <xsl:when test="glossdiv and $collection//glossdiv">
  348. <xsl:for-each select="$collection//glossdiv">
  349. <!-- first see if there are any in this div -->
  350. <xsl:variable name="exist.test">
  351. <xsl:for-each select="glossentry">
  352. <xsl:variable name="cterm" select="glossterm"/>
  353. <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
  354. <xsl:value-of select="glossterm"/>
  355. </xsl:if>
  356. </xsl:for-each>
  357. </xsl:variable>
  358. <xsl:if test="$exist.test != ''">
  359. <xsl:choose>
  360. <xsl:when test="$presentation = 'list'">
  361. <xsl:apply-templates select="." mode="auto-glossary-as-list">
  362. <xsl:with-param name="width" select="$width"/>
  363. <xsl:with-param name="terms" select="$terms"/>
  364. </xsl:apply-templates>
  365. </xsl:when>
  366. <xsl:when test="$presentation = 'blocks'">
  367. <xsl:apply-templates select="." mode="auto-glossary-as-blocks">
  368. <xsl:with-param name="terms" select="$terms"/>
  369. </xsl:apply-templates>
  370. </xsl:when>
  371. <xsl:when test="$glossary.as.blocks != 0">
  372. <xsl:apply-templates select="." mode="auto-glossary-as-blocks">
  373. <xsl:with-param name="terms" select="$terms"/>
  374. </xsl:apply-templates>
  375. </xsl:when>
  376. <xsl:otherwise>
  377. <xsl:apply-templates select="." mode="auto-glossary-as-list">
  378. <xsl:with-param name="width" select="$width"/>
  379. <xsl:with-param name="terms" select="$terms"/>
  380. </xsl:apply-templates>
  381. </xsl:otherwise>
  382. </xsl:choose>
  383. </xsl:if>
  384. </xsl:for-each>
  385. </xsl:when>
  386. <xsl:otherwise>
  387. <xsl:choose>
  388. <xsl:when test="$presentation = 'list'">
  389. <fo:list-block provisional-distance-between-starts="{$width}"
  390. provisional-label-separation="{$glossterm.separation}"
  391. xsl:use-attribute-sets="normal.para.spacing">
  392. <xsl:choose>
  393. <xsl:when test="$glossary.sort != 0">
  394. <xsl:for-each select="$collection//glossentry">
  395. <xsl:sort lang="{$language}"
  396. select="translate(glossterm, $lowercase,
  397. $uppercase)"/>
  398. <xsl:variable name="cterm" select="glossterm"/>
  399. <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
  400. <xsl:apply-templates select="."
  401. mode="auto-glossary-as-list"/>
  402. </xsl:if>
  403. </xsl:for-each>
  404. </xsl:when>
  405. <xsl:otherwise>
  406. <xsl:for-each select="$collection//glossentry">
  407. <xsl:variable name="cterm" select="glossterm"/>
  408. <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
  409. <xsl:apply-templates select="."
  410. mode="auto-glossary-as-list"/>
  411. </xsl:if>
  412. </xsl:for-each>
  413. </xsl:otherwise>
  414. </xsl:choose>
  415. </fo:list-block>
  416. </xsl:when>
  417. <xsl:when test="$presentation = 'blocks' or
  418. $glossary.as.blocks != 0">
  419. <xsl:choose>
  420. <xsl:when test="$glossary.sort != 0">
  421. <xsl:for-each select="$collection//glossentry">
  422. <xsl:sort lang="{$language}"
  423. select="translate(glossterm, $lowercase,
  424. $uppercase)"/>
  425. <xsl:variable name="cterm" select="glossterm"/>
  426. <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
  427. <xsl:apply-templates select="."
  428. mode="auto-glossary-as-blocks"/>
  429. </xsl:if>
  430. </xsl:for-each>
  431. </xsl:when>
  432. <xsl:otherwise>
  433. <xsl:for-each select="$collection//glossentry">
  434. <xsl:variable name="cterm" select="glossterm"/>
  435. <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
  436. <xsl:apply-templates select="."
  437. mode="auto-glossary-as-blocks"/>
  438. </xsl:if>
  439. </xsl:for-each>
  440. </xsl:otherwise>
  441. </xsl:choose>
  442. </xsl:when>
  443. <xsl:otherwise>
  444. <fo:list-block provisional-distance-between-starts="{$width}"
  445. provisional-label-separation="{$glossterm.separation}"
  446. xsl:use-attribute-sets="normal.para.spacing">
  447. <xsl:choose>
  448. <xsl:when test="$glossary.sort != 0">
  449. <xsl:for-each select="$collection//glossentry">
  450. <xsl:sort lang="{$language}"
  451. select="translate(glossterm, $lowercase,
  452. $uppercase)"/>
  453. <xsl:variable name="cterm" select="glossterm"/>
  454. <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
  455. <xsl:apply-templates select="."
  456. mode="auto-glossary-as-list"/>
  457. </xsl:if>
  458. </xsl:for-each>
  459. </xsl:when>
  460. <xsl:otherwise>
  461. <xsl:for-each select="$collection//glossentry">
  462. <xsl:variable name="cterm" select="glossterm"/>
  463. <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
  464. <xsl:apply-templates select="."
  465. mode="auto-glossary-as-list"/>
  466. </xsl:if>
  467. </xsl:for-each>
  468. </xsl:otherwise>
  469. </xsl:choose>
  470. </fo:list-block>
  471. </xsl:otherwise>
  472. </xsl:choose>
  473. </xsl:otherwise>
  474. </xsl:choose>
  475. </xsl:template>
  476. <xsl:template match="book/glossary[@role='auto']|
  477. part/glossary[@role='auto']|
  478. /glossary[@role='auto']" priority="2.5">
  479. <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
  480. <xsl:variable name="master-reference">
  481. <xsl:call-template name="select.pagemaster"/>
  482. </xsl:variable>
  483. <xsl:if test="$glossary.collection = ''">
  484. <xsl:message>
  485. <xsl:text>Warning: processing automatic glossary </xsl:text>
  486. <xsl:text>without a glossary.collection file.</xsl:text>
  487. </xsl:message>
  488. </xsl:if>
  489. <fo:page-sequence hyphenate="{$hyphenate}"
  490. master-reference="{$master-reference}">
  491. <xsl:attribute name="language">
  492. <xsl:call-template name="l10n.language"/>
  493. </xsl:attribute>
  494. <xsl:attribute name="format">
  495. <xsl:call-template name="page.number.format">
  496. <xsl:with-param name="master-reference" select="$master-reference"/>
  497. </xsl:call-template>
  498. </xsl:attribute>
  499. <xsl:attribute name="initial-page-number">
  500. <xsl:call-template name="initial.page.number">
  501. <xsl:with-param name="master-reference" select="$master-reference"/>
  502. </xsl:call-template>
  503. </xsl:attribute>
  504. <xsl:attribute name="force-page-count">
  505. <xsl:call-template name="force.page.count">
  506. <xsl:with-param name="master-reference" select="$master-reference"/>
  507. </xsl:call-template>
  508. </xsl:attribute>
  509. <xsl:attribute name="hyphenation-character">
  510. <xsl:call-template name="gentext">
  511. <xsl:with-param name="key" select="'hyphenation-character'"/>
  512. </xsl:call-template>
  513. </xsl:attribute>
  514. <xsl:attribute name="hyphenation-push-character-count">
  515. <xsl:call-template name="gentext">
  516. <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
  517. </xsl:call-template>
  518. </xsl:attribute>
  519. <xsl:attribute name="hyphenation-remain-character-count">
  520. <xsl:call-template name="gentext">
  521. <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
  522. </xsl:call-template>
  523. </xsl:attribute>
  524. <xsl:apply-templates select="." mode="running.head.mode">
  525. <xsl:with-param name="master-reference" select="$master-reference"/>
  526. </xsl:apply-templates>
  527. <xsl:apply-templates select="." mode="running.foot.mode">
  528. <xsl:with-param name="master-reference" select="$master-reference"/>
  529. </xsl:apply-templates>
  530. <fo:flow flow-name="xsl-region-body">
  531. <xsl:call-template name="set.flow.properties">
  532. <xsl:with-param name="element" select="local-name(.)"/>
  533. <xsl:with-param name="master-reference" select="$master-reference"/>
  534. </xsl:call-template>
  535. <xsl:call-template name="make-auto-glossary"/>
  536. </fo:flow>
  537. </fo:page-sequence>
  538. </xsl:template>
  539. <xsl:template match="glossdiv" mode="auto-glossary-as-list">
  540. <xsl:param name="width" select="$glossterm.width"/>
  541. <xsl:param name="terms" select="."/>
  542. &setup-language-variable;
  543. <xsl:variable name="preamble"
  544. select="*[not(self::title
  545. or self::subtitle
  546. or self::glossentry)]"/>
  547. <xsl:call-template name="glossdiv.titlepage"/>
  548. <xsl:apply-templates select="$preamble"/>
  549. <fo:list-block provisional-distance-between-starts="{$width}"
  550. provisional-label-separation="{$glossterm.separation}"
  551. xsl:use-attribute-sets="normal.para.spacing">
  552. <xsl:choose>
  553. <xsl:when test="$glossary.sort != 0">
  554. <xsl:for-each select="glossentry">
  555. <xsl:sort lang="{$language}"
  556. select="translate(glossterm, $lowercase, $uppercase)"/>
  557. <xsl:variable name="cterm" select="glossterm"/>
  558. <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
  559. <xsl:apply-templates select="." mode="auto-glossary-as-list"/>
  560. </xsl:if>
  561. </xsl:for-each>
  562. </xsl:when>
  563. <xsl:otherwise>
  564. <xsl:for-each select="glossentry">
  565. <xsl:variable name="cterm" select="glossterm"/>
  566. <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
  567. <xsl:apply-templates select="." mode="auto-glossary-as-list"/>
  568. </xsl:if>
  569. </xsl:for-each>
  570. </xsl:otherwise>
  571. </xsl:choose>
  572. </fo:list-block>
  573. </xsl:template>
  574. <xsl:template match="glossentry" mode="auto-glossary-as-list">
  575. <xsl:apply-templates select="." mode="glossary.as.list"/>
  576. </xsl:template>
  577. <xsl:template match="glossdiv" mode="auto-glossary-as-blocks">
  578. <xsl:param name="terms" select="."/>
  579. &setup-language-variable;
  580. <xsl:variable name="preamble"
  581. select="*[not(self::title
  582. or self::subtitle
  583. or self::glossentry)]"/>
  584. <xsl:call-template name="glossdiv.titlepage"/>
  585. <xsl:apply-templates select="$preamble"/>
  586. <xsl:choose>
  587. <xsl:when test="$glossary.sort != 0">
  588. <xsl:for-each select="glossentry">
  589. <xsl:sort lang="{$language}"
  590. select="translate(glossterm, $lowercase, $uppercase)"/>
  591. <xsl:variable name="cterm" select="glossterm"/>
  592. <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
  593. <xsl:apply-templates select="." mode="auto-glossary-as-blocks"/>
  594. </xsl:if>
  595. </xsl:for-each>
  596. </xsl:when>
  597. <xsl:otherwise>
  598. <xsl:for-each select="glossentry">
  599. <xsl:variable name="cterm" select="glossterm"/>
  600. <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
  601. <xsl:apply-templates select="." mode="auto-glossary-as-blocks"/>
  602. </xsl:if>
  603. </xsl:for-each>
  604. </xsl:otherwise>
  605. </xsl:choose>
  606. </xsl:template>
  607. <xsl:template match="glossentry" mode="auto-glossary-as-blocks">
  608. <xsl:apply-templates select="." mode="glossary.as.blocks"/>
  609. </xsl:template>
  610. <!-- ==================================================================== -->
  611. <!-- Format glossary as a list -->
  612. <xsl:template match="glossdiv" mode="glossary.as.list">
  613. <xsl:param name="width" select="$glossterm.width"/>
  614. &setup-language-variable;
  615. <xsl:variable name="entries" select="glossentry"/>
  616. <xsl:variable name="preamble"
  617. select="*[not(self::title
  618. or self::subtitle
  619. or self::glossentry)]"/>
  620. <xsl:call-template name="glossdiv.titlepage"/>
  621. <xsl:apply-templates select="$preamble"/>
  622. <fo:list-block provisional-distance-between-starts="{$width}"
  623. provisional-label-separation="{$glossterm.separation}"
  624. xsl:use-attribute-sets="normal.para.spacing">
  625. <xsl:choose>
  626. <xsl:when test="$glossary.sort != 0">
  627. <xsl:apply-templates select="$entries" mode="glossary.as.list">
  628. <xsl:sort lang="{$language}"
  629. select="translate(glossterm, $lowercase,
  630. $uppercase)"/>
  631. </xsl:apply-templates>
  632. </xsl:when>
  633. <xsl:otherwise>
  634. <xsl:apply-templates select="$entries" mode="glossary.as.list"/>
  635. </xsl:otherwise>
  636. </xsl:choose>
  637. </fo:list-block>
  638. </xsl:template>
  639. <!--
  640. GlossEntry ::=
  641. GlossTerm, Acronym?, Abbrev?,
  642. (IndexTerm)*,
  643. RevHistory?,
  644. (GlossSee | GlossDef+)
  645. -->
  646. <xsl:template match="glossentry" mode="glossary.as.list">
  647. <xsl:variable name="id">
  648. <xsl:call-template name="object.id"/>
  649. </xsl:variable>
  650. <fo:list-item xsl:use-attribute-sets="normal.para.spacing">
  651. <xsl:call-template name="anchor">
  652. <xsl:with-param name="conditional">
  653. <xsl:choose>
  654. <xsl:when test="$glossterm.auto.link != 0
  655. or $glossary.collection != ''">0</xsl:when>
  656. <xsl:otherwise>1</xsl:otherwise>
  657. </xsl:choose>
  658. </xsl:with-param>
  659. </xsl:call-template>
  660. <fo:list-item-label end-indent="label-end()">
  661. <fo:block>
  662. <xsl:choose>
  663. <xsl:when test="$glossentry.show.acronym = 'primary'">
  664. <xsl:choose>
  665. <xsl:when test="acronym|abbrev">
  666. <xsl:apply-templates select="acronym|abbrev"
  667. mode="glossary.as.list"/>
  668. <xsl:text> (</xsl:text>
  669. <xsl:apply-templates select="glossterm"
  670. mode="glossary.as.list"/>
  671. <xsl:text>)</xsl:text>
  672. </xsl:when>
  673. <xsl:otherwise>
  674. <xsl:apply-templates select="glossterm"
  675. mode="glossary.as.list"/>
  676. </xsl:otherwise>
  677. </xsl:choose>
  678. </xsl:when>
  679. <xsl:when test="$glossentry.show.acronym = 'yes'">
  680. <xsl:apply-templates select="glossterm" mode="glossary.as.list"/>
  681. <xsl:if test="acronym|abbrev">
  682. <xsl:text> (</xsl:text>
  683. <xsl:apply-templates select="acronym|abbrev"
  684. mode="glossary.as.list"/>
  685. <xsl:text>)</xsl:text>
  686. </xsl:if>
  687. </xsl:when>
  688. <xsl:otherwise>
  689. <xsl:apply-templates select="glossterm" mode="glossary.as.list"/>
  690. </xsl:otherwise>
  691. </xsl:choose>
  692. <xsl:apply-templates select="indexterm"/>
  693. </fo:block>
  694. </fo:list-item-label>
  695. <fo:list-item-body start-indent="body-start()">
  696. <xsl:apply-templates select="glosssee|glossdef" mode="glossary.as.list"/>
  697. </fo:list-item-body>
  698. </fo:list-item>
  699. </xsl:template>
  700. <xsl:template match="glossentry/glossterm" mode="glossary.as.list">
  701. <xsl:variable name="id">
  702. <xsl:call-template name="object.id"/>
  703. </xsl:variable>
  704. <fo:inline id="{$id}">
  705. <xsl:apply-templates/>
  706. </fo:inline>
  707. <xsl:if test="following-sibling::glossterm">, </xsl:if>
  708. </xsl:template>
  709. <xsl:template match="glossentry/acronym" mode="glossary.as.list">
  710. <xsl:apply-templates/>
  711. <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
  712. </xsl:template>
  713. <xsl:template match="glossentry/abbrev" mode="glossary.as.list">
  714. <xsl:apply-templates/>
  715. <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
  716. </xsl:template>
  717. <xsl:template match="glossentry/revhistory" mode="glossary.as.list">
  718. </xsl:template>
  719. <xsl:template match="glossentry/glosssee" mode="glossary.as.list">
  720. <xsl:variable name="otherterm" select="@otherterm"/>
  721. <xsl:variable name="targets" select="key('id', $otherterm)"/>
  722. <xsl:variable name="target" select="$targets[1]"/>
  723. <fo:block>
  724. <xsl:variable name="template">
  725. <xsl:call-template name="gentext.template">
  726. <xsl:with-param name="context" select="'glossary'"/>
  727. <xsl:with-param name="name" select="'see'"/>
  728. </xsl:call-template>
  729. </xsl:variable>
  730. <xsl:variable name="title">
  731. <xsl:choose>
  732. <xsl:when test="$target">
  733. <fo:basic-link internal-destination="{$otherterm}"
  734. xsl:use-attribute-sets="xref.properties">
  735. <xsl:apply-templates select="$target" mode="xref-to"/>
  736. </fo:basic-link>
  737. </xsl:when>
  738. <xsl:when test="$otherterm != '' and not($target)">
  739. <xsl:message>
  740. <xsl:text>Warning: glosssee @otherterm reference not found: </xsl:text>
  741. <xsl:value-of select="$otherterm"/>
  742. </xsl:message>
  743. <xsl:apply-templates mode="glossary.as.list"/>
  744. </xsl:when>
  745. <xsl:otherwise>
  746. <xsl:apply-templates mode="glossary.as.list"/>
  747. </xsl:otherwise>
  748. </xsl:choose>
  749. </xsl:variable>
  750. <xsl:call-template name="substitute-markup">
  751. <xsl:with-param name="template" select="$template"/>
  752. <xsl:with-param name="title" select="$title"/>
  753. </xsl:call-template>
  754. <xsl:text>.</xsl:text>
  755. </fo:block>
  756. </xsl:template>
  757. <xsl:template match="glossentry/glossdef" mode="glossary.as.list">
  758. <xsl:apply-templates select="*[local-name(.) != 'glossseealso']"/>
  759. <xsl:if test="glossseealso">
  760. <fo:block>
  761. <xsl:variable name="template">
  762. <xsl:call-template name="gentext.template">
  763. <xsl:with-param name="context" select="'glossary'"/>
  764. <xsl:with-param name="name" select="'seealso'"/>
  765. </xsl:call-template>
  766. </xsl:variable>
  767. <xsl:variable name="title">
  768. <xsl:apply-templates select="glossseealso" mode="glossary.as.list"/>
  769. </xsl:variable>
  770. <xsl:call-template name="substitute-markup">
  771. <xsl:with-param name="template" select="$template"/>
  772. <xsl:with-param name="title" select="$title"/>
  773. </xsl:call-template>
  774. </fo:block>
  775. </xsl:if>
  776. </xsl:template>
  777. <xsl:template match="glossentry/glossdef/para[1]|glossentry/glossdef/simpara[1]"
  778. mode="glossary.as.list">
  779. <fo:block>
  780. <xsl:apply-templates/>
  781. </fo:block>
  782. </xsl:template>
  783. <xsl:template match="glossseealso" mode="glossary.as.list">
  784. <xsl:variable name="otherterm" select="@otherterm"/>
  785. <xsl:variable name="targets" select="key('id', $otherterm)"/>
  786. <xsl:variable name="target" select="$targets[1]"/>
  787. <xsl:choose>
  788. <xsl:when test="$target">
  789. <fo:basic-link internal-destination="{$otherterm}"
  790. xsl:use-attribute-sets="xref.properties">
  791. <xsl:apply-templates select="$target" mode="xref-to"/>
  792. </fo:basic-link>
  793. </xsl:when>
  794. <xsl:when test="$otherterm != '' and not($target)">
  795. <xsl:message>
  796. <xsl:text>Warning: glossseealso @otherterm reference not found: </xsl:text>
  797. <xsl:value-of select="$otherterm"/>
  798. </xsl:message>
  799. <xsl:apply-templates mode="glossary.as.list"/>
  800. </xsl:when>
  801. <xsl:otherwise>
  802. <xsl:apply-templates mode="glossary.as.list"/>
  803. </xsl:otherwise>
  804. </xsl:choose>
  805. <xsl:choose>
  806. <xsl:when test="position() = last()">
  807. <xsl:text>.</xsl:text>
  808. </xsl:when>
  809. <xsl:otherwise>
  810. <xsl:text>, </xsl:text>
  811. </xsl:otherwise>
  812. </xsl:choose>
  813. </xsl:template>
  814. <!-- ==================================================================== -->
  815. <!-- Format glossary blocks -->
  816. <xsl:template match="glossdiv" mode="glossary.as.blocks">
  817. &setup-language-variable;
  818. <xsl:variable name="entries" select="glossentry"/>
  819. <xsl:variable name="preamble"
  820. select="*[not(self::title
  821. or self::subtitle
  822. or self::glossentry)]"/>
  823. <xsl:call-template name="glossdiv.titlepage"/>
  824. <xsl:apply-templates select="$preamble"/>
  825. <xsl:choose>
  826. <xsl:when test="$glossary.sort != 0">
  827. <xsl:apply-templates select="$entries" mode="glossary.as.blocks">
  828. <xsl:sort lang="{$language}"
  829. select="translate(glossterm, $lowercase,
  830. $uppercase)"/>
  831. </xsl:apply-templates>
  832. </xsl:when>
  833. <xsl:otherwise>
  834. <xsl:apply-templates select="$entries" mode="glossary.as.blocks"/>
  835. </xsl:otherwise>
  836. </xsl:choose>
  837. </xsl:template>
  838. <!--
  839. GlossEntry ::=
  840. GlossTerm, Acronym?, Abbrev?,
  841. (IndexTerm)*,
  842. RevHistory?,
  843. (GlossSee | GlossDef+)
  844. -->
  845. <xsl:template match="glossentry" mode="glossary.as.blocks">
  846. <xsl:variable name="id">
  847. <xsl:call-template name="object.id"/>
  848. </xsl:variable>
  849. <fo:block xsl:use-attribute-sets="list.item.spacing"
  850. keep-with-next.within-column="always"
  851. keep-together.within-column="always">
  852. <xsl:call-template name="anchor">
  853. <xsl:with-param name="conditional">
  854. <xsl:choose>
  855. <xsl:when test="$glossterm.auto.link != 0
  856. or $glossary.collection != ''">0</xsl:when>
  857. <xsl:otherwise>1</xsl:otherwise>
  858. </xsl:choose>
  859. </xsl:with-param>
  860. </xsl:call-template>
  861. <xsl:choose>
  862. <xsl:when test="$glossentry.show.acronym = 'primary'">
  863. <xsl:choose>
  864. <xsl:when test="acronym|abbrev">
  865. <xsl:apply-templates select="acronym|abbrev" mode="glossary.as.blocks"/>
  866. <xsl:text> (</xsl:text>
  867. <xsl:apply-templates select="glossterm" mode="glossary.as.blocks"/>
  868. <xsl:text>)</xsl:text>
  869. </xsl:when>
  870. <xsl:otherwise>
  871. <xsl:apply-templates select="glossterm" mode="glossary.as.blocks"/>
  872. </xsl:otherwise>
  873. </xsl:choose>
  874. </xsl:when>
  875. <xsl:when test="$glossentry.show.acronym = 'yes'">
  876. <xsl:apply-templates select="glossterm" mode="glossary.as.blocks"/>
  877. <xsl:if test="acronym|abbrev">
  878. <xsl:text> (</xsl:text>
  879. <xsl:apply-templates select="acronym|abbrev" mode="glossary.as.blocks"/>
  880. <xsl:text>)</xsl:text>
  881. </xsl:if>
  882. </xsl:when>
  883. <xsl:otherwise>
  884. <xsl:apply-templates select="glossterm" mode="glossary.as.blocks"/>
  885. </xsl:otherwise>
  886. </xsl:choose>
  887. <xsl:apply-templates select="indexterm"/>
  888. </fo:block>
  889. <fo:block margin-left="0.25in">
  890. <xsl:apply-templates select="glosssee|glossdef" mode="glossary.as.blocks"/>
  891. </fo:block>
  892. </xsl:template>
  893. <xsl:template match="glossentry/glossterm" mode="glossary.as.blocks">
  894. <xsl:variable name="id">
  895. <xsl:call-template name="object.id"/>
  896. </xsl:variable>
  897. <fo:inline id="{$id}">
  898. <xsl:apply-templates/>
  899. </fo:inline>
  900. <xsl:if test="following-sibling::glossterm">, </xsl:if>
  901. </xsl:template>
  902. <xsl:template match="glossentry/acronym" mode="glossary.as.blocks">
  903. <xsl:apply-templates/>
  904. <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
  905. </xsl:template>
  906. <xsl:template match="glossentry/abbrev" mode="glossary.as.blocks">
  907. <xsl:apply-templates/>
  908. <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
  909. </xsl:template>
  910. <xsl:template match="glossentry/glosssee" mode="glossary.as.blocks">
  911. <xsl:variable name="otherterm" select="@otherterm"/>
  912. <xsl:variable name="targets" select="key('id', $otherterm)"/>
  913. <xsl:variable name="target" select="$targets[1]"/>
  914. <xsl:variable name="template">
  915. <xsl:call-template name="gentext.template">
  916. <xsl:with-param name="context" select="'glossary'"/>
  917. <xsl:with-param name="name" select="'see'"/>
  918. </xsl:call-template>
  919. </xsl:variable>
  920. <xsl:variable name="title">
  921. <xsl:choose>
  922. <xsl:when test="$target">
  923. <fo:basic-link internal-destination="{$otherterm}"
  924. xsl:use-attribute-sets="xref.properties">
  925. <xsl:apply-templates select="$target" mode="xref-to"/>
  926. </fo:basic-link>
  927. </xsl:when>
  928. <xsl:when test="$otherterm != '' and not($target)">
  929. <xsl:message>
  930. <xsl:text>Warning: glosssee @otherterm reference not found: </xsl:text>
  931. <xsl:value-of select="$otherterm"/>
  932. </xsl:message>
  933. <xsl:apply-templates mode="glossary.as.blocks"/>
  934. </xsl:when>
  935. <xsl:otherwise>
  936. <xsl:apply-templates mode="glossary.as.blocks"/>
  937. </xsl:otherwise>
  938. </xsl:choose>
  939. </xsl:variable>
  940. <xsl:call-template name="substitute-markup">
  941. <xsl:with-param name="template" select="$template"/>
  942. <xsl:with-param name="title" select="$title"/>
  943. </xsl:call-template>
  944. <xsl:text>.</xsl:text>
  945. </xsl:template>
  946. <xsl:template match="glossentry/glossdef" mode="glossary.as.blocks">
  947. <xsl:apply-templates select="*[local-name(.) != 'glossseealso']"
  948. mode="glossary.as.blocks"/>
  949. <xsl:if test="glossseealso">
  950. <fo:block>
  951. <xsl:variable name="template">
  952. <xsl:call-template name="gentext.template">
  953. <xsl:with-param name="context" select="'glossary'"/>
  954. <xsl:with-param name="name" select="'seealso'"/>
  955. </xsl:call-template>
  956. </xsl:variable>
  957. <xsl:variable name="title">
  958. <xsl:apply-templates select="glossseealso" mode="glossary.as.blocks"/>
  959. </xsl:variable>
  960. <xsl:call-template name="substitute-markup">
  961. <xsl:with-param name="template" select="$template"/>
  962. <xsl:with-param name="title" select="$title"/>
  963. </xsl:call-template>
  964. </fo:block>
  965. </xsl:if>
  966. </xsl:template>
  967. <xsl:template match="glossentry/glossdef/para[1]|glossentry/glossdef/simpara[1]"
  968. mode="glossary.as.blocks">
  969. <fo:block>
  970. <xsl:apply-templates/>
  971. </fo:block>
  972. </xsl:template>
  973. <!-- Handle any other glossdef content normally -->
  974. <xsl:template match="*" mode="glossary.as.blocks">
  975. <xsl:apply-templates select="." />
  976. </xsl:template>
  977. <xsl:template match="glossseealso" mode="glossary.as.blocks">
  978. <xsl:variable name="otherterm" select="@otherterm"/>
  979. <xsl:variable name="targets" select="key('id', $otherterm)"/>
  980. <xsl:variable name="target" select="$targets[1]"/>
  981. <xsl:choose>
  982. <xsl:when test="$target">
  983. <fo:basic-link internal-destination="{$otherterm}"
  984. xsl:use-attribute-sets="xref.properties">
  985. <xsl:apply-templates select="$target" mode="xref-to"/>
  986. </fo:basic-link>
  987. </xsl:when>
  988. <xsl:when test="$otherterm != '' and not($target)">
  989. <xsl:message>
  990. <xsl:text>Warning: glossseealso @otherterm reference not found: </xsl:text>
  991. <xsl:value-of select="$otherterm"/>
  992. </xsl:message>
  993. <xsl:apply-templates mode="glossary.as.blocks"/>
  994. </xsl:when>
  995. <xsl:otherwise>
  996. <xsl:apply-templates mode="glossary.as.blocks"/>
  997. </xsl:otherwise>
  998. </xsl:choose>
  999. <xsl:choose>
  1000. <xsl:when test="position() = last()">
  1001. <xsl:text>.</xsl:text>
  1002. </xsl:when>
  1003. <xsl:otherwise>
  1004. <xsl:text>, </xsl:text>
  1005. </xsl:otherwise>
  1006. </xsl:choose>
  1007. </xsl:template>
  1008. <!-- ==================================================================== -->
  1009. </xsl:stylesheet>