No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep.xsl 48KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!--
  3. Copyright (c) 1999 - 2017 XMPP Standards Foundation
  4. Permission is hereby granted, free of charge, to any
  5. person obtaining a copy of this software and
  6. associated documentation files (the "Software"), to
  7. deal in the Software without restriction, including
  8. without limitation the rights to use, copy, modify,
  9. merge, publish, distribute, sublicense, and/or sell
  10. copies of the Software, and to permit persons to whom
  11. the Software is furnished to do so, subject to the
  12. following conditions:
  13. The above copyright notice and this permission notice
  14. shall be included in all copies or substantial portions
  15. of the Software.
  16. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
  17. ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  18. TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  19. PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
  20. SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
  21. ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  22. ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
  24. OR OTHER DEALINGS IN THE SOFTWARE.
  25. -->
  26. <!-- Authors: stpeter and temas -->
  27. <xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
  28. <xsl:output doctype-public='-//W3C//DTD XHTML 1.0 Transitional//EN' doctype-system='http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd' method='xml'/>
  29. <xsl:template match='/'>
  30. <html>
  31. <head>
  32. <title>XEP-<xsl:value-of select='/xep/header/number'/>:<xsl:text> </xsl:text><xsl:value-of select='/xep/header/title' /></title>
  33. <link rel='stylesheet' type='text/css' href='xmpp.css' />
  34. <link href="prettify.css" type="text/css" rel="stylesheet" />
  35. <link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />
  36. <script type="text/javascript" src="prettify.js">
  37. <xsl:comment></xsl:comment>
  38. </script>
  39. <!-- making things mobile-friendly... -->
  40. <meta>
  41. <xsl:attribute name='name'><xsl:text>viewport</xsl:text></xsl:attribute>
  42. <xsl:attribute name='content'>width=device-width; initial-scale=1.0; maximum-scale=2.0</xsl:attribute>
  43. </meta>
  44. <!-- BEGIN META TAGS FOR DUBLIN CORE -->
  45. <meta>
  46. <xsl:attribute name='name'><xsl:text>DC.Title</xsl:text></xsl:attribute>
  47. <xsl:attribute name='content'><xsl:value-of select='/xep/header/title'/></xsl:attribute>
  48. </meta>
  49. <xsl:apply-templates select='/xep/header/author' mode='meta'/>
  50. <meta>
  51. <xsl:attribute name='name'><xsl:text>DC.Description</xsl:text></xsl:attribute>
  52. <xsl:attribute name='content'><xsl:value-of select='/xep/header/abstract'/></xsl:attribute>
  53. </meta>
  54. <meta>
  55. <xsl:attribute name='name'><xsl:text>DC.Publisher</xsl:text></xsl:attribute>
  56. <xsl:attribute name='content'>XMPP Standards Foundation</xsl:attribute>
  57. </meta>
  58. <meta>
  59. <xsl:attribute name='name'><xsl:text>DC.Contributor</xsl:text></xsl:attribute>
  60. <xsl:attribute name='content'>XMPP Extensions Editor</xsl:attribute>
  61. </meta>
  62. <meta>
  63. <xsl:attribute name='name'><xsl:text>DC.Date</xsl:text></xsl:attribute>
  64. <xsl:attribute name='content'><xsl:value-of select='/xep/header/revision/date'/></xsl:attribute>
  65. </meta>
  66. <meta>
  67. <xsl:attribute name='name'><xsl:text>DC.Type</xsl:text></xsl:attribute>
  68. <xsl:attribute name='content'>XMPP Extension Protocol</xsl:attribute>
  69. </meta>
  70. <meta>
  71. <xsl:attribute name='name'><xsl:text>DC.Format</xsl:text></xsl:attribute>
  72. <xsl:attribute name='content'>XHTML</xsl:attribute>
  73. </meta>
  74. <meta>
  75. <xsl:attribute name='name'><xsl:text>DC.Identifier</xsl:text></xsl:attribute>
  76. <xsl:attribute name='content'>XEP-<xsl:value-of select='/xep/header/number'/></xsl:attribute>
  77. </meta>
  78. <meta>
  79. <xsl:attribute name='name'><xsl:text>DC.Language</xsl:text></xsl:attribute>
  80. <xsl:attribute name='content'>en</xsl:attribute>
  81. </meta>
  82. <meta>
  83. <xsl:attribute name='name'><xsl:text>DC.Rights</xsl:text></xsl:attribute>
  84. <xsl:attribute name='content'><xsl:value-of select='/xep/header/legal/copyright'/></xsl:attribute>
  85. </meta>
  86. <!-- END META TAGS FOR DUBLIN CORE -->
  87. </head>
  88. <body onload="prettyPrint()">
  89. <!-- TITLE -->
  90. <h1>XEP-<xsl:value-of select='/xep/header/number' />:<xsl:text> </xsl:text><xsl:value-of select='/xep/header/title' /></h1>
  91. <!-- TOP TABLE -->
  92. <xsl:variable name='authors.count' select='count(/xep/header/author)'/>
  93. <table>
  94. <tr valign='top'>
  95. <td><strong>Abstract:</strong></td>
  96. <td><xsl:value-of select='/xep/header/abstract'/></td>
  97. </tr>
  98. <xsl:if test='$authors.count=1'>
  99. <tr valign='top'>
  100. <td><strong>Author:</strong></td>
  101. <td><xsl:value-of select='/xep/header/author/firstname'/><xsl:text> </xsl:text><xsl:value-of select='/xep/header/author/surname'/></td>
  102. </tr>
  103. </xsl:if>
  104. <xsl:if test='$authors.count&gt;1'>
  105. <tr valign='top'>
  106. <td><strong>Authors:</strong></td>
  107. <td>
  108. <xsl:for-each select='/xep/header/author'>
  109. <xsl:value-of select='firstname'/>
  110. <xsl:text> </xsl:text>
  111. <xsl:value-of select='surname'/>
  112. <xsl:if test="position()!=last()">
  113. <xsl:text>, </xsl:text>
  114. </xsl:if>
  115. </xsl:for-each>
  116. </td>
  117. </tr>
  118. </xsl:if>
  119. <tr valign='top'>
  120. <td><strong>Copyright:</strong></td>
  121. <td>&#169; 1999 &#x2013; 2017 XMPP Standards Foundation. <a href='#appendix-legal'>SEE LEGAL NOTICES</a>.</td>
  122. </tr>
  123. <tr valign='top'>
  124. <td><strong>Status:</strong></td>
  125. <td><xsl:value-of select='/xep/header/status'/></td>
  126. </tr>
  127. <tr valign='top'>
  128. <td><strong>Type:</strong></td>
  129. <td><xsl:value-of select='/xep/header/type'/></td>
  130. </tr>
  131. <tr valign='top'>
  132. <td><strong>Version:</strong></td>
  133. <td><xsl:value-of select='/xep/header/revision[position()=1]/version'/></td>
  134. </tr>
  135. <tr valign='top'>
  136. <td><strong>Last&#160;Updated:</strong></td>
  137. <td><xsl:value-of select='/xep/header/revision[position()=1]/date'/></td>
  138. </tr>
  139. </table>
  140. <!-- COUNCIL NOTE -->
  141. <xsl:apply-templates select='/xep/header/councilnote'/>
  142. <!-- DEPLOYABILITY -->
  143. <hr />
  144. <xsl:variable name='thestatus' select='/xep/header/status'/>
  145. <xsl:variable name='thetype' select='/xep/header/type'/>
  146. <xsl:if test='$thestatus = "Active" and $thetype = "Historical"'>
  147. <p style='color:green'>NOTICE: This Historical specification provides canonical documentation of a protocol that is in use within the Jabber/XMPP community. This document is not a standards-track specification within the XMPP Standards Foundation's standards process; however, it might be converted to standards-track in the future or might be obsoleted by a more modern protocol.</p>
  148. </xsl:if>
  149. <xsl:if test='$thestatus = "Active" and $thetype = "Humorous"'>
  150. <p style='color:green'>NOTICE: This document is Humorous. It MAY provide amusement but SHOULD NOT be taken seriously.</p>
  151. </xsl:if>
  152. <xsl:if test='$thestatus = "Active" and $thetype = "Informational"'>
  153. <p style='color:green'>NOTICE: This Informational specification defines a best practice or protocol profile that has been approved by the XMPP Council and/or the XSF Board of Directors. Implementations are encouraged and the best practice or protocol profile is appropriate for deployment in production systems.</p>
  154. </xsl:if>
  155. <xsl:if test='$thestatus = "Active" and $thetype = "Procedural"'>
  156. <p style='color:green'>NOTICE: This Procedural document defines a process or activity of the XMPP Standards Foundation (XSF) that has been approved by the XMPP Council and/or the XSF Board of Directors. The XSF is currently following the process or activity defined herein and will do so until this document is deprecated or obsoleted.</p>
  157. </xsl:if>
  158. <xsl:if test='$thestatus = "Deferred"'>
  159. <p style='color:red'>WARNING: This document has been automatically Deferred after 12 months of inactivity in its previous Experimental state. Implementation of the protocol described herein is not recommended for production systems. However, exploratory implementations are encouraged to resume the standards process.</p>
  160. </xsl:if>
  161. <xsl:if test='$thestatus = "Deprecated"'>
  162. <p style='color:red'>WARNING: This document has been <strong>Deprecated</strong> by the XMPP Standards Foundation. Implementation of the protocol described herein is not recommended. Developers desiring similar functionality are advised to implement the protocol that supersedes this one
  163. <xsl:variable name='supersededby.count' select='count(/xep/header/supersededby/spec)'/>
  164. <xsl:choose>
  165. <xsl:when test='$supersededby.count &gt; 0'>
  166. <xsl:text>(</xsl:text>
  167. <xsl:apply-templates select='/xep/header/supersededby/spec'>
  168. <xsl:with-param name='speccount' select='$supersededby.count'/>
  169. </xsl:apply-templates>
  170. <xsl:text>).</xsl:text>
  171. </xsl:when>
  172. <xsl:otherwise>(if any).</xsl:otherwise>
  173. </xsl:choose>
  174. </p>
  175. </xsl:if>
  176. <xsl:if test='$thestatus = "Draft"'>
  177. <p style='color:green'>NOTICE: The protocol defined herein is a <strong>Draft Standard</strong> of the XMPP Standards Foundation. Implementations are encouraged and the protocol is appropriate for deployment in production systems, but some changes to the protocol are possible before it becomes a Final Standard.</p>
  178. </xsl:if>
  179. <xsl:if test='$thestatus = "Experimental" and $thetype = "Historical"'>
  180. <p style='color:red'>NOTICE: This Historical document attempts to provide canonical documentation of a protocol that is in use within the Jabber/XMPP community. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. This document is not a standards-track specification within the XMPP Standards Foundation's standards process; however, it might be converted to standards-track in the future or might be obsoleted by a more modern protocol.</p>
  181. </xsl:if>
  182. <xsl:if test='$thestatus = "Experimental" and $thetype = "Informational"'>
  183. <p style='color:red'>WARNING: This Informational document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the best practice or protocol profile described herein is encouraged in exploratory implementations, although production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.</p>
  184. </xsl:if>
  185. <xsl:if test='$thestatus = "Experimental" and $thetype = "Procedural"'>
  186. <p style='color:red'>NOTICE: This Procedural document proposes that the process or activity defined herein shall be followed by the XMPP Standards Foundation (XSF). However, this process or activity has not yet been approved by the XMPP Council and/or the XSF Board of Directors and is therefore not currently in force.</p>
  187. </xsl:if>
  188. <xsl:if test='$thestatus = "Experimental" and $thetype = "Standards Track"'>
  189. <p style='color:red'>WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.</p>
  190. </xsl:if>
  191. <xsl:if test='$thestatus = "Final"'>
  192. <p style='color:green'>NOTICE: The protocol defined herein is a <strong>Final Standard</strong> of the XMPP Standards Foundation and can be considered a stable technology for implementation and deployment.</p>
  193. </xsl:if>
  194. <xsl:if test='$thestatus = "Obsolete"'>
  195. <p style='color:red'>WARNING: This document has been obsoleted by the XMPP Standards Foundation. Implementation of the protocol described herein is not recommended. Developers desiring similar functionality are advised to implement the protocol that supersedes this on
  196. <xsl:variable name='supersededby.count' select='count(/xep/header/supersededby/spec)'/>
  197. <xsl:choose>
  198. <xsl:when test='$supersededby.count &gt; 0'>
  199. <xsl:text>(</xsl:text>
  200. <xsl:apply-templates select='/xep/header/supersededby/spec'>
  201. <xsl:with-param name='speccount' select='$supersededby.count'/>
  202. </xsl:apply-templates>
  203. <xsl:text>).</xsl:text>
  204. </xsl:when>
  205. <xsl:otherwise>(if any).</xsl:otherwise>
  206. </xsl:choose>
  207. </p>
  208. </xsl:if>
  209. <xsl:if test='$thestatus = "Proposed"'>
  210. <p style='color:red'>NOTICE: This document is currently within Last Call or under consideration by the XMPP Council for advancement to the next stage in the XSF standards process.
  211. <xsl:if test='/xep/header/lastcall'>The Last Call ends on <xsl:value-of select='/xep/header/lastcall'/>.
  212. </xsl:if>
  213. Please send your feedback to the <a href='http://mail.jabber.org/mailman/listinfo/standards'>standards@xmpp.org</a> discussion list.</p>
  214. </xsl:if>
  215. <xsl:if test='$thestatus = "ProtoXEP"'>
  216. <p style='color:red'>WARNING: This document has not yet been accepted for consideration or approved in any official manner by the XMPP Standards Foundation, and this document is not yet an XMPP Extension Protocol (XEP). If this document is accepted as a XEP by the XMPP Council, it will be published at &lt;<a href="http://xmpp.org/extensions/">http://xmpp.org/extensions/</a>&gt; and announced on the &lt;standards@xmpp.org&gt; mailing list.</p>
  217. </xsl:if>
  218. <xsl:if test='$thestatus = "Rejected"'>
  219. <p style='color:red'>WARNING: This document has been Rejected by the XMPP Council. Implementation of the protocol described herein is not recommended under any circumstances.</p>
  220. </xsl:if>
  221. <xsl:if test='$thestatus = "Retracted"'>
  222. <p style='color:red'>WARNING: This document has been retracted by the author(s). Implementation of the protocol described herein is not recommended. Developers desiring similar functionality are advised to implement the protocol that supersedes this one
  223. <xsl:variable name='supersededby.count' select='count(/xep/header/supersededby/spec)'/>
  224. <xsl:choose>
  225. <xsl:when test='$supersededby.count &gt; 0'>
  226. <xsl:text>(</xsl:text>
  227. <xsl:apply-templates select='/xep/header/supersededby/spec'>
  228. <xsl:with-param name='speccount' select='$supersededby.count'/>
  229. </xsl:apply-templates>
  230. <xsl:text>).</xsl:text>
  231. </xsl:when>
  232. <xsl:otherwise>(if any).</xsl:otherwise>
  233. </xsl:choose>
  234. </p>
  235. </xsl:if>
  236. <!-- TABLE OF CONTENTS -->
  237. <hr />
  238. <xsl:call-template name='processTOC' />
  239. <!-- END FRONT MATTER -->
  240. <!-- BEGIN XEP CONTENTS -->
  241. <hr />
  242. <xsl:apply-templates select='/xep/section1'/>
  243. <!-- END XEP CONTENTS -->
  244. <!-- BEGIN APPENDICES -->
  245. <hr />
  246. <a name='appendices'></a>
  247. <h2>Appendices</h2>
  248. <hr />
  249. <!-- XEP INFO -->
  250. <a name='appendix-docinfo'></a>
  251. <h3>Appendix A: Document Information</h3>
  252. <p class='indent'>
  253. Series: <a href='http://xmpp.org/extensions/'>XEP</a><br />
  254. Number: <xsl:value-of select='/xep/header/number'/><br />
  255. Publisher: <a href='/xsf/'>XMPP Standards Foundation</a><br />
  256. Status:
  257. <a>
  258. <xsl:attribute name='href'><xsl:text>http://xmpp.org/extensions/xep-0001.html#states-</xsl:text><xsl:value-of select='/xep/header/status'/></xsl:attribute>
  259. <xsl:value-of select='/xep/header/status'/>
  260. </a>
  261. <br />
  262. Type:
  263. <a>
  264. <xsl:attribute name='href'><xsl:text>http://xmpp.org/extensions/xep-0001.html#types-</xsl:text><xsl:value-of select='/xep/header/type'/></xsl:attribute>
  265. <xsl:value-of select='/xep/header/type'/>
  266. </a>
  267. <br />
  268. Version: <xsl:value-of select='/xep/header/revision[position()=1]/version'/><br />
  269. Last Updated: <xsl:value-of select='/xep/header/revision[position()=1]/date'/><br />
  270. <xsl:variable name='expires.count' select='count(/xep/header/expires)'/>
  271. <xsl:if test='$expires.count=1'>
  272. Expires: <xsl:value-of select='/xep/header/expires'/><br />
  273. </xsl:if>
  274. <xsl:variable name='ApprovingBody' select='/xep/header/approver'/>
  275. <xsl:choose>
  276. <xsl:when test='$ApprovingBody = "Board"'>
  277. Approving Body: <a href='http://xmpp.org/xsf/board/'>XSF Board of Directors</a><br />
  278. </xsl:when>
  279. <xsl:otherwise>
  280. Approving Body: <a href='http://xmpp.org/council/'>XMPP Council</a><br />
  281. </xsl:otherwise>
  282. </xsl:choose>
  283. <xsl:variable name='dependencies.count' select='count(/xep/header/dependencies/spec)'/>
  284. <xsl:choose>
  285. <xsl:when test='$dependencies.count &gt; 0'>
  286. <xsl:text>Dependencies: </xsl:text>
  287. <xsl:apply-templates select='/xep/header/dependencies/spec'>
  288. <xsl:with-param name='speccount' select='$dependencies.count'/>
  289. </xsl:apply-templates>
  290. <br />
  291. </xsl:when>
  292. <xsl:otherwise>
  293. Dependencies: None<br />
  294. </xsl:otherwise>
  295. </xsl:choose>
  296. <xsl:variable name='supersedes.count' select='count(/xep/header/supersedes/spec)'/>
  297. <xsl:choose>
  298. <xsl:when test='$supersedes.count &gt; 0'>
  299. <xsl:text>Supersedes: </xsl:text>
  300. <xsl:apply-templates select='/xep/header/supersedes/spec'>
  301. <xsl:with-param name='speccount' select='$supersedes.count'/>
  302. </xsl:apply-templates>
  303. <br />
  304. </xsl:when>
  305. <xsl:otherwise>
  306. Supersedes: None<br />
  307. </xsl:otherwise>
  308. </xsl:choose>
  309. <xsl:variable name='supersededby.count' select='count(/xep/header/supersededby/spec)'/>
  310. <xsl:choose>
  311. <xsl:when test='$supersededby.count &gt; 0'>
  312. <xsl:text>Superseded By: </xsl:text>
  313. <xsl:apply-templates select='/xep/header/supersededby/spec'>
  314. <xsl:with-param name='speccount' select='$supersededby.count'/>
  315. </xsl:apply-templates>
  316. <br />
  317. </xsl:when>
  318. <xsl:otherwise>
  319. Superseded By: None<br />
  320. </xsl:otherwise>
  321. </xsl:choose>
  322. Short Name: <xsl:value-of select='/xep/header/shortname'/><br />
  323. <xsl:variable name='schema.count' select='count(/xep/header/schemaloc)'/>
  324. <xsl:if test='$schema.count &gt; 0'>
  325. <xsl:apply-templates select='/xep/header/schemaloc'/>
  326. </xsl:if>
  327. <xsl:variable name='reg.count' select='count(/xep/header/registry)'/>
  328. <xsl:if test='$reg.count=1'>
  329. Registry:
  330. <xsl:variable name='registryURL'>
  331. <xsl:text>http://xmpp.org/registrar/</xsl:text>
  332. <xsl:value-of select='/xep/header/shortname'/>
  333. <xsl:text>.html</xsl:text>
  334. </xsl:variable>
  335. &lt;<a href='{$registryURL}'><xsl:value-of select='$registryURL'/></a>&gt;
  336. <br />
  337. </xsl:if>
  338. <xsl:variable name='sourceHTML'>
  339. <xsl:text>https://github.com/xsf/xeps/blob/master/xep-</xsl:text>
  340. <xsl:value-of select='/xep/header/number'/>
  341. <xsl:text>.xml</xsl:text>
  342. </xsl:variable>
  343. <xsl:if test='$thestatus != "ProtoXEP"'>
  344. Source Control:
  345. <a class='standardsButton' href='{$sourceHTML}'>HTML</a>
  346. <br />
  347. </xsl:if>
  348. <xsl:variable name='formatXML'>
  349. <xsl:text>http://xmpp.org/extensions/xep-</xsl:text>
  350. <xsl:value-of select='/xep/header/number'/>
  351. <xsl:text>.xml</xsl:text>
  352. </xsl:variable>
  353. <xsl:variable name='formatPDF'>
  354. <xsl:text>http://xmpp.org/extensions/xep-</xsl:text>
  355. <xsl:value-of select='/xep/header/number'/>
  356. <xsl:text>.pdf</xsl:text>
  357. </xsl:variable>
  358. This document in other formats:
  359. <a class='standardsButton' href='{$formatXML}'>XML</a>&#160;
  360. <a class='standardsButton' href='{$formatPDF}'>PDF</a>
  361. </p>
  362. <hr />
  363. <!-- AUTHOR INFO -->
  364. <a name='appendix-authorinfo'></a>
  365. <h3>Appendix B: Author Information</h3>
  366. <div class='indent'>
  367. <xsl:apply-templates select='/xep/header/author'/>
  368. </div>
  369. <hr />
  370. <!-- LEGAL NOTICES -->
  371. <a name='appendix-legal'></a>
  372. <h3>Appendix C: Legal Notices</h3>
  373. <xsl:apply-templates select='/xep/header/legal'/>
  374. <hr />
  375. <!-- XMPP NOTICE -->
  376. <a name='appendix-xmpp'></a>
  377. <h3>Appendix D: Relation to XMPP</h3>
  378. <p class='indent'>The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.</p>
  379. <hr />
  380. <!-- DISCUSSION VENUE -->
  381. <a name='appendix-discuss'></a>
  382. <h3>Appendix E: Discussion Venue</h3>
  383. <xsl:variable name='discuss.count' select='count(/xep/header/discuss)'/>
  384. <xsl:variable name='discuss.venue' select='count(/xep/header/discuss)'/>
  385. <xsl:if test='$discuss.count=1'>
  386. <xsl:variable name='discussWeb'>
  387. <xsl:text>http://mail.jabber.org/mailman/listinfo/</xsl:text>
  388. <xsl:value-of select='/xep/header/discuss'/>
  389. </xsl:variable>
  390. <xsl:variable name='discussMail'>
  391. <xsl:value-of select='/xep/header/discuss'/>
  392. <xsl:text>@xmpp.org</xsl:text>
  393. </xsl:variable>
  394. <p class='indent'>There exists a special venue for discussion related to the technology described in this document: the &lt;<a href='{$discussWeb}'><xsl:value-of select='$discussMail'/></a>&gt; mailing list.</p>
  395. </xsl:if>
  396. <xsl:variable name='Approver' select='/xep/header/approver'/>
  397. <xsl:choose>
  398. <xsl:when test='$Approver = "Board"'>
  399. <p class='indent'>The primary venue for discussion of XMPP Extension Protocols is the &lt;<a href="http://mail.jabber.org/mailman/listinfo/standards">standards@xmpp.org</a>&gt; discussion list.</p>
  400. <p class='indent'>Discussion by the membership of the XSF might also be appropriate (see &lt;<a href="http://mail.jabber.org/mailman/listinfo/members">http://mail.jabber.org/mailman/listinfo/members</a>&gt; for details).</p>
  401. </xsl:when>
  402. <xsl:otherwise>
  403. <p class='indent'>The primary venue for discussion of XMPP Extension Protocols is the &lt;<a href="http://mail.jabber.org/mailman/listinfo/standards">standards@xmpp.org</a>&gt; discussion list.</p>
  404. <p class='indent'>Discussion on other xmpp.org discussion lists might also be appropriate; see &lt;<a href='http://xmpp.org/about/discuss.shtml'>http://xmpp.org/about/discuss.shtml</a>&gt; for a complete list.</p>
  405. <xsl:if test='contains(/xep/header/dependencies,"RFC")'>
  406. <p class='indent'>Given that this XMPP Extension Protocol normatively references IETF technologies, discussion on the &lt;<a href="http://mail.jabber.org/mailman/listinfo/xsf-ietf">xsf-ietf@xmpp.org</a>&gt; list might also be appropriate.</p>
  407. </xsl:if>
  408. </xsl:otherwise>
  409. </xsl:choose>
  410. <p class='indent'>Errata can be sent to &lt;<a href='mailto:editor@xmpp.org'>editor@xmpp.org</a>&gt;.</p>
  411. <hr />
  412. <!-- CONFORMANCE TERMS-->
  413. <a name='appendix-conformance'></a>
  414. <h3>Appendix F: Requirements Conformance</h3>
  415. <p class='indent'>The following requirements keywords as used in this document are to be interpreted as described in <a href='http://www.ietf.org/rfc/rfc2119.txt'>RFC 2119</a>: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".</p>
  416. <hr />
  417. <!-- NOTES -->
  418. <a name="appendix-notes"></a>
  419. <h3>Appendix G: Notes</h3>
  420. <div class='indent'>
  421. <xsl:for-each select="//note">
  422. <xsl:variable name='me' select='.' />
  423. <xsl:variable name='firstOccurrence' select='(//note[. = $me])[1]' />
  424. <xsl:variable name='oid' select='generate-id($firstOccurrence)' />
  425. <xsl:variable name='notenum' select='count($firstOccurrence/preceding::note[not(.=preceding::note)]) + count($me/ancestor::note) + 1' />
  426. <xsl:if test='generate-id($me) = generate-id($firstOccurrence)'>
  427. <p>
  428. <a name='nt-{$oid}'><xsl:value-of select='$notenum'/></a>
  429. <xsl:text>. </xsl:text>
  430. <xsl:apply-templates/>
  431. </p>
  432. </xsl:if>
  433. </xsl:for-each>
  434. </div>
  435. <!-- REVISION HISTORY -->
  436. <hr />
  437. <a name="appendix-revs"></a>
  438. <h3>Appendix H: Revision History</h3>
  439. <p>Note: Older versions of this specification might be available at <a href='http://xmpp.org/extensions/attic/'>http://xmpp.org/extensions/attic/</a></p>
  440. <div class='indent'>
  441. <xsl:apply-templates select='/xep/header/revision'/>
  442. </div>
  443. <hr />
  444. <p>END</p>
  445. </body>
  446. </html>
  447. </xsl:template>
  448. <!-- From the docbook XSL -->
  449. <xsl:template name="object.id">
  450. <xsl:param name="object" select="."/>
  451. <xsl:choose>
  452. <xsl:when test="$object/@id">
  453. <xsl:value-of select="$object/@id"/>
  454. </xsl:when>
  455. <xsl:otherwise>
  456. <xsl:value-of select="generate-id($object)"/>
  457. </xsl:otherwise>
  458. </xsl:choose>
  459. </xsl:template>
  460. <xsl:template name='processTOC'>
  461. <h2>Table of Contents</h2>
  462. <div class='indent'>
  463. <p><xsl:apply-templates select='//section1' mode='toc'/></p>
  464. <p><a href='#appendices'>Appendices</a>
  465. <br />&#160;&#160;&#160;&#160;<a href="#appendix-docinfo">A: Document Information</a>
  466. <br />&#160;&#160;&#160;&#160;<a href="#appendix-authorinfo">B: Author Information</a>
  467. <br />&#160;&#160;&#160;&#160;<a href="#appendix-legal">C: Legal Notices</a>
  468. <br />&#160;&#160;&#160;&#160;<a href="#appendix-xmpp">D: Relation to XMPP</a>
  469. <br />&#160;&#160;&#160;&#160;<a href="#appendix-discuss">E: Discussion Venue</a>
  470. <br />&#160;&#160;&#160;&#160;<a href="#appendix-conformance">F: Requirements Conformance</a>
  471. <br />&#160;&#160;&#160;&#160;<a href="#appendix-notes">G: Notes</a>
  472. <br />&#160;&#160;&#160;&#160;<a href="#appendix-revs">H: Revision History</a>
  473. </p>
  474. </div>
  475. </xsl:template>
  476. <xsl:template match='councilnote'>
  477. <hr />
  478. <div>
  479. <h3>COUNCIL NOTE</h3>
  480. <xsl:apply-templates/>
  481. </div>
  482. </xsl:template>
  483. <xsl:template match='author' mode='meta'>
  484. <meta>
  485. <xsl:attribute name='name'><xsl:text>DC.Creator</xsl:text></xsl:attribute>
  486. <xsl:attribute name='content'><xsl:value-of select='firstname'/><xsl:text> </xsl:text><xsl:value-of select='surname'/></xsl:attribute>
  487. </meta>
  488. </xsl:template>
  489. <xsl:template match='author'>
  490. <h3><xsl:value-of select='firstname'/><xsl:text> </xsl:text><xsl:value-of select='surname'/></h3>
  491. <p class='indent'>
  492. <xsl:variable name='org.count' select='count(org)'/>
  493. <xsl:variable name='email.count' select='count(email)'/>
  494. <xsl:variable name='jid.count' select='count(jid)'/>
  495. <xsl:variable name='uri.count' select='count(uri)'/>
  496. <xsl:variable name='authornote.count' select='count(authornote)'/>
  497. <xsl:if test='$authornote.count &gt; 0'>
  498. See <a href='#authornote'>Author Note</a><br />
  499. </xsl:if>
  500. <xsl:if test='$org.count=1'>
  501. Organization: <xsl:value-of select='org'/><br />
  502. </xsl:if>
  503. <xsl:if test='$email.count=1'>
  504. Email:
  505. <a>
  506. <xsl:attribute name='href'>
  507. <xsl:text>mailto:</xsl:text>
  508. <xsl:value-of select='email' />
  509. </xsl:attribute>
  510. <xsl:value-of select='email' />
  511. </a>
  512. <br />
  513. </xsl:if>
  514. <xsl:if test='$jid.count=1'>
  515. JabberID:
  516. <a>
  517. <xsl:attribute name='href'>
  518. <xsl:text>xmpp:</xsl:text>
  519. <xsl:value-of select='jid' />
  520. </xsl:attribute>
  521. <xsl:value-of select='jid' />
  522. </a>
  523. <br />
  524. </xsl:if>
  525. <xsl:if test='$uri.count=1'>
  526. URI:
  527. <a>
  528. <xsl:attribute name='href'>
  529. <xsl:value-of select='uri' />
  530. </xsl:attribute>
  531. <xsl:value-of select='uri' />
  532. </a>
  533. <br />
  534. </xsl:if>
  535. </p>
  536. </xsl:template>
  537. <xsl:template match='legal'>
  538. <div class='indent'>
  539. <h4>Copyright</h4>
  540. <xsl:apply-templates select='/xep/header/legal/copyright'/>
  541. <h4>Permissions</h4>
  542. <xsl:apply-templates select='/xep/header/legal/permissions'/>
  543. <h4>Disclaimer of Warranty</h4>
  544. <span style='font-weight: bold'>
  545. <xsl:apply-templates select='/xep/header/legal/warranty'/>
  546. </span>
  547. <h4>Limitation of Liability</h4>
  548. <xsl:apply-templates select='/xep/header/legal/liability'/>
  549. <h4>IPR Conformance</h4>
  550. <xsl:apply-templates select='/xep/header/legal/conformance'/>
  551. </div>
  552. </xsl:template>
  553. <xsl:template match='spec'>
  554. <xsl:param name='speccount' select='""'/>
  555. <xsl:variable name='specpos' select='position()'/>
  556. <xsl:value-of select='.'/>
  557. <xsl:if test='$specpos &lt; $speccount'>
  558. <xsl:text>, </xsl:text>
  559. </xsl:if>
  560. </xsl:template>
  561. <xsl:template match='schemaloc'>
  562. <xsl:variable name='this.url' select='url'/>
  563. <xsl:variable name='ns.count' select='count(ns)'/>
  564. <xsl:choose>
  565. <xsl:when test="$ns.count=1">
  566. XML Schema for the '<xsl:value-of select='ns'/>' namespace: &lt;<a href='{$this.url}'><xsl:value-of select='url'/></a>&gt;<br />
  567. </xsl:when>
  568. <xsl:otherwise>
  569. Schema: &lt;<a href='{$this.url}'><xsl:value-of select='url'/></a>&gt;<br />
  570. </xsl:otherwise>
  571. </xsl:choose>
  572. </xsl:template>
  573. <xsl:template match='revision'>
  574. <h4>Version <xsl:value-of select='version'/><xsl:text> </xsl:text>(<xsl:value-of select='date'/>)</h4>
  575. <div class='indent'>
  576. <xsl:apply-templates select='remark'/>
  577. <xsl:text> </xsl:text>(<xsl:value-of select='initials'/>)
  578. </div>
  579. </xsl:template>
  580. <xsl:template match='section1' mode='toc'>
  581. <xsl:variable name='oid'>
  582. <xsl:call-template name='object.id'/>
  583. </xsl:variable>
  584. <xsl:variable name='anch'>
  585. <xsl:value-of select='@anchor'/>
  586. </xsl:variable>
  587. <xsl:variable name='num'>
  588. <xsl:number level='multiple' count='section1'/><xsl:text>.</xsl:text>
  589. </xsl:variable>
  590. <xsl:variable name='sect2.count' select='count(section2)'/>
  591. <br />
  592. <xsl:value-of select='$num'/> <xsl:text> </xsl:text>
  593. <a>
  594. <xsl:attribute name='href'>
  595. <xsl:text>#</xsl:text>
  596. <xsl:choose>
  597. <xsl:when test='$anch != ""'>
  598. <xsl:value-of select='@anchor'/>
  599. </xsl:when>
  600. <xsl:otherwise>
  601. <xsl:text>sect-</xsl:text>
  602. <xsl:value-of select='$oid'/>
  603. </xsl:otherwise>
  604. </xsl:choose>
  605. </xsl:attribute>
  606. <xsl:value-of select='@topic' />
  607. </a>
  608. <xsl:if test='$sect2.count &gt; 0'>
  609. <xsl:apply-templates select='section2' mode='toc'>
  610. <xsl:with-param name='prevnum' select='$num'/>
  611. </xsl:apply-templates>
  612. </xsl:if>
  613. </xsl:template>
  614. <xsl:template match='section1'>
  615. <xsl:variable name='oid'>
  616. <xsl:call-template name='object.id'/>
  617. </xsl:variable>
  618. <xsl:variable name='anch'>
  619. <xsl:value-of select='@anchor'/>
  620. </xsl:variable>
  621. <h2>
  622. <xsl:number level='single' count='section1'/>.
  623. <xsl:text> </xsl:text>
  624. <a>
  625. <xsl:attribute name='name'>
  626. <xsl:choose>
  627. <xsl:when test='$anch != ""'>
  628. <xsl:value-of select='@anchor'/>
  629. </xsl:when>
  630. <xsl:otherwise>
  631. <xsl:text>sect-</xsl:text><xsl:value-of select='$oid'/>
  632. </xsl:otherwise>
  633. </xsl:choose>
  634. </xsl:attribute>
  635. <xsl:value-of select='@topic' />
  636. </a>
  637. </h2>
  638. <xsl:apply-templates/>
  639. </xsl:template>
  640. <xsl:template match='section2' mode='toc'>
  641. <xsl:param name='prevnum' select='""'/>
  642. <xsl:variable name='oid'>
  643. <xsl:call-template name='object.id'/>
  644. </xsl:variable>
  645. <xsl:variable name='anch'>
  646. <xsl:value-of select='@anchor'/>
  647. </xsl:variable>
  648. <xsl:variable name='num'>
  649. <xsl:value-of select='$prevnum'/><xsl:number level='multiple' count='section2'/><xsl:text>.</xsl:text>
  650. </xsl:variable>
  651. <xsl:variable name='sect3.count' select='count(section3)'/>
  652. <br />&#160;&#160;&#160;
  653. <xsl:value-of select='$num'/> <xsl:text> </xsl:text>
  654. <a>
  655. <xsl:attribute name='href'>
  656. <xsl:text>#</xsl:text>
  657. <xsl:choose>
  658. <xsl:when test='$anch != ""'>
  659. <xsl:value-of select='@anchor'/>
  660. </xsl:when>
  661. <xsl:otherwise>
  662. <xsl:text>sect-</xsl:text><xsl:value-of select='$oid'/>
  663. </xsl:otherwise>
  664. </xsl:choose>
  665. </xsl:attribute>
  666. <xsl:value-of select='@topic' />
  667. </a>
  668. <xsl:if test='$sect3.count &gt; 0'>
  669. <xsl:apply-templates select='section3' mode='toc'>
  670. <xsl:with-param name='prevnum' select='$num'/>
  671. </xsl:apply-templates>
  672. </xsl:if>
  673. </xsl:template>
  674. <xsl:template match='section2'>
  675. <xsl:variable name='oid'>
  676. <xsl:call-template name='object.id'/>
  677. </xsl:variable>
  678. <xsl:variable name='anch'>
  679. <xsl:value-of select='@anchor'/>
  680. </xsl:variable>
  681. <div class='indent'>
  682. <h3>
  683. <xsl:number level='single' count='section1'/>.<xsl:number level='single' count='section2'/>
  684. <xsl:text> </xsl:text>
  685. <a>
  686. <xsl:attribute name='name'>
  687. <xsl:choose>
  688. <xsl:when test='$anch != ""'>
  689. <xsl:value-of select='@anchor'/>
  690. </xsl:when>
  691. <xsl:otherwise>
  692. <xsl:text>sect-</xsl:text><xsl:value-of select='$oid'/>
  693. </xsl:otherwise>
  694. </xsl:choose>
  695. </xsl:attribute>
  696. <xsl:value-of select='@topic' />
  697. </a>
  698. </h3>
  699. <xsl:apply-templates/>
  700. </div>
  701. </xsl:template>
  702. <xsl:template match='section3' mode='toc'>
  703. <xsl:param name='prevnum' select='""'/>
  704. <xsl:variable name='oid'>
  705. <xsl:call-template name='object.id'/>
  706. </xsl:variable>
  707. <xsl:variable name='anch'>
  708. <xsl:value-of select='@anchor'/>
  709. </xsl:variable>
  710. <xsl:variable name='num'>
  711. <xsl:value-of select='$prevnum'/><xsl:number level='multiple' count='section3'/><xsl:text>.</xsl:text>
  712. </xsl:variable>
  713. <xsl:variable name='sect4.count' select='count(section4)'/>
  714. <br />&#160;&#160;&#160;&#160;&#160;&#160;
  715. <xsl:value-of select='$num'/> <xsl:text> </xsl:text>
  716. <a>
  717. <xsl:attribute name='href'>
  718. <xsl:text>#</xsl:text>
  719. <xsl:choose>
  720. <xsl:when test='$anch != ""'>
  721. <xsl:value-of select='@anchor'/>
  722. </xsl:when>
  723. <xsl:otherwise>
  724. <xsl:text>sect-</xsl:text><xsl:value-of select='$oid'/>
  725. </xsl:otherwise>
  726. </xsl:choose>
  727. </xsl:attribute>
  728. <xsl:value-of select='@topic' />
  729. </a>
  730. <xsl:if test='$sect4.count &gt; 0'>
  731. <xsl:apply-templates select='section4' mode='toc'>
  732. <xsl:with-param name='prevnum' select='$num'/>
  733. </xsl:apply-templates>
  734. </xsl:if>
  735. </xsl:template>
  736. <xsl:template match='section3'>
  737. <xsl:variable name='oid'>
  738. <xsl:call-template name='object.id'/>
  739. </xsl:variable>
  740. <xsl:variable name='anch'>
  741. <xsl:value-of select='@anchor'/>
  742. </xsl:variable>
  743. <div class='indent'>
  744. <h3>
  745. <xsl:number level='single' count='section1'/>.<xsl:number level='single' count='section2'/>.<xsl:number level='single' count='section3'/>
  746. <xsl:text> </xsl:text>
  747. <a>
  748. <xsl:attribute name='name'>
  749. <xsl:choose>
  750. <xsl:when test='$anch != ""'>
  751. <xsl:value-of select='@anchor'/>
  752. </xsl:when>
  753. <xsl:otherwise>
  754. <xsl:text>sect-</xsl:text><xsl:value-of select='$oid'/>
  755. </xsl:otherwise>
  756. </xsl:choose>
  757. </xsl:attribute>
  758. <xsl:value-of select='@topic' />
  759. </a>
  760. </h3>
  761. <xsl:apply-templates/>
  762. </div>
  763. </xsl:template>
  764. <xsl:template match='section4' mode='toc'>
  765. <xsl:param name='prevnum' select='""'/>
  766. <xsl:variable name='oid'>
  767. <xsl:call-template name='object.id'/>
  768. </xsl:variable>
  769. <xsl:variable name='anch'>
  770. <xsl:value-of select='@anchor'/>
  771. </xsl:variable>
  772. <xsl:variable name='num'>
  773. <xsl:value-of select='$prevnum'/><xsl:number level='multiple' count='section4'/><xsl:text>.</xsl:text>
  774. </xsl:variable>
  775. <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
  776. <xsl:value-of select='$num'/> <xsl:text> </xsl:text>
  777. <a>
  778. <xsl:attribute name='href'>
  779. <xsl:text>#</xsl:text>
  780. <xsl:choose>
  781. <xsl:when test='$anch != ""'>
  782. <xsl:value-of select='@anchor'/>
  783. </xsl:when>
  784. <xsl:otherwise>
  785. <xsl:text>sect-</xsl:text><xsl:value-of select='$oid'/>
  786. </xsl:otherwise>
  787. </xsl:choose>
  788. </xsl:attribute>
  789. <xsl:value-of select='@topic' />
  790. </a>
  791. </xsl:template>
  792. <xsl:template match='section4'>
  793. <xsl:variable name='oid'>
  794. <xsl:call-template name='object.id'/>
  795. </xsl:variable>
  796. <xsl:variable name='anch'>
  797. <xsl:value-of select='@anchor'/>
  798. </xsl:variable>
  799. <div class='indent'>
  800. <h3>
  801. <xsl:number level='single' count='section1'/>.<xsl:number level='single' count='section2'/>.<xsl:number level='single' count='section3'/>.<xsl:number level='single' count='section4'/>
  802. <xsl:text> </xsl:text>
  803. <a>
  804. <xsl:attribute name='name'>
  805. <xsl:choose>
  806. <xsl:when test='$anch != ""'>
  807. <xsl:value-of select='@anchor'/>
  808. </xsl:when>
  809. <xsl:otherwise>
  810. <xsl:text>sect-</xsl:text><xsl:value-of select='$oid'/>
  811. </xsl:otherwise>
  812. </xsl:choose>
  813. </xsl:attribute>
  814. <xsl:value-of select='@topic' />
  815. </a>
  816. </h3>
  817. <xsl:apply-templates/>
  818. </div>
  819. </xsl:template>
  820. <xsl:template match='remark'>
  821. <xsl:apply-templates/>
  822. </xsl:template>
  823. <xsl:template match='p'>
  824. <p>
  825. <xsl:variable name='class.count' select='count(@class)'/>
  826. <xsl:if test='$class.count=1'>
  827. <xsl:attribute name='class'><xsl:value-of select='@class'/></xsl:attribute>
  828. </xsl:if>
  829. <xsl:variable name='style.count' select='count(@style)'/>
  830. <xsl:if test='$style.count=1'>
  831. <xsl:attribute name='style'><xsl:value-of select='@style'/></xsl:attribute>
  832. </xsl:if>
  833. <xsl:apply-templates/>
  834. </p>
  835. </xsl:template>
  836. <xsl:template match='br'>
  837. <br />
  838. </xsl:template>
  839. <xsl:template match='ul'>
  840. <ul>
  841. <xsl:variable name='class.count' select='count(@class)'/>
  842. <xsl:if test='$class.count=1'>
  843. <xsl:attribute name='class'><xsl:value-of select='@class'/></xsl:attribute>
  844. </xsl:if>
  845. <xsl:variable name='style.count' select='count(@style)'/>
  846. <xsl:if test='$style.count=1'>
  847. <xsl:attribute name='style'><xsl:value-of select='@style'/></xsl:attribute>
  848. </xsl:if>
  849. <xsl:apply-templates/>
  850. </ul>
  851. </xsl:template>
  852. <xsl:template match='ol'>
  853. <ol>
  854. <xsl:variable name='start.count' select='count(@start)'/>
  855. <xsl:if test='$start.count=1'>
  856. <xsl:attribute name='start'><xsl:value-of select='@start'/></xsl:attribute>
  857. </xsl:if>
  858. <xsl:variable name='class.count' select='count(@class)'/>
  859. <xsl:if test='$class.count=1'>
  860. <xsl:attribute name='class'><xsl:value-of select='@class'/></xsl:attribute>
  861. </xsl:if>
  862. <xsl:variable name='style.count' select='count(@style)'/>
  863. <xsl:if test='$style.count=1'>
  864. <xsl:attribute name='style'><xsl:value-of select='@style'/></xsl:attribute>
  865. </xsl:if>
  866. <xsl:apply-templates/>
  867. </ol>
  868. </xsl:template>
  869. <xsl:template match='li'>
  870. <li>
  871. <xsl:variable name='class.count' select='count(@class)'/>
  872. <xsl:if test='$class.count=1'>
  873. <xsl:attribute name='class'><xsl:value-of select='@class'/></xsl:attribute>
  874. </xsl:if>
  875. <xsl:variable name='style.count' select='count(@style)'/>
  876. <xsl:if test='$style.count=1'>
  877. <xsl:attribute name='style'><xsl:value-of select='@style'/></xsl:attribute>
  878. </xsl:if>
  879. <xsl:apply-templates/>
  880. </li>
  881. </xsl:template>
  882. <xsl:template match='link'>
  883. <a>
  884. <xsl:attribute name='href'><xsl:value-of select='@url'/></xsl:attribute>
  885. <xsl:apply-templates/>
  886. </a>
  887. </xsl:template>
  888. <xsl:template match='example'>
  889. <p class='caption'><a><xsl:attribute name='name'><xsl:text>example-</xsl:text><xsl:number level='any' count='example'/></xsl:attribute></a>Example <xsl:number level='any' count='example'/>.<xsl:text> </xsl:text><xsl:value-of select='@caption'/></p>
  890. <div class='indent'>
  891. <pre class='prettyprint'><xsl:apply-templates/></pre>
  892. </div>
  893. </xsl:template>
  894. <xsl:template match='code'>
  895. <p class='caption'><xsl:value-of select='@caption'/></p>
  896. <div class='indent'>
  897. <pre class='prettyprint'><xsl:apply-templates/></pre>
  898. </div>
  899. </xsl:template>
  900. <xsl:template match='img'>
  901. <img>
  902. <xsl:attribute name='alt'><xsl:value-of select='@alt'/></xsl:attribute>
  903. <xsl:attribute name='height'><xsl:value-of select='@height'/></xsl:attribute>
  904. <xsl:attribute name='src'><xsl:value-of select='@src'/></xsl:attribute>
  905. <xsl:attribute name='width'><xsl:value-of select='@width'/></xsl:attribute>
  906. </img>
  907. </xsl:template>
  908. <xsl:template match='table'>
  909. <div class='indent'>
  910. <p class='caption'><a><xsl:attribute name='name'><xsl:text>table-</xsl:text><xsl:number level='any' count='table'/></xsl:attribute></a>Table <xsl:number level='any' count='table'/>:<xsl:text> </xsl:text><xsl:value-of select='@caption'/></p>
  911. <table border='1' cellpadding='3' cellspacing='0'>
  912. <xsl:apply-templates/>
  913. </table>
  914. </div>
  915. </xsl:template>
  916. <xsl:template match='tr'>
  917. <tr class='body'>
  918. <xsl:apply-templates/>
  919. </tr>
  920. </xsl:template>
  921. <xsl:template match='th'>
  922. <th>
  923. <xsl:variable name='colspan.count' select='count(@colspan)'/>
  924. <xsl:variable name='rowspan.count' select='count(@rowspan)'/>
  925. <xsl:if test='$colspan.count=1'>
  926. <xsl:attribute name='colspan'><xsl:value-of select='@colspan'/></xsl:attribute>
  927. </xsl:if>
  928. <xsl:if test='$rowspan.count=1'>
  929. <xsl:attribute name='rowspan'><xsl:value-of select='@rowspan'/></xsl:attribute>
  930. </xsl:if>
  931. <xsl:apply-templates/>
  932. </th>
  933. </xsl:template>
  934. <xsl:template match='td'>
  935. <td>
  936. <xsl:variable name='align.count' select='count(@align)'/>
  937. <xsl:variable name='colspan.count' select='count(@colspan)'/>
  938. <xsl:variable name='rowspan.count' select='count(@rowspan)'/>
  939. <xsl:if test='$align.count=1'>
  940. <xsl:attribute name='align'><xsl:value-of select='@align'/></xsl:attribute>
  941. </xsl:if>
  942. <xsl:if test='$colspan.count=1'>
  943. <xsl:attribute name='colspan'><xsl:value-of select='@colspan'/></xsl:attribute>
  944. </xsl:if>
  945. <xsl:if test='$rowspan.count=1'>
  946. <xsl:attribute name='rowspan'><xsl:value-of select='@rowspan'/></xsl:attribute>
  947. </xsl:if>
  948. <xsl:apply-templates/>
  949. </td>
  950. </xsl:template>
  951. <xsl:template match='dl'>
  952. <div class='indent'>
  953. <dl>
  954. <xsl:apply-templates/>
  955. </dl>
  956. </div>
  957. </xsl:template>
  958. <xsl:template match='di'>
  959. <di>
  960. <xsl:apply-templates/>
  961. </di>
  962. </xsl:template>
  963. <xsl:template match='dt'>
  964. <dt>
  965. <strong><xsl:apply-templates/></strong>
  966. </dt>
  967. </xsl:template>
  968. <xsl:template match='dd'>
  969. <dd>
  970. <xsl:apply-templates/>
  971. </dd>
  972. </xsl:template>
  973. <xsl:template match='note'>
  974. <xsl:variable name='me' select='.' />
  975. <xsl:variable name='firstOccurrence' select='(//note[. = $me])[1]' />
  976. <xsl:variable name='oid' select='generate-id($firstOccurrence)' />
  977. <xsl:variable name='notenum' select='count($firstOccurrence/preceding::note[not(.=preceding::note)]) + count($me/ancestor::note) + 1' />
  978. <xsl:text> [</xsl:text><a href='#nt-{$oid}'>
  979. <xsl:value-of select='$notenum'/></a>
  980. <xsl:text>]</xsl:text>
  981. </xsl:template>
  982. <!-- PRESENTATIONAL ELEMENTS -->
  983. <xsl:template match='blockquote'>
  984. <blockquote>
  985. <xsl:apply-templates/>
  986. </blockquote>
  987. </xsl:template>
  988. <xsl:template match='cite'>
  989. <span class='ref'>
  990. <xsl:apply-templates/>
  991. </span>
  992. </xsl:template>
  993. <xsl:template match='dfn'>
  994. <span class='dfn'>
  995. <xsl:apply-templates/>
  996. </span>
  997. </xsl:template>
  998. <xsl:template match='div'>
  999. <div>
  1000. <xsl:variable name='class.count' select='count(@class)'/>
  1001. <xsl:if test='$class.count=1'>
  1002. <xsl:attribute name='class'><xsl:value-of select='@class'/></xsl:attribute>
  1003. </xsl:if>
  1004. <xsl:variable name='style.count' select='count(@style)'/>
  1005. <xsl:if test='$style.count=1'>
  1006. <xsl:attribute name='style'><xsl:value-of select='@style'/></xsl:attribute>
  1007. </xsl:if>
  1008. <xsl:apply-templates/>
  1009. </div>
  1010. </xsl:template>
  1011. <xsl:template match='em'>
  1012. <span class='em'>
  1013. <xsl:apply-templates/>
  1014. </span>
  1015. </xsl:template>
  1016. <xsl:template match='sub'>
  1017. <sub><xsl:apply-templates/></sub>
  1018. </xsl:template>
  1019. <xsl:template match='pre'>
  1020. <pre><xsl:apply-templates/></pre>
  1021. </xsl:template>
  1022. <xsl:template match='span'>
  1023. <span>
  1024. <xsl:variable name='class.count' select='count(@class)'/>
  1025. <xsl:if test='$class.count=1'>
  1026. <xsl:attribute name='class'><xsl:value-of select='@class'/></xsl:attribute>
  1027. </xsl:if>
  1028. <xsl:variable name='style.count' select='count(@style)'/>
  1029. <xsl:if test='$style.count=1'>
  1030. <xsl:attribute name='style'><xsl:value-of select='@style'/></xsl:attribute>
  1031. </xsl:if>
  1032. <xsl:apply-templates/>
  1033. </span>
  1034. </xsl:template>
  1035. <xsl:template match='strong'>
  1036. <span class='strong'>
  1037. <xsl:apply-templates/>
  1038. </span>
  1039. </xsl:template>
  1040. <xsl:template match='tt'>
  1041. <tt>
  1042. <xsl:apply-templates/>
  1043. </tt>
  1044. </xsl:template>
  1045. <!-- END OF PRESENTATIONAL ELEMENTS -->
  1046. </xsl:stylesheet>