inline.xsl 41 KB

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