inline.xsl 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490
  1. <?xml version="1.0" encoding="ASCII"?><!--This file was created automatically by html2xhtml--><!--from the HTML stylesheets.--><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:suwl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.UnwrapLinks" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xlink suwl" version="1.0">
  2. <!-- ********************************************************************
  3. $Id: inline.xsl 9663 2012-11-06 19:09:16Z bobstayton $
  4. ********************************************************************
  5. This file is part of the XSL DocBook Stylesheet distribution.
  6. See ../README or http://docbook.sf.net/release/xsl/current/ for
  7. copyright and other information.
  8. ******************************************************************** -->
  9. <xsl:key name="glossentries" match="glossentry" use="normalize-space(glossterm)"/>
  10. <xsl:key name="glossentries" match="glossentry" use="normalize-space(glossterm/@baseform)"/>
  11. <xsl:template name="simple.xlink">
  12. <xsl:param name="node" select="."/>
  13. <xsl:param name="content">
  14. <xsl:apply-templates/>
  15. </xsl:param>
  16. <xsl:param name="linkend" select="$node/@linkend"/>
  17. <xsl:param name="xhref" select="$node/@xlink:href"/>
  18. <!-- Support for @xlink:show -->
  19. <xsl:variable name="target.show">
  20. <xsl:choose>
  21. <xsl:when test="$node/@xlink:show = 'new'">_blank</xsl:when>
  22. <xsl:when test="$node/@xlink:show = 'replace'">_top</xsl:when>
  23. <xsl:otherwise/>
  24. </xsl:choose>
  25. </xsl:variable>
  26. <xsl:variable name="link">
  27. <xsl:choose>
  28. <xsl:when test="$xhref and (not($node/@xlink:type) or $node/@xlink:type='simple')">
  29. <!-- Is it a local idref or a uri? -->
  30. <xsl:variable name="is.idref">
  31. <xsl:choose>
  32. <!-- if the href starts with # and does not contain an "(" -->
  33. <!-- or if the href starts with #xpointer(id(, it's just an ID -->
  34. <xsl:when test="starts-with($xhref,'#') and (not(contains($xhref,'(')) or starts-with($xhref, '#xpointer(id('))">1</xsl:when>
  35. <xsl:otherwise>0</xsl:otherwise>
  36. </xsl:choose>
  37. </xsl:variable>
  38. <!-- Is it an olink ? -->
  39. <xsl:variable name="is.olink">
  40. <xsl:choose>
  41. <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
  42. <!-- and if the href contains # -->
  43. <xsl:when test="contains($xhref,'#') and @xlink:role = $xolink.role">1</xsl:when>
  44. <xsl:otherwise>0</xsl:otherwise>
  45. </xsl:choose>
  46. </xsl:variable>
  47. <xsl:choose>
  48. <xsl:when test="$is.olink = 1">
  49. <xsl:call-template name="olink">
  50. <xsl:with-param name="content" select="$content"/>
  51. </xsl:call-template>
  52. </xsl:when>
  53. <xsl:when test="$is.idref = 1">
  54. <xsl:variable name="idref">
  55. <xsl:call-template name="xpointer.idref">
  56. <xsl:with-param name="xpointer" select="$xhref"/>
  57. </xsl:call-template>
  58. </xsl:variable>
  59. <xsl:variable name="targets" select="key('id',$idref)"/>
  60. <xsl:variable name="target" select="$targets[1]"/>
  61. <xsl:call-template name="check.id.unique">
  62. <xsl:with-param name="linkend" select="$idref"/>
  63. </xsl:call-template>
  64. <xsl:choose>
  65. <xsl:when test="count($target) = 0">
  66. <xsl:message>
  67. <xsl:text>XLink to nonexistent id: </xsl:text>
  68. <xsl:value-of select="$idref"/>
  69. </xsl:message>
  70. <xsl:copy-of select="$content"/>
  71. </xsl:when>
  72. <xsl:otherwise>
  73. <a>
  74. <xsl:apply-templates select="." mode="common.html.attributes"/>
  75. <xsl:call-template name="id.attribute"/>
  76. <xsl:attribute name="href">
  77. <xsl:call-template name="href.target">
  78. <xsl:with-param name="object" select="$target"/>
  79. </xsl:call-template>
  80. </xsl:attribute>
  81. <xsl:choose>
  82. <xsl:when test="$node/@xlink:title">
  83. <xsl:attribute name="title">
  84. <xsl:value-of select="$node/@xlink:title"/>
  85. </xsl:attribute>
  86. </xsl:when>
  87. <xsl:otherwise>
  88. <xsl:apply-templates select="$target" mode="html.title.attribute"/>
  89. </xsl:otherwise>
  90. </xsl:choose>
  91. <xsl:if test="$target.show !=''">
  92. <xsl:attribute name="target">
  93. <xsl:value-of select="$target.show"/>
  94. </xsl:attribute>
  95. </xsl:if>
  96. <xsl:copy-of select="$content"/>
  97. </a>
  98. </xsl:otherwise>
  99. </xsl:choose>
  100. </xsl:when>
  101. <!-- otherwise it's a URI -->
  102. <xsl:otherwise>
  103. <a>
  104. <xsl:apply-templates select="." mode="common.html.attributes"/>
  105. <xsl:call-template name="id.attribute"/>
  106. <xsl:attribute name="href">
  107. <xsl:value-of select="$xhref"/>
  108. </xsl:attribute>
  109. <xsl:if test="$node/@xlink:title">
  110. <xsl:attribute name="title">
  111. <xsl:value-of select="$node/@xlink:title"/>
  112. </xsl:attribute>
  113. </xsl:if>
  114. <!-- For URIs, use @xlink:show if defined, otherwise use ulink.target -->
  115. <xsl:choose>
  116. <xsl:when test="$target.show !=''">
  117. <xsl:attribute name="target">
  118. <xsl:value-of select="$target.show"/>
  119. </xsl:attribute>
  120. </xsl:when>
  121. <xsl:when test="$ulink.target !=''">
  122. <xsl:attribute name="target">
  123. <xsl:value-of select="$ulink.target"/>
  124. </xsl:attribute>
  125. </xsl:when>
  126. </xsl:choose>
  127. <xsl:copy-of select="$content"/>
  128. </a>
  129. </xsl:otherwise>
  130. </xsl:choose>
  131. </xsl:when>
  132. <xsl:when test="$linkend">
  133. <xsl:variable name="targets" select="key('id',$linkend)"/>
  134. <xsl:variable name="target" select="$targets[1]"/>
  135. <xsl:call-template name="check.id.unique">
  136. <xsl:with-param name="linkend" select="$linkend"/>
  137. </xsl:call-template>
  138. <a>
  139. <xsl:apply-templates select="." mode="common.html.attributes"/>
  140. <xsl:call-template name="id.attribute"/>
  141. <xsl:attribute name="href">
  142. <xsl:call-template name="href.target">
  143. <xsl:with-param name="object" select="$target"/>
  144. </xsl:call-template>
  145. </xsl:attribute>
  146. <xsl:apply-templates select="$target" mode="html.title.attribute"/>
  147. <xsl:copy-of select="$content"/>
  148. </a>
  149. </xsl:when>
  150. <xsl:otherwise>
  151. <xsl:copy-of select="$content"/>
  152. </xsl:otherwise>
  153. </xsl:choose>
  154. </xsl:variable>
  155. <xsl:choose>
  156. <xsl:when test="function-available('suwl:unwrapLinks')">
  157. <xsl:copy-of select="suwl:unwrapLinks($link)"/>
  158. </xsl:when>
  159. <xsl:otherwise>
  160. <xsl:copy-of select="$link"/>
  161. </xsl:otherwise>
  162. </xsl:choose>
  163. </xsl:template>
  164. <xsl:template name="inline.charseq">
  165. <xsl:param name="content">
  166. <xsl:call-template name="anchor"/>
  167. <xsl:call-template name="simple.xlink">
  168. <xsl:with-param name="content">
  169. <xsl:apply-templates/>
  170. </xsl:with-param>
  171. </xsl:call-template>
  172. </xsl:param>
  173. <!-- * if you want output from the inline.charseq template wrapped in -->
  174. <!-- * something other than a Span, call the template with some value -->
  175. <!-- * for the 'wrapper-name' param -->
  176. <xsl:param name="wrapper-name">span</xsl:param>
  177. <xsl:element name="{$wrapper-name}" namespace="http://www.w3.org/1999/xhtml">
  178. <xsl:attribute name="class">
  179. <xsl:value-of select="local-name(.)"/>
  180. </xsl:attribute>
  181. <xsl:call-template name="id.attribute"/>
  182. <xsl:call-template name="dir"/>
  183. <xsl:call-template name="generate.html.title"/>
  184. <xsl:copy-of select="$content"/>
  185. <xsl:call-template name="apply-annotations"/>
  186. </xsl:element>
  187. </xsl:template>
  188. <xsl:template name="inline.monoseq">
  189. <xsl:param name="content">
  190. <xsl:call-template name="anchor"/>
  191. <xsl:call-template name="simple.xlink">
  192. <xsl:with-param name="content">
  193. <xsl:apply-templates/>
  194. </xsl:with-param>
  195. </xsl:call-template>
  196. </xsl:param>
  197. <code>
  198. <xsl:apply-templates select="." mode="common.html.attributes"/>
  199. <xsl:call-template name="id.attribute"/>
  200. <xsl:copy-of select="$content"/>
  201. <xsl:call-template name="apply-annotations"/>
  202. </code>
  203. </xsl:template>
  204. <xsl:template name="inline.boldseq">
  205. <xsl:param name="content">
  206. <xsl:call-template name="anchor"/>
  207. <xsl:call-template name="simple.xlink">
  208. <xsl:with-param name="content">
  209. <xsl:apply-templates/>
  210. </xsl:with-param>
  211. </xsl:call-template>
  212. </xsl:param>
  213. <span>
  214. <xsl:apply-templates select="." mode="common.html.attributes"/>
  215. <xsl:call-template name="id.attribute"/>
  216. <!-- don't put <strong> inside figure, example, or table titles -->
  217. <xsl:choose>
  218. <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table')">
  219. <xsl:copy-of select="$content"/>
  220. </xsl:when>
  221. <xsl:otherwise>
  222. <strong>
  223. <xsl:copy-of select="$content"/>
  224. </strong>
  225. </xsl:otherwise>
  226. </xsl:choose>
  227. <xsl:call-template name="apply-annotations"/>
  228. </span>
  229. </xsl:template>
  230. <xsl:template name="inline.italicseq">
  231. <xsl:param name="content">
  232. <xsl:call-template name="anchor"/>
  233. <xsl:call-template name="simple.xlink">
  234. <xsl:with-param name="content">
  235. <xsl:apply-templates/>
  236. </xsl:with-param>
  237. </xsl:call-template>
  238. </xsl:param>
  239. <em>
  240. <xsl:call-template name="common.html.attributes"/>
  241. <xsl:call-template name="id.attribute"/>
  242. <xsl:copy-of select="$content"/>
  243. <xsl:call-template name="apply-annotations"/>
  244. </em>
  245. </xsl:template>
  246. <xsl:template name="inline.boldmonoseq">
  247. <xsl:param name="content">
  248. <xsl:call-template name="anchor"/>
  249. <xsl:call-template name="simple.xlink">
  250. <xsl:with-param name="content">
  251. <xsl:apply-templates/>
  252. </xsl:with-param>
  253. </xsl:call-template>
  254. </xsl:param>
  255. <!-- don't put <strong> inside figure, example, or table titles -->
  256. <!-- or other titles that may already be represented with <strong>'s. -->
  257. <xsl:choose>
  258. <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
  259. <code>
  260. <xsl:call-template name="common.html.attributes"/>
  261. <xsl:call-template name="id.attribute"/>
  262. <xsl:copy-of select="$content"/>
  263. <xsl:call-template name="apply-annotations"/>
  264. </code>
  265. </xsl:when>
  266. <xsl:otherwise>
  267. <strong>
  268. <xsl:call-template name="common.html.attributes"/>
  269. <xsl:call-template name="id.attribute"/>
  270. <code>
  271. <xsl:call-template name="generate.html.title"/>
  272. <xsl:call-template name="dir"/>
  273. <xsl:copy-of select="$content"/>
  274. </code>
  275. <xsl:call-template name="apply-annotations"/>
  276. </strong>
  277. </xsl:otherwise>
  278. </xsl:choose>
  279. </xsl:template>
  280. <xsl:template name="inline.italicmonoseq">
  281. <xsl:param name="content">
  282. <xsl:call-template name="anchor"/>
  283. <xsl:call-template name="simple.xlink">
  284. <xsl:with-param name="content">
  285. <xsl:apply-templates/>
  286. </xsl:with-param>
  287. </xsl:call-template>
  288. </xsl:param>
  289. <em>
  290. <xsl:call-template name="common.html.attributes"/>
  291. <xsl:call-template name="id.attribute"/>
  292. <code>
  293. <xsl:call-template name="generate.html.title"/>
  294. <xsl:call-template name="dir"/>
  295. <xsl:copy-of select="$content"/>
  296. <xsl:call-template name="apply-annotations"/>
  297. </code>
  298. </em>
  299. </xsl:template>
  300. <xsl:template name="inline.superscriptseq">
  301. <xsl:param name="content">
  302. <xsl:call-template name="anchor"/>
  303. <xsl:call-template name="simple.xlink">
  304. <xsl:with-param name="content">
  305. <xsl:apply-templates/>
  306. </xsl:with-param>
  307. </xsl:call-template>
  308. </xsl:param>
  309. <sup>
  310. <xsl:call-template name="generate.html.title"/>
  311. <xsl:call-template name="id.attribute"/>
  312. <xsl:call-template name="dir"/>
  313. <xsl:copy-of select="$content"/>
  314. <xsl:call-template name="apply-annotations"/>
  315. </sup>
  316. </xsl:template>
  317. <xsl:template name="inline.subscriptseq">
  318. <xsl:param name="content">
  319. <xsl:call-template name="anchor"/>
  320. <xsl:call-template name="simple.xlink">
  321. <xsl:with-param name="content">
  322. <xsl:apply-templates/>
  323. </xsl:with-param>
  324. </xsl:call-template>
  325. </xsl:param>
  326. <sub>
  327. <xsl:call-template name="generate.html.title"/>
  328. <xsl:call-template name="id.attribute"/>
  329. <xsl:call-template name="dir"/>
  330. <xsl:copy-of select="$content"/>
  331. <xsl:call-template name="apply-annotations"/>
  332. </sub>
  333. </xsl:template>
  334. <!-- ==================================================================== -->
  335. <!-- some special cases -->
  336. <xsl:template match="author">
  337. <xsl:param name="content">
  338. <xsl:call-template name="anchor"/>
  339. <xsl:call-template name="simple.xlink">
  340. <xsl:with-param name="content">
  341. <xsl:call-template name="person.name"/>
  342. </xsl:with-param>
  343. </xsl:call-template>
  344. <xsl:call-template name="apply-annotations"/>
  345. </xsl:param>
  346. <span>
  347. <xsl:call-template name="common.html.attributes"/>
  348. <xsl:call-template name="id.attribute"/>
  349. <xsl:copy-of select="$content"/>
  350. </span>
  351. </xsl:template>
  352. <xsl:template match="editor">
  353. <xsl:param name="content">
  354. <xsl:call-template name="anchor"/>
  355. <xsl:call-template name="simple.xlink">
  356. <xsl:with-param name="content">
  357. <xsl:call-template name="person.name"/>
  358. </xsl:with-param>
  359. </xsl:call-template>
  360. <xsl:call-template name="apply-annotations"/>
  361. </xsl:param>
  362. <span>
  363. <xsl:call-template name="common.html.attributes"/>
  364. <xsl:call-template name="id.attribute"/>
  365. <xsl:copy-of select="$content"/>
  366. </span>
  367. </xsl:template>
  368. <xsl:template match="othercredit">
  369. <xsl:param name="content">
  370. <xsl:call-template name="anchor"/>
  371. <xsl:call-template name="simple.xlink">
  372. <xsl:with-param name="content">
  373. <xsl:call-template name="person.name"/>
  374. </xsl:with-param>
  375. </xsl:call-template>
  376. <xsl:call-template name="apply-annotations"/>
  377. </xsl:param>
  378. <span>
  379. <xsl:call-template name="common.html.attributes"/>
  380. <xsl:call-template name="id.attribute"/>
  381. <xsl:copy-of select="$content"/>
  382. </span>
  383. </xsl:template>
  384. <xsl:template match="authorinitials">
  385. <xsl:call-template name="inline.charseq"/>
  386. </xsl:template>
  387. <!-- ==================================================================== -->
  388. <xsl:template match="accel">
  389. <xsl:call-template name="inline.charseq"/>
  390. </xsl:template>
  391. <xsl:template match="action">
  392. <xsl:call-template name="inline.charseq"/>
  393. </xsl:template>
  394. <xsl:template match="application">
  395. <xsl:call-template name="inline.charseq"/>
  396. </xsl:template>
  397. <xsl:template match="classname">
  398. <xsl:call-template name="inline.monoseq"/>
  399. </xsl:template>
  400. <xsl:template match="exceptionname">
  401. <xsl:call-template name="inline.monoseq"/>
  402. </xsl:template>
  403. <xsl:template match="interfacename">
  404. <xsl:call-template name="inline.monoseq"/>
  405. </xsl:template>
  406. <xsl:template match="methodname">
  407. <xsl:call-template name="inline.monoseq"/>
  408. </xsl:template>
  409. <xsl:template match="command">
  410. <xsl:call-template name="inline.boldseq"/>
  411. </xsl:template>
  412. <xsl:template match="computeroutput">
  413. <xsl:call-template name="inline.monoseq"/>
  414. </xsl:template>
  415. <xsl:template match="constant">
  416. <xsl:call-template name="inline.monoseq"/>
  417. </xsl:template>
  418. <xsl:template match="database">
  419. <xsl:call-template name="inline.charseq"/>
  420. </xsl:template>
  421. <xsl:template match="date">
  422. <!-- should this support locale-specific formatting? how? -->
  423. <xsl:call-template name="inline.charseq"/>
  424. </xsl:template>
  425. <xsl:template match="errorcode">
  426. <xsl:call-template name="inline.charseq"/>
  427. </xsl:template>
  428. <xsl:template match="errorname">
  429. <xsl:call-template name="inline.charseq"/>
  430. </xsl:template>
  431. <xsl:template match="errortype">
  432. <xsl:call-template name="inline.charseq"/>
  433. </xsl:template>
  434. <xsl:template match="errortext">
  435. <xsl:call-template name="inline.charseq"/>
  436. </xsl:template>
  437. <xsl:template match="envar">
  438. <xsl:call-template name="inline.monoseq"/>
  439. </xsl:template>
  440. <xsl:template match="filename">
  441. <xsl:call-template name="inline.monoseq"/>
  442. </xsl:template>
  443. <xsl:template match="function">
  444. <xsl:choose>
  445. <xsl:when test="$function.parens != '0' and (parameter or function or replaceable)">
  446. <xsl:variable name="nodes" select="text()|*"/>
  447. <xsl:call-template name="inline.monoseq">
  448. <xsl:with-param name="content">
  449. <xsl:call-template name="simple.xlink">
  450. <xsl:with-param name="content">
  451. <xsl:apply-templates select="$nodes[1]"/>
  452. </xsl:with-param>
  453. </xsl:call-template>
  454. </xsl:with-param>
  455. </xsl:call-template>
  456. <xsl:text>(</xsl:text>
  457. <xsl:apply-templates select="$nodes[position()&gt;1]"/>
  458. <xsl:text>)</xsl:text>
  459. </xsl:when>
  460. <xsl:otherwise>
  461. <xsl:call-template name="inline.monoseq"/>
  462. </xsl:otherwise>
  463. </xsl:choose>
  464. </xsl:template>
  465. <xsl:template match="function/parameter" priority="2">
  466. <xsl:call-template name="inline.italicmonoseq"/>
  467. <xsl:if test="$function.parens != 0 and following-sibling::*">
  468. <xsl:text>, </xsl:text>
  469. </xsl:if>
  470. </xsl:template>
  471. <xsl:template match="function/replaceable" priority="2">
  472. <xsl:call-template name="inline.italicmonoseq"/>
  473. <xsl:if test="$function.parens != 0 and following-sibling::*">
  474. <xsl:text>, </xsl:text>
  475. </xsl:if>
  476. </xsl:template>
  477. <xsl:template match="guibutton">
  478. <xsl:call-template name="inline.charseq"/>
  479. </xsl:template>
  480. <xsl:template match="guiicon">
  481. <xsl:call-template name="inline.charseq"/>
  482. </xsl:template>
  483. <xsl:template match="guilabel">
  484. <xsl:call-template name="inline.charseq"/>
  485. </xsl:template>
  486. <xsl:template match="guimenu">
  487. <xsl:call-template name="inline.charseq"/>
  488. </xsl:template>
  489. <xsl:template match="guimenuitem">
  490. <xsl:call-template name="inline.charseq"/>
  491. </xsl:template>
  492. <xsl:template match="guisubmenu">
  493. <xsl:call-template name="inline.charseq"/>
  494. </xsl:template>
  495. <xsl:template match="hardware">
  496. <xsl:call-template name="inline.charseq"/>
  497. </xsl:template>
  498. <xsl:template match="interface">
  499. <xsl:call-template name="inline.charseq"/>
  500. </xsl:template>
  501. <xsl:template match="interfacedefinition">
  502. <xsl:call-template name="inline.charseq"/>
  503. </xsl:template>
  504. <xsl:template match="keycap">
  505. <xsl:choose>
  506. <xsl:when test="@function and normalize-space(.) = ''">
  507. <xsl:call-template name="inline.boldseq">
  508. <xsl:with-param name="content">
  509. <xsl:call-template name="gentext.template">
  510. <xsl:with-param name="context" select="'keycap'"/>
  511. <xsl:with-param name="name" select="@function"/>
  512. </xsl:call-template>
  513. </xsl:with-param>
  514. </xsl:call-template>
  515. </xsl:when>
  516. <xsl:otherwise>
  517. <xsl:call-template name="inline.boldseq"/>
  518. </xsl:otherwise>
  519. </xsl:choose>
  520. </xsl:template>
  521. <xsl:template match="keycode">
  522. <xsl:call-template name="inline.charseq"/>
  523. </xsl:template>
  524. <xsl:template match="keysym">
  525. <xsl:call-template name="inline.charseq"/>
  526. </xsl:template>
  527. <xsl:template match="literal">
  528. <xsl:call-template name="inline.monoseq"/>
  529. </xsl:template>
  530. <xsl:template match="code">
  531. <xsl:call-template name="inline.monoseq"/>
  532. </xsl:template>
  533. <xsl:template match="medialabel">
  534. <xsl:call-template name="inline.italicseq"/>
  535. </xsl:template>
  536. <xsl:template match="shortcut">
  537. <xsl:call-template name="inline.boldseq"/>
  538. </xsl:template>
  539. <xsl:template match="mousebutton">
  540. <xsl:call-template name="inline.charseq"/>
  541. </xsl:template>
  542. <xsl:template match="option">
  543. <xsl:call-template name="inline.monoseq"/>
  544. </xsl:template>
  545. <xsl:template match="package">
  546. <xsl:call-template name="inline.charseq"/>
  547. </xsl:template>
  548. <xsl:template match="parameter">
  549. <xsl:call-template name="inline.italicmonoseq"/>
  550. </xsl:template>
  551. <xsl:template match="property">
  552. <xsl:call-template name="inline.charseq"/>
  553. </xsl:template>
  554. <xsl:template match="prompt">
  555. <xsl:call-template name="inline.monoseq"/>
  556. </xsl:template>
  557. <xsl:template match="replaceable" priority="1">
  558. <xsl:call-template name="inline.italicmonoseq"/>
  559. </xsl:template>
  560. <xsl:template match="returnvalue">
  561. <xsl:call-template name="inline.charseq"/>
  562. </xsl:template>
  563. <xsl:template match="structfield">
  564. <xsl:call-template name="inline.italicmonoseq"/>
  565. </xsl:template>
  566. <xsl:template match="structname">
  567. <xsl:call-template name="inline.charseq"/>
  568. </xsl:template>
  569. <xsl:template match="symbol">
  570. <xsl:call-template name="inline.charseq"/>
  571. </xsl:template>
  572. <xsl:template match="systemitem">
  573. <xsl:call-template name="inline.monoseq"/>
  574. </xsl:template>
  575. <xsl:template match="token">
  576. <xsl:call-template name="inline.charseq"/>
  577. </xsl:template>
  578. <xsl:template match="type">
  579. <xsl:call-template name="inline.charseq"/>
  580. </xsl:template>
  581. <xsl:template match="userinput">
  582. <xsl:call-template name="inline.boldmonoseq"/>
  583. </xsl:template>
  584. <xsl:template match="abbrev">
  585. <xsl:call-template name="inline.charseq">
  586. <xsl:with-param name="wrapper-name">abbr</xsl:with-param>
  587. </xsl:call-template>
  588. </xsl:template>
  589. <xsl:template match="acronym">
  590. <xsl:call-template name="inline.charseq">
  591. <xsl:with-param name="wrapper-name">acronym</xsl:with-param>
  592. </xsl:call-template>
  593. </xsl:template>
  594. <xsl:template match="citerefentry">
  595. <xsl:choose>
  596. <xsl:when test="$citerefentry.link != '0'">
  597. <a>
  598. <xsl:apply-templates select="." mode="common.html.attributes"/>
  599. <xsl:attribute name="href">
  600. <xsl:call-template name="generate.citerefentry.link"/>
  601. </xsl:attribute>
  602. <xsl:call-template name="inline.charseq"/>
  603. </a>
  604. </xsl:when>
  605. <xsl:otherwise>
  606. <xsl:call-template name="inline.charseq"/>
  607. </xsl:otherwise>
  608. </xsl:choose>
  609. </xsl:template>
  610. <xsl:template name="generate.citerefentry.link">
  611. <!-- nop -->
  612. </xsl:template>
  613. <xsl:template name="x.generate.citerefentry.link">
  614. <xsl:text>http://example.com/cgi-bin/man.cgi?</xsl:text>
  615. <xsl:value-of select="refentrytitle"/>
  616. <xsl:text>(</xsl:text>
  617. <xsl:value-of select="manvolnum"/>
  618. <xsl:text>)</xsl:text>
  619. </xsl:template>
  620. <xsl:template match="citetitle">
  621. <xsl:choose>
  622. <xsl:when test="@pubwork = 'article'">
  623. <xsl:call-template name="gentext.startquote"/>
  624. <xsl:call-template name="inline.charseq"/>
  625. <xsl:call-template name="gentext.endquote"/>
  626. </xsl:when>
  627. <xsl:otherwise>
  628. <xsl:call-template name="inline.italicseq"/>
  629. </xsl:otherwise>
  630. </xsl:choose>
  631. </xsl:template>
  632. <xsl:template match="emphasis">
  633. <span>
  634. <xsl:call-template name="id.attribute"/>
  635. <xsl:choose>
  636. <!-- We don't want empty @class values, so do not propagate empty @roles -->
  637. <xsl:when test="@role and normalize-space(@role) != '' and $emphasis.propagates.style != 0">
  638. <xsl:apply-templates select="." mode="common.html.attributes">
  639. <xsl:with-param name="class" select="@role"/>
  640. </xsl:apply-templates>
  641. </xsl:when>
  642. <xsl:otherwise>
  643. <xsl:apply-templates select="." mode="common.html.attributes"/>
  644. </xsl:otherwise>
  645. </xsl:choose>
  646. <xsl:call-template name="anchor"/>
  647. <xsl:call-template name="simple.xlink">
  648. <xsl:with-param name="content">
  649. <xsl:choose>
  650. <xsl:when test="@role = 'bold' or @role='strong'">
  651. <!-- backwards compatibility: make bold into b elements, but -->
  652. <!-- don't put bold inside figure, example, or table titles -->
  653. <xsl:choose>
  654. <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table')">
  655. <xsl:apply-templates/>
  656. </xsl:when>
  657. <xsl:otherwise>
  658. <strong><xsl:apply-templates/></strong>
  659. </xsl:otherwise>
  660. </xsl:choose>
  661. </xsl:when>
  662. <xsl:when test="@role and $emphasis.propagates.style != 0">
  663. <xsl:apply-templates/>
  664. </xsl:when>
  665. <xsl:otherwise>
  666. <em><xsl:apply-templates/></em>
  667. </xsl:otherwise>
  668. </xsl:choose>
  669. </xsl:with-param>
  670. </xsl:call-template>
  671. </span>
  672. </xsl:template>
  673. <xsl:template match="foreignphrase">
  674. <span>
  675. <xsl:apply-templates select="." mode="common.html.attributes"/>
  676. <xsl:call-template name="inline.italicseq"/>
  677. </span>
  678. </xsl:template>
  679. <xsl:template match="markup">
  680. <xsl:call-template name="inline.charseq"/>
  681. </xsl:template>
  682. <xsl:template match="phrase">
  683. <span>
  684. <xsl:call-template name="id.attribute"/>
  685. <xsl:call-template name="locale.html.attributes"/>
  686. <!-- We don't want empty @class values, so do not propagate empty @roles -->
  687. <xsl:choose>
  688. <xsl:when test="@role and normalize-space(@role) != '' and $phrase.propagates.style != 0">
  689. <xsl:apply-templates select="." mode="class.attribute">
  690. <xsl:with-param name="class" select="@role"/>
  691. </xsl:apply-templates>
  692. </xsl:when>
  693. <xsl:otherwise>
  694. <xsl:apply-templates select="." mode="class.attribute"/>
  695. </xsl:otherwise>
  696. </xsl:choose>
  697. <xsl:call-template name="dir"/>
  698. <xsl:call-template name="anchor"/>
  699. <xsl:call-template name="simple.xlink">
  700. <xsl:with-param name="content">
  701. <xsl:apply-templates/>
  702. </xsl:with-param>
  703. </xsl:call-template>
  704. <xsl:call-template name="apply-annotations"/>
  705. </span>
  706. </xsl:template>
  707. <xsl:template match="quote">
  708. <xsl:variable name="depth">
  709. <xsl:call-template name="dot.count">
  710. <xsl:with-param name="string">
  711. <xsl:number level="multiple"/>
  712. </xsl:with-param>
  713. </xsl:call-template>
  714. </xsl:variable>
  715. <span>
  716. <xsl:apply-templates select="." mode="common.html.attributes"/>
  717. <xsl:choose>
  718. <xsl:when test="$depth mod 2 = 0">
  719. <xsl:call-template name="gentext.startquote"/>
  720. <xsl:call-template name="inline.charseq"/>
  721. <xsl:call-template name="gentext.endquote"/>
  722. </xsl:when>
  723. <xsl:otherwise>
  724. <xsl:call-template name="gentext.nestedstartquote"/>
  725. <xsl:call-template name="inline.charseq"/>
  726. <xsl:call-template name="gentext.nestedendquote"/>
  727. </xsl:otherwise>
  728. </xsl:choose>
  729. </span>
  730. </xsl:template>
  731. <xsl:template match="varname">
  732. <xsl:call-template name="inline.monoseq"/>
  733. </xsl:template>
  734. <xsl:template match="wordasword">
  735. <xsl:call-template name="inline.italicseq"/>
  736. </xsl:template>
  737. <xsl:template match="lineannotation">
  738. <em>
  739. <xsl:apply-templates select="." mode="common.html.attributes"/>
  740. <xsl:call-template name="inline.charseq"/>
  741. </em>
  742. </xsl:template>
  743. <xsl:template match="superscript">
  744. <xsl:call-template name="inline.superscriptseq"/>
  745. </xsl:template>
  746. <xsl:template match="subscript">
  747. <xsl:call-template name="inline.subscriptseq"/>
  748. </xsl:template>
  749. <xsl:template match="trademark">
  750. <xsl:call-template name="inline.charseq"/>
  751. <xsl:choose>
  752. <xsl:when test="@class = 'copyright' or @class = 'registered'">
  753. <xsl:call-template name="dingbat">
  754. <xsl:with-param name="dingbat" select="@class"/>
  755. </xsl:call-template>
  756. </xsl:when>
  757. <xsl:when test="@class = 'service'">
  758. <sup>SM</sup>
  759. </xsl:when>
  760. <xsl:otherwise>
  761. <xsl:call-template name="dingbat">
  762. <xsl:with-param name="dingbat" select="'trademark'"/>
  763. </xsl:call-template>
  764. </xsl:otherwise>
  765. </xsl:choose>
  766. </xsl:template>
  767. <xsl:template match="firstterm">
  768. <xsl:call-template name="glossterm">
  769. <xsl:with-param name="firstterm" select="1"/>
  770. </xsl:call-template>
  771. </xsl:template>
  772. <xsl:template match="glossterm" name="glossterm">
  773. <xsl:param name="firstterm" select="0"/>
  774. <!-- To avoid extra <a name=""> anchor from inline.italicseq -->
  775. <xsl:variable name="content">
  776. <xsl:apply-templates/>
  777. </xsl:variable>
  778. <xsl:choose>
  779. <xsl:when test="($firstterm.only.link = 0 or $firstterm = 1) and @linkend">
  780. <xsl:variable name="targets" select="key('id',@linkend)"/>
  781. <xsl:variable name="target" select="$targets[1]"/>
  782. <xsl:call-template name="check.id.unique">
  783. <xsl:with-param name="linkend" select="@linkend"/>
  784. </xsl:call-template>
  785. <xsl:choose>
  786. <xsl:when test="$target">
  787. <a>
  788. <xsl:apply-templates select="." mode="common.html.attributes"/>
  789. <xsl:if test="@id or @xml:id">
  790. <xsl:attribute name="id">
  791. <xsl:value-of select="(@id|@xml:id)[1]"/>
  792. </xsl:attribute>
  793. </xsl:if>
  794. <xsl:attribute name="href">
  795. <xsl:call-template name="href.target">
  796. <xsl:with-param name="object" select="$target"/>
  797. </xsl:call-template>
  798. </xsl:attribute>
  799. <xsl:call-template name="inline.italicseq">
  800. <xsl:with-param name="content" select="$content"/>
  801. </xsl:call-template>
  802. </a>
  803. </xsl:when>
  804. <xsl:otherwise>
  805. <xsl:call-template name="inline.italicseq">
  806. <xsl:with-param name="content" select="$content"/>
  807. </xsl:call-template>
  808. </xsl:otherwise>
  809. </xsl:choose>
  810. </xsl:when>
  811. <xsl:when test="not(@linkend) and ($firstterm.only.link = 0 or $firstterm = 1) and ($glossterm.auto.link != 0) and $glossary.collection != ''">
  812. <xsl:variable name="term">
  813. <xsl:choose>
  814. <xsl:when test="@baseform"><xsl:value-of select="@baseform"/></xsl:when>
  815. <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
  816. </xsl:choose>
  817. </xsl:variable>
  818. <xsl:variable name="cterm" select="(document($glossary.collection,.)//glossentry[glossterm=$term])[1]"/>
  819. <!-- HACK HACK HACK! But it works... -->
  820. <!-- You'd need to do more work if you wanted to chunk on glossdiv, though -->
  821. <xsl:variable name="glossary" select="//glossary[@role='auto']"/>
  822. <xsl:if test="count($glossary) != 1">
  823. <xsl:message>
  824. <xsl:text>Warning: glossary.collection specified, but there are </xsl:text>
  825. <xsl:value-of select="count($glossary)"/>
  826. <xsl:text> automatic glossaries</xsl:text>
  827. </xsl:message>
  828. </xsl:if>
  829. <xsl:variable name="glosschunk">
  830. <xsl:call-template name="href.target">
  831. <xsl:with-param name="object" select="$glossary"/>
  832. </xsl:call-template>
  833. </xsl:variable>
  834. <xsl:variable name="chunkbase">
  835. <xsl:choose>
  836. <xsl:when test="contains($glosschunk, '#')">
  837. <xsl:value-of select="substring-before($glosschunk, '#')"/>
  838. </xsl:when>
  839. <xsl:otherwise>
  840. <xsl:value-of select="$glosschunk"/>
  841. </xsl:otherwise>
  842. </xsl:choose>
  843. </xsl:variable>
  844. <xsl:choose>
  845. <xsl:when test="not($cterm)">
  846. <xsl:message>
  847. <xsl:text>There's no entry for </xsl:text>
  848. <xsl:value-of select="$term"/>
  849. <xsl:text> in </xsl:text>
  850. <xsl:value-of select="$glossary.collection"/>
  851. </xsl:message>
  852. <xsl:call-template name="inline.italicseq"/>
  853. </xsl:when>
  854. <xsl:otherwise>
  855. <xsl:variable name="id">
  856. <xsl:call-template name="object.id">
  857. <xsl:with-param name="object" select="$cterm"/>
  858. </xsl:call-template>
  859. </xsl:variable>
  860. <a href="{$chunkbase}#{$id}">
  861. <xsl:apply-templates select="." mode="common.html.attributes"/>
  862. <xsl:call-template name="inline.italicseq">
  863. <xsl:with-param name="content" select="$content"/>
  864. </xsl:call-template>
  865. </a>
  866. </xsl:otherwise>
  867. </xsl:choose>
  868. </xsl:when>
  869. <xsl:when test="not(@linkend) and ($firstterm.only.link = 0 or $firstterm = 1) and $glossterm.auto.link != 0">
  870. <xsl:variable name="term">
  871. <xsl:choose>
  872. <xsl:when test="@baseform">
  873. <xsl:value-of select="normalize-space(@baseform)"/>
  874. </xsl:when>
  875. <xsl:otherwise>
  876. <xsl:value-of select="normalize-space(.)"/>
  877. </xsl:otherwise>
  878. </xsl:choose>
  879. </xsl:variable>
  880. <xsl:variable name="targets" select="key('glossentries', $term)"/>
  881. <xsl:variable name="target" select="$targets[1]"/>
  882. <xsl:choose>
  883. <xsl:when test="count($targets)=0">
  884. <xsl:message>
  885. <xsl:text>Error: no glossentry for glossterm: </xsl:text>
  886. <xsl:value-of select="."/>
  887. <xsl:text>.</xsl:text>
  888. </xsl:message>
  889. <xsl:call-template name="inline.italicseq"/>
  890. </xsl:when>
  891. <xsl:otherwise>
  892. <a>
  893. <xsl:apply-templates select="." mode="common.html.attributes"/>
  894. <xsl:if test="@id or @xml:id">
  895. <xsl:attribute name="id">
  896. <xsl:value-of select="(@id|@xml:id)[1]"/>
  897. </xsl:attribute>
  898. </xsl:if>
  899. <xsl:attribute name="href">
  900. <xsl:call-template name="href.target">
  901. <xsl:with-param name="object" select="$target"/>
  902. </xsl:call-template>
  903. </xsl:attribute>
  904. <xsl:call-template name="inline.italicseq">
  905. <xsl:with-param name="content" select="$content"/>
  906. </xsl:call-template>
  907. </a>
  908. </xsl:otherwise>
  909. </xsl:choose>
  910. </xsl:when>
  911. <xsl:otherwise>
  912. <xsl:call-template name="inline.italicseq"/>
  913. </xsl:otherwise>
  914. </xsl:choose>
  915. </xsl:template>
  916. <xsl:template match="termdef">
  917. <span>
  918. <xsl:apply-templates select="." mode="common.html.attributes"/>
  919. <xsl:call-template name="gentext.template">
  920. <xsl:with-param name="context" select="'termdef'"/>
  921. <xsl:with-param name="name" select="'prefix'"/>
  922. </xsl:call-template>
  923. <xsl:apply-templates/>
  924. <xsl:call-template name="gentext.template">
  925. <xsl:with-param name="context" select="'termdef'"/>
  926. <xsl:with-param name="name" select="'suffix'"/>
  927. </xsl:call-template>
  928. </span>
  929. </xsl:template>
  930. <xsl:template match="sgmltag|tag">
  931. <xsl:call-template name="format.sgmltag"/>
  932. </xsl:template>
  933. <xsl:template name="format.sgmltag">
  934. <xsl:param name="class">
  935. <xsl:choose>
  936. <xsl:when test="@class">
  937. <xsl:value-of select="@class"/>
  938. </xsl:when>
  939. <xsl:otherwise>element</xsl:otherwise>
  940. </xsl:choose>
  941. </xsl:param>
  942. <xsl:variable name="content">
  943. <xsl:choose>
  944. <xsl:when test="$class='attribute'">
  945. <xsl:apply-templates/>
  946. </xsl:when>
  947. <xsl:when test="$class='attvalue'">
  948. <xsl:apply-templates/>
  949. </xsl:when>
  950. <xsl:when test="$class='element'">
  951. <xsl:apply-templates/>
  952. </xsl:when>
  953. <xsl:when test="$class='endtag'">
  954. <xsl:text>&lt;/</xsl:text>
  955. <xsl:apply-templates/>
  956. <xsl:text>&gt;</xsl:text>
  957. </xsl:when>
  958. <xsl:when test="$class='genentity'">
  959. <xsl:text>&amp;</xsl:text>
  960. <xsl:apply-templates/>
  961. <xsl:text>;</xsl:text>
  962. </xsl:when>
  963. <xsl:when test="$class='numcharref'">
  964. <xsl:text>&amp;#</xsl:text>
  965. <xsl:apply-templates/>
  966. <xsl:text>;</xsl:text>
  967. </xsl:when>
  968. <xsl:when test="$class='paramentity'">
  969. <xsl:text>%</xsl:text>
  970. <xsl:apply-templates/>
  971. <xsl:text>;</xsl:text>
  972. </xsl:when>
  973. <xsl:when test="$class='pi'">
  974. <xsl:text>&lt;?</xsl:text>
  975. <xsl:apply-templates/>
  976. <xsl:text>&gt;</xsl:text>
  977. </xsl:when>
  978. <xsl:when test="$class='xmlpi'">
  979. <xsl:text>&lt;?</xsl:text>
  980. <xsl:apply-templates/>
  981. <xsl:text>?&gt;</xsl:text>
  982. </xsl:when>
  983. <xsl:when test="$class='starttag'">
  984. <xsl:text>&lt;</xsl:text>
  985. <xsl:apply-templates/>
  986. <xsl:text>&gt;</xsl:text>
  987. </xsl:when>
  988. <xsl:when test="$class='emptytag'">
  989. <xsl:text>&lt;</xsl:text>
  990. <xsl:apply-templates/>
  991. <xsl:text>/&gt;</xsl:text>
  992. </xsl:when>
  993. <xsl:when test="$class='sgmlcomment' or $class='comment'">
  994. <xsl:text>&lt;!--</xsl:text>
  995. <xsl:apply-templates/>
  996. <xsl:text>--&gt;</xsl:text>
  997. </xsl:when>
  998. <xsl:otherwise>
  999. <xsl:apply-templates/>
  1000. </xsl:otherwise>
  1001. </xsl:choose>
  1002. </xsl:variable>
  1003. <code>
  1004. <xsl:apply-templates select="." mode="common.html.attributes">
  1005. <xsl:with-param name="class" select="concat('sgmltag-', $class)"/>
  1006. </xsl:apply-templates>
  1007. <xsl:call-template name="simple.xlink">
  1008. <xsl:with-param name="content" select="$content"/>
  1009. </xsl:call-template>
  1010. </code>
  1011. </xsl:template>
  1012. <xsl:template match="email">
  1013. <xsl:call-template name="inline.monoseq">
  1014. <xsl:with-param name="content">
  1015. <xsl:if test="not($email.delimiters.enabled = 0)">
  1016. <xsl:text>&lt;</xsl:text>
  1017. </xsl:if>
  1018. <a>
  1019. <xsl:apply-templates select="." mode="common.html.attributes"/>
  1020. <xsl:call-template name="id.attribute"/>
  1021. <xsl:attribute name="href">
  1022. <xsl:text>mailto:</xsl:text>
  1023. <xsl:value-of select="."/>
  1024. </xsl:attribute>
  1025. <xsl:apply-templates/>
  1026. </a>
  1027. <xsl:if test="not($email.delimiters.enabled = 0)">
  1028. <xsl:text>&gt;</xsl:text>
  1029. </xsl:if>
  1030. </xsl:with-param>
  1031. </xsl:call-template>
  1032. </xsl:template>
  1033. <xsl:template match="keycombo">
  1034. <xsl:variable name="action" select="@action"/>
  1035. <xsl:variable name="joinchar">
  1036. <xsl:choose>
  1037. <xsl:when test="$action='seq'"><xsl:text> </xsl:text></xsl:when>
  1038. <xsl:when test="$action='simul'">+</xsl:when>
  1039. <xsl:when test="$action='press'">-</xsl:when>
  1040. <xsl:when test="$action='click'">-</xsl:when>
  1041. <xsl:when test="$action='double-click'">-</xsl:when>
  1042. <xsl:when test="$action='other'"/>
  1043. <xsl:otherwise>+</xsl:otherwise>
  1044. </xsl:choose>
  1045. </xsl:variable>
  1046. <xsl:for-each select="*">
  1047. <xsl:if test="position()&gt;1"><xsl:value-of select="$joinchar"/></xsl:if>
  1048. <xsl:apply-templates select="."/>
  1049. </xsl:for-each>
  1050. </xsl:template>
  1051. <xsl:template match="uri">
  1052. <xsl:call-template name="inline.monoseq"/>
  1053. </xsl:template>
  1054. <!-- ==================================================================== -->
  1055. <xsl:template match="menuchoice">
  1056. <xsl:variable name="shortcut" select="./shortcut"/>
  1057. <xsl:call-template name="process.menuchoice"/>
  1058. <xsl:if test="$shortcut">
  1059. <xsl:text> (</xsl:text>
  1060. <xsl:apply-templates select="$shortcut"/>
  1061. <xsl:text>)</xsl:text>
  1062. </xsl:if>
  1063. </xsl:template>
  1064. <xsl:template name="process.menuchoice">
  1065. <xsl:param name="nodelist" select="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface"/><!-- not(shortcut) -->
  1066. <xsl:param name="count" select="1"/>
  1067. <xsl:choose>
  1068. <xsl:when test="$count&gt;count($nodelist)"/>
  1069. <xsl:when test="$count=1">
  1070. <xsl:apply-templates select="$nodelist[$count=position()]"/>
  1071. <xsl:call-template name="process.menuchoice">
  1072. <xsl:with-param name="nodelist" select="$nodelist"/>
  1073. <xsl:with-param name="count" select="$count+1"/>
  1074. </xsl:call-template>
  1075. </xsl:when>
  1076. <xsl:otherwise>
  1077. <xsl:variable name="node" select="$nodelist[$count=position()]"/>
  1078. <xsl:choose>
  1079. <xsl:when test="local-name($node)='guimenuitem' or local-name($node)='guisubmenu'">
  1080. <xsl:value-of select="$menuchoice.menu.separator"/>
  1081. </xsl:when>
  1082. <xsl:otherwise>
  1083. <xsl:value-of select="$menuchoice.separator"/>
  1084. </xsl:otherwise>
  1085. </xsl:choose>
  1086. <xsl:apply-templates select="$node"/>
  1087. <xsl:call-template name="process.menuchoice">
  1088. <xsl:with-param name="nodelist" select="$nodelist"/>
  1089. <xsl:with-param name="count" select="$count+1"/>
  1090. </xsl:call-template>
  1091. </xsl:otherwise>
  1092. </xsl:choose>
  1093. </xsl:template>
  1094. <!-- ==================================================================== -->
  1095. <xsl:template match="optional">
  1096. <xsl:value-of select="$arg.choice.opt.open.str"/>
  1097. <xsl:call-template name="inline.charseq"/>
  1098. <xsl:value-of select="$arg.choice.opt.close.str"/>
  1099. </xsl:template>
  1100. <xsl:template match="citation">
  1101. <!-- todo: integrate with bibliography collection -->
  1102. <xsl:variable name="targets" select="(//biblioentry | //bibliomixed)[abbrev = string(current())]"/>
  1103. <xsl:variable name="target" select="$targets[1]"/>
  1104. <xsl:choose>
  1105. <!-- try automatic linking based on match to abbrev -->
  1106. <xsl:when test="$target and not(xref) and not(link)">
  1107. <xsl:text>[</xsl:text>
  1108. <a>
  1109. <xsl:apply-templates select="." mode="common.html.attributes"/>
  1110. <xsl:attribute name="href">
  1111. <xsl:call-template name="href.target">
  1112. <xsl:with-param name="object" select="$target"/>
  1113. </xsl:call-template>
  1114. </xsl:attribute>
  1115. <xsl:choose>
  1116. <xsl:when test="$bibliography.numbered != 0">
  1117. <xsl:call-template name="id.attribute"/>
  1118. <xsl:apply-templates select="$target" mode="citation"/>
  1119. </xsl:when>
  1120. <xsl:otherwise>
  1121. <xsl:call-template name="inline.charseq"/>
  1122. </xsl:otherwise>
  1123. </xsl:choose>
  1124. </a>
  1125. <xsl:text>]</xsl:text>
  1126. </xsl:when>
  1127. <xsl:otherwise>
  1128. <xsl:text>[</xsl:text>
  1129. <xsl:call-template name="inline.charseq"/>
  1130. <xsl:text>]</xsl:text>
  1131. </xsl:otherwise>
  1132. </xsl:choose>
  1133. </xsl:template>
  1134. <xsl:template match="citebiblioid">
  1135. <xsl:variable name="targets" select="//*[biblioid = string(current())]"/>
  1136. <xsl:variable name="target" select="$targets[1]"/>
  1137. <xsl:choose>
  1138. <!-- try automatic linking based on match to parent of biblioid -->
  1139. <xsl:when test="$target and not(xref) and not(link)">
  1140. <xsl:text>[</xsl:text>
  1141. <a>
  1142. <xsl:apply-templates select="." mode="common.html.attributes"/>
  1143. <xsl:attribute name="href">
  1144. <xsl:call-template name="href.target">
  1145. <xsl:with-param name="object" select="$target"/>
  1146. </xsl:call-template>
  1147. </xsl:attribute>
  1148. <xsl:call-template name="inline.charseq"/>
  1149. </a>
  1150. <xsl:text>]</xsl:text>
  1151. </xsl:when>
  1152. <xsl:otherwise>
  1153. <xsl:text>[</xsl:text>
  1154. <xsl:call-template name="inline.charseq"/>
  1155. <xsl:text>]</xsl:text>
  1156. </xsl:otherwise>
  1157. </xsl:choose>
  1158. </xsl:template>
  1159. <xsl:template match="biblioentry|bibliomixed" mode="citation">
  1160. <xsl:number from="bibliography" count="biblioentry|bibliomixed" level="any" format="1"/>
  1161. </xsl:template>
  1162. <!-- ==================================================================== -->
  1163. <xsl:template match="comment[parent::answer|parent::appendix|parent::article|parent::bibliodiv| parent::bibliography|parent::blockquote|parent::caution|parent::chapter| parent::glossary|parent::glossdiv|parent::important|parent::index| parent::indexdiv|parent::listitem|parent::note|parent::orderedlist| parent::partintro|parent::preface|parent::procedure|parent::qandadiv| parent::qandaset|parent::question|parent::refentry|parent::refnamediv| parent::refsect1|parent::refsect2|parent::refsect3|parent::refsection| parent::refsynopsisdiv|parent::sect1|parent::sect2|parent::sect3|parent::sect4| parent::sect5|parent::section|parent::setindex|parent::sidebar| parent::simplesect|parent::taskprerequisites|parent::taskrelated| parent::tasksummary|parent::warning|parent::topic]|remark[parent::answer|parent::appendix|parent::article|parent::bibliodiv| parent::bibliography|parent::blockquote|parent::caution|parent::chapter| parent::glossary|parent::glossdiv|parent::important|parent::index| parent::indexdiv|parent::listitem|parent::note|parent::orderedlist| parent::partintro|parent::preface|parent::procedure|parent::qandadiv| parent::qandaset|parent::question|parent::refentry|parent::refnamediv| parent::refsect1|parent::refsect2|parent::refsect3|parent::refsection| parent::refsynopsisdiv|parent::sect1|parent::sect2|parent::sect3|parent::sect4| parent::sect5|parent::section|parent::setindex|parent::sidebar| parent::simplesect|parent::taskprerequisites|parent::taskrelated| parent::tasksummary|parent::warning|parent::topic]">
  1164. <xsl:if test="$show.comments != 0">
  1165. <p class="remark"><em><xsl:call-template name="inline.charseq"/></em></p>
  1166. </xsl:if>
  1167. </xsl:template>
  1168. <xsl:template match="comment|remark">
  1169. <xsl:if test="$show.comments != 0">
  1170. <em><xsl:call-template name="inline.charseq"/></em>
  1171. </xsl:if>
  1172. </xsl:template>
  1173. <!-- ==================================================================== -->
  1174. <xsl:template match="productname">
  1175. <xsl:call-template name="inline.charseq"/>
  1176. <xsl:if test="@class">
  1177. <xsl:call-template name="dingbat">
  1178. <xsl:with-param name="dingbat" select="@class"/>
  1179. </xsl:call-template>
  1180. </xsl:if>
  1181. </xsl:template>
  1182. <xsl:template match="productnumber">
  1183. <xsl:call-template name="inline.charseq"/>
  1184. </xsl:template>
  1185. <!-- ==================================================================== -->
  1186. <xsl:template match="pob|street|city|state|postcode|country|otheraddr">
  1187. <xsl:call-template name="inline.charseq"/>
  1188. </xsl:template>
  1189. <xsl:template match="phone|fax">
  1190. <xsl:call-template name="inline.charseq"/>
  1191. </xsl:template>
  1192. <!-- in Addresses, for example -->
  1193. <xsl:template match="honorific|firstname|surname|lineage|othername">
  1194. <xsl:call-template name="inline.charseq"/>
  1195. </xsl:template>
  1196. <!-- ==================================================================== -->
  1197. <xsl:template match="person">
  1198. <xsl:param name="content">
  1199. <xsl:call-template name="anchor"/>
  1200. <xsl:call-template name="simple.xlink">
  1201. <xsl:with-param name="content">
  1202. <xsl:apply-templates select="personname"/>
  1203. </xsl:with-param>
  1204. </xsl:call-template>
  1205. <xsl:call-template name="apply-annotations"/>
  1206. </xsl:param>
  1207. <span>
  1208. <xsl:apply-templates select="." mode="common.html.attributes"/>
  1209. <xsl:call-template name="id.attribute"/>
  1210. <xsl:copy-of select="$content"/>
  1211. </span>
  1212. </xsl:template>
  1213. <xsl:template match="personname">
  1214. <xsl:param name="content">
  1215. <xsl:call-template name="anchor"/>
  1216. <xsl:call-template name="simple.xlink">
  1217. <xsl:with-param name="content">
  1218. <xsl:call-template name="person.name"/>
  1219. </xsl:with-param>
  1220. </xsl:call-template>
  1221. <xsl:call-template name="apply-annotations"/>
  1222. </xsl:param>
  1223. <span>
  1224. <xsl:apply-templates select="." mode="common.html.attributes"/>
  1225. <xsl:call-template name="id.attribute"/>
  1226. <xsl:copy-of select="$content"/>
  1227. </span>
  1228. </xsl:template>
  1229. <!-- ==================================================================== -->
  1230. <xsl:template match="org">
  1231. <xsl:param name="content">
  1232. <xsl:call-template name="anchor"/>
  1233. <xsl:call-template name="simple.xlink">
  1234. <xsl:with-param name="content">
  1235. <xsl:apply-templates/>
  1236. </xsl:with-param>
  1237. </xsl:call-template>
  1238. <xsl:call-template name="apply-annotations"/>
  1239. </xsl:param>
  1240. <span>
  1241. <xsl:apply-templates select="." mode="common.html.attributes"/>
  1242. <xsl:call-template name="id.attribute"/>
  1243. <xsl:copy-of select="$content"/>
  1244. </span>
  1245. </xsl:template>
  1246. <xsl:template match="orgname">
  1247. <xsl:param name="content">
  1248. <xsl:call-template name="anchor"/>
  1249. <xsl:call-template name="simple.xlink">
  1250. <xsl:with-param name="content">
  1251. <xsl:apply-templates/>
  1252. </xsl:with-param>
  1253. </xsl:call-template>
  1254. <xsl:call-template name="apply-annotations"/>
  1255. </xsl:param>
  1256. <span>
  1257. <xsl:apply-templates select="." mode="common.html.attributes"/>
  1258. <xsl:call-template name="id.attribute"/>
  1259. <xsl:copy-of select="$content"/>
  1260. </span>
  1261. </xsl:template>
  1262. <xsl:template match="orgdiv">
  1263. <xsl:param name="content">
  1264. <xsl:call-template name="anchor"/>
  1265. <xsl:call-template name="simple.xlink">
  1266. <xsl:with-param name="content">
  1267. <xsl:apply-templates/>
  1268. </xsl:with-param>
  1269. </xsl:call-template>
  1270. <xsl:call-template name="apply-annotations"/>
  1271. </xsl:param>
  1272. <span>
  1273. <xsl:apply-templates select="." mode="common.html.attributes"/>
  1274. <xsl:copy-of select="$content"/>
  1275. </span>
  1276. </xsl:template>
  1277. <xsl:template match="affiliation">
  1278. <xsl:param name="content">
  1279. <xsl:call-template name="anchor"/>
  1280. <xsl:call-template name="simple.xlink">
  1281. <xsl:with-param name="content">
  1282. <xsl:call-template name="person.name"/>
  1283. </xsl:with-param>
  1284. </xsl:call-template>
  1285. <xsl:call-template name="apply-annotations"/>
  1286. </xsl:param>
  1287. <span>
  1288. <xsl:apply-templates select="." mode="common.html.attributes"/>
  1289. <xsl:call-template name="id.attribute"/>
  1290. <xsl:copy-of select="$content"/>
  1291. </span>
  1292. </xsl:template>
  1293. <!-- ==================================================================== -->
  1294. <xsl:template match="beginpage">
  1295. <!-- does nothing; this *is not* markup to force a page break. -->
  1296. </xsl:template>
  1297. </xsl:stylesheet>