inline.xsl 50 KB

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