1
0

utility.xsl 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. <?xml version='1.0'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:exsl="http://exslt.org/common"
  4. xmlns:dyn="http://exslt.org/dynamic"
  5. xmlns:saxon="http://icl.com/saxon"
  6. exclude-result-prefixes="exsl dyn saxon"
  7. version='1.0'>
  8. <!-- ********************************************************************
  9. $Id: utility.xsl 9703 2013-01-07 20:13:05Z bobstayton $
  10. ********************************************************************
  11. This file is part of the XSL DocBook Stylesheet distribution.
  12. See ../README or http://docbook.sf.net/release/xsl/current/ for
  13. copyright and other information.
  14. ******************************************************************** -->
  15. <!-- ==================================================================== -->
  16. <!-- * This file contains "utility" templates that are called multiple -->
  17. <!-- * times per each Refentry. -->
  18. <!-- ==================================================================== -->
  19. <!-- * NOTE TO DEVELOPERS: For ease of maintenance, the current -->
  20. <!-- * manpages stylesheets use the "bold" and "italic" named -->
  21. <!-- * templates for anything and everything that needs to get -->
  22. <!-- * boldfaced or italicized. -->
  23. <!-- * -->
  24. <!-- * So if you add anything that needs bold or italic character -->
  25. <!-- * formatting, try to apply these templates to it rather than -->
  26. <!-- * writing separate code to format it. This can be a little odd if -->
  27. <!-- * the content you want to format is not element content; in those -->
  28. <!-- * cases, you need to turn it into element content before applying -->
  29. <!-- * the template; see examples of this in the existing code. -->
  30. <xsl:template name="bold">
  31. <xsl:param name="node"/>
  32. <xsl:param name="context"/>
  33. <xsl:choose>
  34. <xsl:when test="not($context[ancestor::title])">
  35. <xsl:for-each select="$node/node()">
  36. <xsl:text>\fB</xsl:text>
  37. <xsl:apply-templates select="."/>
  38. <xsl:text>\fR</xsl:text>
  39. </xsl:for-each>
  40. </xsl:when>
  41. <xsl:otherwise>
  42. <xsl:apply-templates select="$node/node()"/>
  43. </xsl:otherwise>
  44. </xsl:choose>
  45. </xsl:template>
  46. <xsl:template name="italic">
  47. <xsl:param name="node"/>
  48. <xsl:param name="context"/>
  49. <xsl:for-each select="$node/node()">
  50. <xsl:text>\fI</xsl:text>
  51. <xsl:apply-templates select="."/>
  52. <xsl:text>\fR</xsl:text>
  53. </xsl:for-each>
  54. </xsl:template>
  55. <xsl:template name="inline.monoseq">
  56. <xsl:param name="content">
  57. <xsl:apply-templates/>
  58. </xsl:param>
  59. <xsl:call-template name="code-inline-start"/>
  60. <xsl:copy-of select="$content"/>
  61. <xsl:call-template name="code-inline-end"/>
  62. </xsl:template>
  63. <xsl:template name="code-inline-start">
  64. <xsl:if test="not($man.output.better.ps.enabled = 0)">
  65. <xsl:text>\FC</xsl:text>
  66. </xsl:if>
  67. </xsl:template>
  68. <xsl:template name="code-inline-end">
  69. <xsl:if test="not($man.output.better.ps.enabled = 0)">
  70. <xsl:text>\F[]</xsl:text>
  71. </xsl:if>
  72. </xsl:template>
  73. <!-- ================================================================== -->
  74. <xsl:template name="verbatim-block-start">
  75. <xsl:if test="not($man.output.better.ps.enabled = 0)">
  76. <xsl:text>.fam C&#10;</xsl:text>
  77. <xsl:text>.ps -1&#10;</xsl:text>
  78. </xsl:if>
  79. </xsl:template>
  80. <xsl:template name="verbatim-block-end">
  81. <xsl:if test="not($man.output.better.ps.enabled = 0)">
  82. <xsl:text>.fam&#10;</xsl:text>
  83. <xsl:text>.ps +1&#10;</xsl:text>
  84. </xsl:if>
  85. </xsl:template>
  86. <xsl:template name="synopsis-block-start">
  87. <xsl:if test="not($man.output.better.ps.enabled = 0)">
  88. <xsl:text>.fam C&#10;</xsl:text>
  89. </xsl:if>
  90. </xsl:template>
  91. <xsl:template name="synopsis-block-end">
  92. <xsl:if test="not($man.output.better.ps.enabled = 0)">
  93. <xsl:text>.fam&#10;</xsl:text>
  94. </xsl:if>
  95. </xsl:template>
  96. <!-- ================================================================== -->
  97. <!-- * NOTE TO DEVELOPERS: For ease of maintenance, the current -->
  98. <!-- * manpages stylesheets use the mode="prevent.line.breaking" -->
  99. <!-- * templates for anything and everything that needs to have -->
  100. <!-- * embedded spaces turned into no-break spaces in output - in -->
  101. <!-- * order to prevent that output from getting broken across lines -->
  102. <!-- * -->
  103. <!-- * So if you add anything that whose output, try to apply this -->
  104. <!-- * template to it rather than writing separate code to format -->
  105. <!-- * it. This can be a little odd if the content you want to -->
  106. <!-- * format is not element content; in those cases, you need to -->
  107. <!-- * turn it into element content before applying the template; -->
  108. <!-- * see examples of this in the existing code. -->
  109. <!-- * -->
  110. <!-- * This template is currently called by the funcdef and paramdef -->
  111. <!-- * and group/arg templates. -->
  112. <xsl:template mode="prevent.line.breaking" match="*">
  113. <xsl:variable name="rcontent">
  114. <xsl:apply-templates/>
  115. </xsl:variable>
  116. <xsl:variable name="content">
  117. <xsl:value-of select="normalize-space($rcontent)"/>
  118. </xsl:variable>
  119. <xsl:call-template name="string.subst">
  120. <xsl:with-param name="string" select="$content"/>
  121. <xsl:with-param name="target" select="' '"/>
  122. <!-- * U+2580 is a "UPPER HALF BLOCK"; we use it here because -->
  123. <!-- * if we were to just use a normal space, it would get -->
  124. <!-- * replaced when normalization is done. We replace it -->
  125. <!-- * later with the groff markup for non-breaking space. -->
  126. <xsl:with-param name="replacement" select="'&#x2580;'"/>
  127. </xsl:call-template>
  128. </xsl:template>
  129. <!-- ================================================================== -->
  130. <xsl:template name="suppress.hyphenation">
  131. <!-- * we need to suppress hyphenation inline only if hyphenation is -->
  132. <!-- * actually on, and even then only outside of Cmdsynopsis and -->
  133. <!-- * Funcsynopsis, where it is already always turned off -->
  134. <xsl:if test="$man.hyphenate != 0 and
  135. not(ancestor::cmdsynopsis) and
  136. not(ancestor::funcsynopsis)">
  137. <xsl:text>\%</xsl:text>
  138. </xsl:if>
  139. </xsl:template>
  140. <!-- ================================================================== -->
  141. <!-- * The replace.dots.and.dashes template is used to cause real -->
  142. <!-- * dots and dashes to be output in the top comment (instead of -->
  143. <!-- * escaped ones as in the source for the text displayed in the -->
  144. <!-- * body of the page) -->
  145. <xsl:template name="replace.dots.and.dashes">
  146. <xsl:param name="content">
  147. <xsl:apply-templates/>
  148. </xsl:param>
  149. <xsl:variable name="dot-content">
  150. <xsl:call-template name="string.subst">
  151. <xsl:with-param name="string" select="$content"/>
  152. <xsl:with-param name="target" select="'\&amp;.'"/>
  153. <xsl:with-param name="replacement" select="'.'"/>
  154. </xsl:call-template>
  155. </xsl:variable>
  156. <xsl:call-template name="string.subst">
  157. <xsl:with-param name="string" select="$dot-content"/>
  158. <xsl:with-param name="target" select="'\-'"/>
  159. <xsl:with-param name="replacement" select="'-'"/>
  160. </xsl:call-template>
  161. </xsl:template>
  162. <!-- ================================================================== -->
  163. <!-- * The nested-section-title template is called for refsect3, and any -->
  164. <!-- * refsection nested more than 2 levels deep. -->
  165. <xsl:template name="nested-section-title">
  166. <xsl:text>.sp&#10;</xsl:text>
  167. <xsl:call-template name="pinch.together"/>
  168. <xsl:text>.ps +1&#10;</xsl:text>
  169. <xsl:call-template name="make.bold.title"/>
  170. </xsl:template>
  171. <xsl:template name="pinch.together">
  172. <!-- * arcane roff code to suppress line spacing after headings -->
  173. <xsl:text>.it 1 an-trap&#10;</xsl:text>
  174. <xsl:text>.nr an-no-space-flag 1&#10;</xsl:text>
  175. <xsl:text>.nr an-break-flag 1&#10;</xsl:text>
  176. <xsl:text>.br&#10;</xsl:text>
  177. </xsl:template>
  178. <xsl:template name="make.bold.title">
  179. <!-- * make title wrapper so that we can use "bold" template to apply -->
  180. <!-- * character formatting to it -->
  181. <xsl:variable name="title.wrapper">
  182. <xsl:choose>
  183. <xsl:when test="title">
  184. <xsl:value-of select="normalize-space(title[1])"/>
  185. </xsl:when>
  186. <xsl:otherwise>
  187. <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
  188. </xsl:otherwise>
  189. </xsl:choose>
  190. </xsl:variable>
  191. <xsl:call-template name="mark.subheading"/>
  192. <xsl:call-template name="bold">
  193. <xsl:with-param name="node" select="exsl:node-set($title.wrapper)"/>
  194. <xsl:with-param name="context" select="."/>
  195. </xsl:call-template>
  196. <xsl:text>&#10;</xsl:text>
  197. <xsl:call-template name="mark.subheading"/>
  198. </xsl:template>
  199. <!-- ================================================================== -->
  200. <!-- * The mixed-block template jumps through a few hoops to deal with -->
  201. <!-- * mixed-content blocks, so that we don't end up munging verbatim -->
  202. <!-- * environments or lists and so that we don't gobble up whitespace -->
  203. <!-- * when we shouldn't -->
  204. <xsl:template name="mixed-block">
  205. <xsl:for-each select="node()">
  206. <xsl:choose>
  207. <!-- * Check to see if this node is a verbatim environment. -->
  208. <!-- * If so, put a line of space before it. -->
  209. <!-- * -->
  210. <!-- * Yes, address and synopsis are vertabim environments. -->
  211. <!-- * -->
  212. <!-- * The code here previously also treated informaltable as a -->
  213. <!-- * verbatim, presumably to support some kludge; I removed it -->
  214. <xsl:when test="self::address|self::literallayout|self::programlisting|
  215. self::screen|self::synopsis">
  216. <xsl:text>&#10;</xsl:text>
  217. <xsl:text>.sp&#10;</xsl:text>
  218. <xsl:call-template name="mark.up.block.start"/>
  219. <xsl:apply-templates select="."/>
  220. </xsl:when>
  221. <!-- * Check to see if this node is a list; if it is, we don't -->
  222. <!-- * want to normalize-space(), so we just apply-templates. -->
  223. <!-- * Do same for all admonitions -->
  224. <xsl:when test="(self::itemizedlist|self::orderedlist|
  225. self::variablelist|self::glosslist|
  226. self::simplelist[@type !='inline']|
  227. self::segmentedlist|
  228. self::caution|self::important|
  229. self::note|self::tip|self::warning|
  230. self::table|self::informaltable)">
  231. <xsl:call-template name="mark.up.block.start"/>
  232. <xsl:apply-templates select="."/>
  233. </xsl:when>
  234. <xsl:when test="self::text()">
  235. <!-- * Check to see if this is a text node. -->
  236. <!-- * -->
  237. <!-- * If so, replace all whitespace at the beginning or end of it -->
  238. <!-- * with a single linebreak. -->
  239. <!-- * -->
  240. <xsl:variable name="content">
  241. <xsl:apply-templates select="."/>
  242. </xsl:variable>
  243. <xsl:if
  244. test="starts-with(translate(.,'&#9;&#10;&#13; ',' '), ' ')
  245. and preceding-sibling::node()[1][name(.)!='']
  246. and normalize-space($content) != ''
  247. and not(
  248. preceding-sibling::*[1][
  249. self::caution or
  250. self::important or
  251. self::note or
  252. self::tip or
  253. self::warning or
  254. self::variablelist or
  255. self::glosslist or
  256. self::itemizedlist or
  257. self::orderedlist or
  258. self::segmentedlist or
  259. self::procedure or
  260. self::address or
  261. self::literallayout or
  262. self::programlisting or
  263. self::synopsis or
  264. self::screen or
  265. self::table or
  266. self::informaltable
  267. ]
  268. )
  269. ">
  270. <xsl:text>&#10;</xsl:text>
  271. </xsl:if>
  272. <xsl:value-of select="normalize-space($content)"/>
  273. <xsl:if
  274. test="(translate(substring(., string-length(.), 1),'&#9;&#10;&#13; ',' ') = ' '
  275. and following-sibling::node()[1][name(.)!=''])
  276. or following-sibling::node()[1][self::comment()]
  277. or following-sibling::node()[1][self::processing-instruction()]
  278. ">
  279. <xsl:if test="normalize-space($content) != ''
  280. or concat(normalize-space($content), ' ') != ' '">
  281. <xsl:text>&#10;</xsl:text>
  282. </xsl:if>
  283. </xsl:if>
  284. </xsl:when>
  285. <xsl:otherwise>
  286. <!-- * At this point, we know that this node is not a verbatim -->
  287. <!-- * environment, list, admonition, or text node; so we can -->
  288. <!-- * safely normalize-space() it. -->
  289. <xsl:variable name="content">
  290. <xsl:apply-templates select="."/>
  291. </xsl:variable>
  292. <xsl:value-of select="normalize-space($content)"/>
  293. </xsl:otherwise>
  294. </xsl:choose>
  295. </xsl:for-each>
  296. <xsl:call-template name="mark.up.block.end"/>
  297. </xsl:template>
  298. <!-- ================================================================== -->
  299. <!-- * Footnote and annotation contents are displayed using a hanging -->
  300. <!-- * indent out to $man.indent.width If a paragraph-level block -->
  301. <!-- * element (verbatim, list, or admonition) is the first block -->
  302. <!-- * element nested at its same level within the same footnote or -->
  303. <!-- * annotation, then we push it over by the same indent width. -->
  304. <!-- * -->
  305. <!-- * We don't reset the indent for each following sibling, but -->
  306. <!-- * instead do it after for-eaching over all block siblings at -->
  307. <!-- * the same level. So the effect is that if there are any -->
  308. <!-- * following-sibling blocks after the block that starts this -->
  309. <!-- * indent, then they just retain the indent that was already set -->
  310. <xsl:template name="mark.up.block.start">
  311. <xsl:choose>
  312. <xsl:when test="(ancestor::footnote
  313. or ancestor::annotation)">
  314. <xsl:if test="not(preceding-sibling::address|
  315. preceding-sibling::literallayout|
  316. preceding-sibling::programlisting|
  317. preceding-sibling::screen|
  318. preceding-sibling::synopsis|
  319. preceding-sibling::itemizedlist|
  320. preceding-sibling::orderedlist|
  321. preceding-sibling::variablelist|
  322. preceding-sibling::glosslist|
  323. preceding-sibling::simplelist[@type !='inline']|
  324. preceding-sibling::segmentedlist|
  325. preceding-sibling::caution|
  326. preceding-sibling::important|
  327. preceding-sibling::note|
  328. preceding-sibling::tip|
  329. preceding-sibling::warning|
  330. preceding-sibling::table|
  331. preceding-sibling::informaltable
  332. )">
  333. <xsl:text>.RS</xsl:text>
  334. <xsl:if test="not($list-indent = '')">
  335. <xsl:text> </xsl:text>
  336. <xsl:value-of select="$list-indent"/>
  337. </xsl:if>
  338. <xsl:text>&#10;</xsl:text>
  339. </xsl:if>
  340. </xsl:when>
  341. </xsl:choose>
  342. </xsl:template>
  343. <!-- * Check to see if we were called from a block within a footnote or -->
  344. <!-- * annotation; if so, and the block contains any nested block -->
  345. <!-- * content, then we know the mark.up.block.end template was already -->
  346. <!-- * called to generate a .RS macro to indent that nested block -->
  347. <!-- * content; so we need to generate a .RE to set the margin back to -->
  348. <!-- * where it was prior to the .RS call. -->
  349. <xsl:template name="mark.up.block.end">
  350. <xsl:if test="(ancestor::footnote
  351. or ancestor::annotation)">
  352. <xsl:if test="address|
  353. literallayout|
  354. programlisting|
  355. screen|
  356. synopsis|
  357. itemizedlist|
  358. orderedlist|
  359. variablelist|
  360. glosslist|
  361. simplelist[@type !='inline']|
  362. segmentedlist|
  363. caution|
  364. important|
  365. note|
  366. tip|
  367. warning|
  368. table|
  369. informaltable">
  370. <xsl:text>&#10;</xsl:text>
  371. <xsl:text>.RE</xsl:text>
  372. <xsl:text>&#10;</xsl:text>
  373. </xsl:if>
  374. </xsl:if>
  375. </xsl:template>
  376. <!-- ================================================================== -->
  377. <!-- * The person.name template in the HTML stylesheets outputs extra -->
  378. <!-- * spaces that we need to strip out for manpages output. This -->
  379. <!-- * template calls person.name, then tries to do some smart -->
  380. <!-- * normalization of the result tree fragment from that. -->
  381. <xsl:template name="person.name.normalized">
  382. <xsl:variable name="contents">
  383. <xsl:call-template name="person.name"/>
  384. </xsl:variable>
  385. <!-- * We put the output of person.name into a node-set and then we -->
  386. <!-- * check it node-by-node and strip out space only where needed. -->
  387. <xsl:variable name="contents.tree" select="exsl:node-set($contents)"/>
  388. <xsl:for-each select="$contents.tree/node()">
  389. <xsl:choose>
  390. <!-- * We don't want to monkey with single spaces or commas/periods -->
  391. <!-- * followed by spaces, because those are bits of text that are -->
  392. <!-- * actually generated by the person.name template itself (that -->
  393. <!-- * is, they're not in the source). So, we preserve them. -->
  394. <xsl:when test=". = ' ' or . = ', ' or . = '. '">
  395. <xsl:value-of select="."/>
  396. </xsl:when>
  397. <xsl:otherwise>
  398. <xsl:value-of select="normalize-space(.)"/>
  399. </xsl:otherwise>
  400. </xsl:choose>
  401. </xsl:for-each>
  402. </xsl:template>
  403. <!-- ================================================================== -->
  404. <xsl:template name="make.adjusted.man.filename">
  405. <xsl:param name="name"/>
  406. <xsl:param name="lang"/>
  407. <xsl:param name="name.with.lang">
  408. <xsl:choose>
  409. <xsl:when test="$lang != 'en'
  410. and not($man.output.lang.in.name.enabled = 0)
  411. and ($man.output.subdirs.enabled = 0 or
  412. $man.output.in.separate.dir = 0)">
  413. <!-- * $lang is not en (English) -->
  414. <!-- * AND user has specified man.output.lang.in.name.enabled -->
  415. <!-- * AND doesn't want output going into separate dirs, -->
  416. <!-- * SO... we include the $lang value in the filename; e.g., -->
  417. <!-- * foo.ja.1 -->
  418. <xsl:value-of select="concat($name, '.', $lang)"/>
  419. </xsl:when>
  420. <xsl:otherwise>
  421. <!-- * user either has man.output.lang.in.name.enabled unset -->
  422. <!-- * or has set it but also has man.output.subdirs.enabled -->
  423. <!-- * set (in which case the $lang value is used to add a -->
  424. <!-- * $lang subdir in the pathname); in either case, we don't -->
  425. <!-- * want to include the $lang in the filename -->
  426. <xsl:value-of select="$name"/>
  427. </xsl:otherwise>
  428. </xsl:choose>
  429. </xsl:param>
  430. <xsl:param name="section"/>
  431. <xsl:param name="dirname">
  432. <xsl:if test="not($man.output.in.separate.dir = 0)">
  433. <xsl:choose>
  434. <xsl:when test="not($man.output.subdirs.enabled = 0)">
  435. <xsl:variable name="lang.subdir">
  436. <xsl:if test="not($man.output.lang.in.name.enabled = 0)">
  437. <!-- * user has man.output.lang.in.name.enabled set, so -->
  438. <!-- * we need to add a $lang subdir -->
  439. <xsl:value-of select="concat($lang, '/')"/>
  440. </xsl:if>
  441. </xsl:variable>
  442. <xsl:value-of
  443. select="concat($man.output.base.dir, $lang.subdir,
  444. 'man', normalize-space($section), '/')"/>
  445. </xsl:when>
  446. <xsl:otherwise>
  447. <xsl:value-of select="$man.output.base.dir"/>
  448. </xsl:otherwise>
  449. </xsl:choose>
  450. </xsl:if>
  451. </xsl:param>
  452. <xsl:call-template name="string.subst">
  453. <!-- * To create the man filename, replace any spaces in filename with -->
  454. <!-- * underscores and then append a dot plus a section number. -->
  455. <xsl:with-param name="string"
  456. select="concat($dirname,
  457. normalize-space($name.with.lang),
  458. '.', normalize-space($section))"/>
  459. <xsl:with-param name="target" select="' '"/>
  460. <xsl:with-param name="replacement" select="'_'"/>
  461. </xsl:call-template>
  462. </xsl:template>
  463. <!-- ================================================================== -->
  464. <xsl:template name="make.subheading">
  465. <xsl:param name="title"/>
  466. <xsl:call-template name="mark.subheading"/>
  467. <xsl:text>.SH</xsl:text>
  468. <xsl:text> </xsl:text>
  469. <xsl:text>"</xsl:text>
  470. <xsl:choose>
  471. <xsl:when test="not($man.output.better.ps.enabled = 0)">
  472. <xsl:value-of select="$title"/>
  473. </xsl:when>
  474. <xsl:otherwise>
  475. <xsl:call-template name="string.upper">
  476. <xsl:with-param name="string" select="$title"/>
  477. </xsl:call-template>
  478. </xsl:otherwise>
  479. </xsl:choose>
  480. <xsl:text>"</xsl:text>
  481. <xsl:text>&#10;</xsl:text>
  482. <xsl:call-template name="mark.subheading"/>
  483. </xsl:template>
  484. <!-- * Put a horizontal rule or other divider around section titles -->
  485. <!-- * in roff source (just to make things easier to read). -->
  486. <xsl:template name="mark.subheading">
  487. <xsl:if test="$man.subheading.divider.enabled != 0">
  488. <xsl:text>.\" </xsl:text>
  489. <xsl:value-of select="$man.subheading.divider"/>
  490. <xsl:text>&#10;</xsl:text>
  491. </xsl:if>
  492. </xsl:template>
  493. <!-- ================================================================== -->
  494. <xsl:template name="roff-if-else-start">
  495. <xsl:param name="condition">n</xsl:param>
  496. <xsl:text>.ie </xsl:text>
  497. <xsl:value-of select="$condition"/>
  498. <xsl:text> \{\&#10;</xsl:text>
  499. </xsl:template>
  500. <xsl:template name="roff-if-start">
  501. <xsl:param name="condition">n</xsl:param>
  502. <xsl:text>.if </xsl:text>
  503. <xsl:value-of select="$condition"/>
  504. <xsl:text> \{\&#10;</xsl:text>
  505. </xsl:template>
  506. <xsl:template name="roff-else">
  507. <xsl:text>.\}&#10;</xsl:text>
  508. <xsl:text>.el \{\&#10;</xsl:text>
  509. </xsl:template>
  510. <xsl:template name="roff-if-end">
  511. <xsl:text>.\}&#10;</xsl:text>
  512. </xsl:template>
  513. </xsl:stylesheet>