inline.xsl 45 KB

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