inline.xsl 45 KB

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