block.xsl 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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="http://www.w3.org/1999/xhtml" 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. <!-- ==================================================================== -->
  13. <!-- What should we do about styling blockinfo? -->
  14. <xsl:template match="blockinfo|info">
  15. <!-- suppress -->
  16. </xsl:template>
  17. <!-- ==================================================================== -->
  18. <xsl:template name="block.object">
  19. <div>
  20. <xsl:apply-templates select="." mode="class.attribute"/>
  21. <xsl:call-template name="anchor"/>
  22. <xsl:apply-templates/>
  23. </div>
  24. </xsl:template>
  25. <!-- ==================================================================== -->
  26. <xsl:template match="para">
  27. <xsl:call-template name="paragraph">
  28. <xsl:with-param name="class">
  29. <xsl:if test="@role and $para.propagates.style != 0">
  30. <xsl:value-of select="@role"/>
  31. </xsl:if>
  32. </xsl:with-param>
  33. <xsl:with-param name="content">
  34. <xsl:if test="position() = 1 and parent::listitem">
  35. <xsl:call-template name="anchor">
  36. <xsl:with-param name="node" select="parent::listitem"/>
  37. </xsl:call-template>
  38. </xsl:if>
  39. <xsl:call-template name="anchor"/>
  40. <xsl:apply-templates/>
  41. </xsl:with-param>
  42. </xsl:call-template>
  43. </xsl:template>
  44. <xsl:template name="paragraph">
  45. <xsl:param name="class" select="''"/>
  46. <xsl:param name="content"/>
  47. <xsl:variable name="p">
  48. <p>
  49. <xsl:call-template name="dir"/>
  50. <xsl:if test="$class != ''">
  51. <xsl:apply-templates select="." mode="class.attribute">
  52. <xsl:with-param name="class" select="$class"/>
  53. </xsl:apply-templates>
  54. </xsl:if>
  55. <xsl:copy-of select="$content"/>
  56. </p>
  57. </xsl:variable>
  58. <xsl:choose>
  59. <xsl:when test="$html.cleanup != 0">
  60. <xsl:call-template name="unwrap.p">
  61. <xsl:with-param name="p" select="$p"/>
  62. </xsl:call-template>
  63. </xsl:when>
  64. <xsl:otherwise>
  65. <xsl:copy-of select="$p"/>
  66. </xsl:otherwise>
  67. </xsl:choose>
  68. </xsl:template>
  69. <xsl:template match="simpara">
  70. <!-- see also listitem/simpara in lists.xsl -->
  71. <p>
  72. <xsl:if test="@role and $para.propagates.style != 0">
  73. <xsl:apply-templates select="." mode="class.attribute">
  74. <xsl:with-param name="class" select="@role"/>
  75. </xsl:apply-templates>
  76. </xsl:if>
  77. <xsl:call-template name="anchor"/>
  78. <xsl:apply-templates/>
  79. </p>
  80. </xsl:template>
  81. <xsl:template match="formalpara">
  82. <xsl:call-template name="paragraph">
  83. <xsl:with-param name="class">
  84. <xsl:if test="@role and $para.propagates.style != 0">
  85. <xsl:value-of select="@role"/>
  86. </xsl:if>
  87. </xsl:with-param>
  88. <xsl:with-param name="content">
  89. <xsl:call-template name="anchor"/>
  90. <xsl:apply-templates/>
  91. </xsl:with-param>
  92. </xsl:call-template>
  93. </xsl:template>
  94. <!-- Only use title from info -->
  95. <xsl:template match="formalpara/info">
  96. <xsl:apply-templates select="title"/>
  97. </xsl:template>
  98. <xsl:template match="formalpara/title|formalpara/info/title">
  99. <xsl:variable name="titleStr">
  100. <xsl:apply-templates/>
  101. </xsl:variable>
  102. <xsl:variable name="lastChar">
  103. <xsl:if test="$titleStr != ''">
  104. <xsl:value-of select="substring($titleStr,string-length($titleStr),1)"/>
  105. </xsl:if>
  106. </xsl:variable>
  107. <b>
  108. <xsl:copy-of select="$titleStr"/>
  109. <xsl:if test="$lastChar != '' and not(contains($runinhead.title.end.punct, $lastChar))">
  110. <xsl:value-of select="$runinhead.default.title.end.punct"/>
  111. </xsl:if>
  112. <xsl:text>&#160;</xsl:text>
  113. </b>
  114. </xsl:template>
  115. <xsl:template match="formalpara/para">
  116. <xsl:apply-templates/>
  117. </xsl:template>
  118. <!-- ==================================================================== -->
  119. <xsl:template match="blockquote">
  120. <div>
  121. <xsl:apply-templates select="." mode="class.attribute"/>
  122. <xsl:if test="@lang or @xml:lang">
  123. <xsl:call-template name="language.attribute"/>
  124. </xsl:if>
  125. <xsl:call-template name="anchor"/>
  126. <xsl:choose>
  127. <xsl:when test="attribution">
  128. <table border="0" width="100%" cellspacing="0" cellpadding="0" class="blockquote" summary="Block quote">
  129. <tr>
  130. <td width="10%" valign="top">&#160;</td>
  131. <td width="80%" valign="top">
  132. <xsl:apply-templates select="child::*[local-name(.)!='attribution']"/>
  133. </td>
  134. <td width="10%" valign="top">&#160;</td>
  135. </tr>
  136. <tr>
  137. <td width="10%" valign="top">&#160;</td>
  138. <td colspan="2" align="right" valign="top">
  139. <xsl:text>--</xsl:text>
  140. <xsl:apply-templates select="attribution"/>
  141. </td>
  142. </tr>
  143. </table>
  144. </xsl:when>
  145. <xsl:otherwise>
  146. <blockquote>
  147. <xsl:apply-templates select="." mode="class.attribute"/>
  148. <xsl:apply-templates/>
  149. </blockquote>
  150. </xsl:otherwise>
  151. </xsl:choose>
  152. </div>
  153. </xsl:template>
  154. <xsl:template match="blockquote/title|blockquote/info/title">
  155. <div class="blockquote-title">
  156. <p>
  157. <b>
  158. <xsl:apply-templates/>
  159. </b>
  160. </p>
  161. </div>
  162. </xsl:template>
  163. <xsl:template match="epigraph">
  164. <div>
  165. <xsl:apply-templates select="." mode="class.attribute"/>
  166. <xsl:apply-templates select="para|simpara|formalpara|literallayout"/>
  167. <xsl:if test="attribution">
  168. <div class="attribution">
  169. <span>--<xsl:apply-templates select="attribution"/></span>
  170. </div>
  171. </xsl:if>
  172. </div>
  173. </xsl:template>
  174. <xsl:template match="attribution">
  175. <span>
  176. <xsl:apply-templates select="." mode="class.attribute"/>
  177. <xsl:apply-templates/>
  178. </span>
  179. </xsl:template>
  180. <!-- ==================================================================== -->
  181. <xsl:template match="abstract|sidebar">
  182. <div>
  183. <xsl:apply-templates select="." mode="class.attribute"/>
  184. <xsl:call-template name="anchor"/>
  185. <xsl:call-template name="formal.object.heading">
  186. <xsl:with-param name="title">
  187. <xsl:apply-templates select="." mode="title.markup">
  188. <xsl:with-param name="allow-anchors" select="'1'"/>
  189. </xsl:apply-templates>
  190. </xsl:with-param>
  191. </xsl:call-template>
  192. <xsl:apply-templates/>
  193. </div>
  194. </xsl:template>
  195. <xsl:template match="abstract/title|sidebar/title">
  196. </xsl:template>
  197. <xsl:template match="sidebar/sidebarinfo|sidebar/info"/>
  198. <!-- ==================================================================== -->
  199. <xsl:template match="msgset">
  200. <xsl:apply-templates/>
  201. </xsl:template>
  202. <xsl:template match="msgentry">
  203. <xsl:call-template name="block.object"/>
  204. </xsl:template>
  205. <xsl:template match="simplemsgentry">
  206. <xsl:call-template name="block.object"/>
  207. </xsl:template>
  208. <xsl:template match="msg">
  209. <xsl:call-template name="block.object"/>
  210. </xsl:template>
  211. <xsl:template match="msgmain">
  212. <xsl:apply-templates/>
  213. </xsl:template>
  214. <xsl:template match="msgmain/title">
  215. <b><xsl:apply-templates/></b>
  216. </xsl:template>
  217. <xsl:template match="msgsub">
  218. <xsl:apply-templates/>
  219. </xsl:template>
  220. <xsl:template match="msgsub/title">
  221. <b><xsl:apply-templates/></b>
  222. </xsl:template>
  223. <xsl:template match="msgrel">
  224. <xsl:apply-templates/>
  225. </xsl:template>
  226. <xsl:template match="msgrel/title">
  227. <b><xsl:apply-templates/></b>
  228. </xsl:template>
  229. <xsl:template match="msgtext">
  230. <xsl:apply-templates/>
  231. </xsl:template>
  232. <xsl:template match="msginfo">
  233. <xsl:call-template name="block.object"/>
  234. </xsl:template>
  235. <xsl:template match="msglevel">
  236. <p>
  237. <b>
  238. <xsl:call-template name="gentext.template">
  239. <xsl:with-param name="context" select="'msgset'"/>
  240. <xsl:with-param name="name" select="'MsgLevel'"/>
  241. </xsl:call-template>
  242. </b>
  243. <xsl:apply-templates/>
  244. </p>
  245. </xsl:template>
  246. <xsl:template match="msgorig">
  247. <p>
  248. <b>
  249. <xsl:call-template name="gentext.template">
  250. <xsl:with-param name="context" select="'msgset'"/>
  251. <xsl:with-param name="name" select="'MsgOrig'"/>
  252. </xsl:call-template>
  253. </b>
  254. <xsl:apply-templates/>
  255. </p>
  256. </xsl:template>
  257. <xsl:template match="msgaud">
  258. <p>
  259. <b>
  260. <xsl:call-template name="gentext.template">
  261. <xsl:with-param name="context" select="'msgset'"/>
  262. <xsl:with-param name="name" select="'MsgAud'"/>
  263. </xsl:call-template>
  264. </b>
  265. <xsl:apply-templates/>
  266. </p>
  267. </xsl:template>
  268. <xsl:template match="msgexplan">
  269. <xsl:call-template name="block.object"/>
  270. </xsl:template>
  271. <xsl:template match="msgexplan/title">
  272. <p><b><xsl:apply-templates/></b></p>
  273. </xsl:template>
  274. <!-- ==================================================================== -->
  275. <xsl:template match="revhistory">
  276. <div>
  277. <xsl:apply-templates select="." mode="class.attribute"/>
  278. <table border="0" width="100%" summary="Revision history">
  279. <tr>
  280. <th align="left" valign="top" colspan="3">
  281. <b>
  282. <xsl:call-template name="gentext">
  283. <xsl:with-param name="key" select="'RevHistory'"/>
  284. </xsl:call-template>
  285. </b>
  286. </th>
  287. </tr>
  288. <xsl:apply-templates/>
  289. </table>
  290. </div>
  291. </xsl:template>
  292. <xsl:template match="revhistory/revision">
  293. <xsl:variable name="revnumber" select="revnumber"/>
  294. <xsl:variable name="revdate" select="date"/>
  295. <xsl:variable name="revauthor" select="authorinitials|author"/>
  296. <xsl:variable name="revremark" select="revremark|revdescription"/>
  297. <tr>
  298. <td align="left">
  299. <xsl:if test="$revnumber">
  300. <xsl:call-template name="gentext">
  301. <xsl:with-param name="key" select="'Revision'"/>
  302. </xsl:call-template>
  303. <xsl:call-template name="gentext.space"/>
  304. <xsl:apply-templates select="$revnumber"/>
  305. </xsl:if>
  306. </td>
  307. <td align="left">
  308. <xsl:apply-templates select="$revdate"/>
  309. </td>
  310. <xsl:choose>
  311. <xsl:when test="count($revauthor)=0">
  312. <td align="left">
  313. <xsl:call-template name="dingbat">
  314. <xsl:with-param name="dingbat">nbsp</xsl:with-param>
  315. </xsl:call-template>
  316. </td>
  317. </xsl:when>
  318. <xsl:otherwise>
  319. <td align="left">
  320. <xsl:for-each select="$revauthor">
  321. <xsl:apply-templates select="."/>
  322. <xsl:if test="position() != last()">
  323. <xsl:text>, </xsl:text>
  324. </xsl:if>
  325. </xsl:for-each>
  326. </td>
  327. </xsl:otherwise>
  328. </xsl:choose>
  329. </tr>
  330. <xsl:if test="$revremark">
  331. <tr>
  332. <td align="left" colspan="3">
  333. <xsl:apply-templates select="$revremark"/>
  334. </td>
  335. </tr>
  336. </xsl:if>
  337. </xsl:template>
  338. <xsl:template match="revision/revnumber">
  339. <xsl:apply-templates/>
  340. </xsl:template>
  341. <xsl:template match="revision/date">
  342. <xsl:apply-templates/>
  343. </xsl:template>
  344. <xsl:template match="revision/authorinitials">
  345. <xsl:text>, </xsl:text>
  346. <xsl:apply-templates/>
  347. </xsl:template>
  348. <xsl:template match="revision/authorinitials[1]" priority="2">
  349. <xsl:apply-templates/>
  350. </xsl:template>
  351. <xsl:template match="revision/revremark">
  352. <xsl:apply-templates/>
  353. </xsl:template>
  354. <xsl:template match="revision/revdescription">
  355. <xsl:apply-templates/>
  356. </xsl:template>
  357. <!-- ==================================================================== -->
  358. <xsl:template match="ackno">
  359. <p>
  360. <xsl:apply-templates select="." mode="class.attribute"/>
  361. <xsl:apply-templates/>
  362. </p>
  363. </xsl:template>
  364. <!-- ==================================================================== -->
  365. <xsl:template match="highlights">
  366. <xsl:call-template name="block.object"/>
  367. </xsl:template>
  368. <!-- ==================================================================== -->
  369. </xsl:stylesheet>