inline.xsl 45 KB

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