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.

313 lines
10 KiB

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  3. <xsl:template match="/">
  4. <xsl:apply-templates/>
  5. </xsl:template>
  6. <!-- match the root book element -->
  7. <xsl:template match="book">
  8. <project>
  9. <parameter name="copyright" value="{@copyright}"/>
  10. <!-- copy all resources to the targets -->
  11. <process source="sbk:/style/resources/" producer="directory">
  12. <processor name="xslt">
  13. <parameter name="stylesheet" value="sbk:/style/stylesheets/directory2project.xsl"/>
  14. <parameter name="base" value="resources/"/>
  15. </processor>
  16. </process>
  17. <xsl:apply-templates/>
  18. </project>
  19. </xsl:template>
  20. <!-- ********************************************************************** -->
  21. <!-- CREATE THE TARGET HTML -->
  22. <!-- ********************************************************************** -->
  23. <xsl:template match="document">
  24. <process source="{@source}" producer="parser">
  25. <processor name="xslt">
  26. <parameter name="stylesheet" value="sbk:/style/stylesheets/any2project.xsl"/>
  27. </processor>
  28. </process>
  29. <xsl:call-template name="header">
  30. <xsl:with-param name="id" select="@id"/>
  31. <xsl:with-param name="source" select="@source"/>
  32. <xsl:with-param name="label" select="@label"/>
  33. </xsl:call-template>
  34. <xsl:call-template name="labels">
  35. <xsl:with-param name="id" select="@id"/>
  36. <xsl:with-param name="label" select="@label"/>
  37. </xsl:call-template>
  38. <create source="{@source}" target="{@id}.html" producer="parser" printer="html">
  39. <processor name="xslt">
  40. <parameter name="id" value="{@id}"/>
  41. <parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
  42. </processor>
  43. </create>
  44. </xsl:template>
  45. <xsl:template match="hidden">
  46. <process source="{@source}" producer="parser">
  47. <processor name="xslt">
  48. <parameter name="stylesheet" value="sbk:/style/stylesheets/any2project.xsl"/>
  49. </processor>
  50. </process>
  51. <xsl:call-template name="header">
  52. <xsl:with-param name="id" select="@id"/>
  53. <xsl:with-param name="source" select="@source"/>
  54. <xsl:with-param name="label" select="@label"/>
  55. </xsl:call-template>
  56. <create source="{@source}" target="{@id}.html" producer="parser" printer="html">
  57. <processor name="xslt">
  58. <parameter name="id" value="{@id}"/>
  59. <parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
  60. </processor>
  61. </create>
  62. </xsl:template>
  63. <xsl:template match="faqs">
  64. <process source="{@source}" producer="parser">
  65. <processor name="xslt">
  66. <parameter name="stylesheet" value="sbk:/style/stylesheets/any2project.xsl"/>
  67. </processor>
  68. </process>
  69. <xsl:call-template name="header">
  70. <xsl:with-param name="id" select="@id"/>
  71. <xsl:with-param name="source" select="@source"/>
  72. <xsl:with-param name="label" select="@label"/>
  73. </xsl:call-template>
  74. <xsl:call-template name="labels">
  75. <xsl:with-param name="id" select="@id"/>
  76. <xsl:with-param name="label" select="@label"/>
  77. </xsl:call-template>
  78. <create source="{@source}" target="{@id}.html" producer="parser" printer="html">
  79. <processor name="xslt">
  80. <parameter name="stylesheet" value="sbk:/style/stylesheets/faqs2document.xsl"/>
  81. </processor>
  82. <processor name="xslt">
  83. <parameter name="id" value="{@id}"/>
  84. <parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
  85. </processor>
  86. </create>
  87. </xsl:template>
  88. <xsl:template match="changes">
  89. <process source="{@source}" producer="parser">
  90. <processor name="xslt">
  91. <parameter name="stylesheet" value="sbk:/style/stylesheets/any2project.xsl"/>
  92. </processor>
  93. </process>
  94. <xsl:call-template name="header">
  95. <xsl:with-param name="id" select="@id"/>
  96. <xsl:with-param name="source" select="@source"/>
  97. <xsl:with-param name="label" select="@label"/>
  98. </xsl:call-template>
  99. <xsl:call-template name="labels">
  100. <xsl:with-param name="id" select="@id"/>
  101. <xsl:with-param name="label" select="@label"/>
  102. </xsl:call-template>
  103. <create source="{@source}" target="{@id}.html" producer="parser" printer="html">
  104. <processor name="xslt">
  105. <parameter name="stylesheet" value="sbk:/style/stylesheets/changes2document.xsl"/>
  106. </processor>
  107. <processor name="xslt">
  108. <parameter name="id" value="{@id}"/>
  109. <parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
  110. </processor>
  111. </create>
  112. </xsl:template>
  113. <xsl:template match="group">
  114. <xsl:apply-templates/>
  115. <xsl:call-template name="header">
  116. <xsl:with-param name="id" select="@id"/>
  117. <xsl:with-param name="source" select="@source"/>
  118. <xsl:with-param name="label" select="@label"/>
  119. </xsl:call-template>
  120. <xsl:call-template name="labels">
  121. <xsl:with-param name="id" select="@id"/>
  122. <xsl:with-param name="label" select="@label"/>
  123. </xsl:call-template>
  124. <create source="" target="{@id}.html" producer="project" printer="html">
  125. <parameter name="id" value="{@id}"/>
  126. <processor name="xslt">
  127. <parameter name="stylesheet" value="sbk:/style/stylesheets/book2group.xsl"/>
  128. </processor>
  129. <processor name="xslt">
  130. <parameter name="stylesheet" value="sbk:/style/stylesheets/group2document.xsl"/>
  131. </processor>
  132. <processor name="xslt">
  133. <parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
  134. </processor>
  135. </create>
  136. </xsl:template>
  137. <xsl:template match="container">
  138. <xsl:apply-templates/>
  139. <process source="{@source}" producer="parser">
  140. <processor name="xslt">
  141. <parameter name="stylesheet" value="sbk:/style/stylesheets/any2project.xsl"/>
  142. </processor>
  143. </process>
  144. <xsl:call-template name="header">
  145. <xsl:with-param name="id" select="@id"/>
  146. <xsl:with-param name="source" select="@source"/>
  147. <xsl:with-param name="label" select="@label"/>
  148. </xsl:call-template>
  149. <xsl:call-template name="labels">
  150. <xsl:with-param name="id" select="@id"/>
  151. <xsl:with-param name="label" select="@label"/>
  152. </xsl:call-template>
  153. <create source="{@source}" target="{@id}.html" producer="parser" printer="html">
  154. <processor name="xslt">
  155. <parameter name="id" value="{@id}"/>
  156. <parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
  157. </processor>
  158. </create>
  159. </xsl:template>
  160. <xsl:template match="entry">
  161. <process source="{@source}" producer="parser">
  162. <processor name="xslt">
  163. <parameter name="stylesheet" value="sbk:/style/stylesheets/any2project.xsl"/>
  164. </processor>
  165. </process>
  166. <xsl:call-template name="header">
  167. <xsl:with-param name="id" select="@id"/>
  168. <xsl:with-param name="source" select="@source"/>
  169. <xsl:with-param name="label" select="@label"/>
  170. </xsl:call-template>
  171. <create source="{@source}" target="{@id}.html" producer="parser" printer="html">
  172. <processor name="xslt">
  173. <parameter name="stylesheet" value="sbk:/style/stylesheets/faqs2document.xsl"/>
  174. </processor>
  175. <processor name="xslt">
  176. <parameter name="id" value="{@id}"/>
  177. <parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
  178. </processor>
  179. </create>
  180. </xsl:template>
  181. <xsl:template match="external">
  182. <xsl:call-template name="labels">
  183. <xsl:with-param name="id" select="concat('ext-',position())"/>
  184. <xsl:with-param name="label" select="@label"/>
  185. </xsl:call-template>
  186. </xsl:template>
  187. <xsl:template match="section">
  188. <xsl:call-template name="sect-label">
  189. <xsl:with-param name="id" select="concat('sect-',position())"/>
  190. <xsl:with-param name="label" select="@label"/>
  191. </xsl:call-template>
  192. </xsl:template>
  193. <!-- ********************************************************************** -->
  194. <!-- NAMED TEMPLATES -->
  195. <!-- ********************************************************************** -->
  196. <!-- Generate the doument header image -->
  197. <xsl:template name="header">
  198. <xsl:param name="id"/>
  199. <xsl:param name="source"/>
  200. <xsl:param name="label"/>
  201. <create source="{$source}" target="graphics/{$id}-header.jpg" producer="parser" printer="image">
  202. <processor name="xslt">
  203. <parameter name="label" value="{$label}"/>
  204. <parameter name="stylesheet" value="sbk:/style/stylesheets/any2header.xsl"/>
  205. </processor>
  206. </create>
  207. </xsl:template>
  208. <!-- Generate the three rollover label images -->
  209. <xsl:template name="labels">
  210. <xsl:param name="id"/>
  211. <xsl:param name="label"/>
  212. <create source="" target="graphics/{$id}-label-1.jpg" producer="context" printer="image">
  213. <parameter name="label" value="{$label}"/>
  214. <processor name="xslt">
  215. <parameter name="stylesheet" value="sbk:/style/stylesheets/context2label.xsl"/>
  216. <parameter name="image" value="sbk:/style/graphics/button-a.gif"/>
  217. <parameter name="color" value="ffffff"/>
  218. </processor>
  219. </create>
  220. <create source="" target="graphics/{$id}-label-2.jpg" producer="context" printer="image">
  221. <parameter name="label" value="{$label}"/>
  222. <processor name="xslt">
  223. <parameter name="stylesheet" value="sbk:/style/stylesheets/context2label.xsl"/>
  224. <parameter name="image" value="sbk:/style/graphics/button-b.gif"/>
  225. <parameter name="color" value="ffff00"/>
  226. </processor>
  227. </create>
  228. <create source="" target="graphics/{$id}-label-3.jpg" producer="context" printer="image">
  229. <parameter name="label" value="{$label}"/>
  230. <processor name="xslt">
  231. <parameter name="stylesheet" value="sbk:/style/stylesheets/context2label.xsl"/>
  232. <parameter name="image" value="sbk:/style/graphics/button-b.gif"/>
  233. <parameter name="color" value="ffffff"/>
  234. </processor>
  235. </create>
  236. </xsl:template>
  237. <!-- Generate one bold section label -->
  238. <xsl:template name="sect-label">
  239. <xsl:param name="id"/>
  240. <xsl:param name="label"/>
  241. <create source="" target="graphics/{$id}-label.jpg" producer="context" printer="image">
  242. <parameter name="label" value="{$label}"/>
  243. <processor name="xslt">
  244. <parameter name="stylesheet" value="sbk:/style/stylesheets/context2section.xsl"/>
  245. <parameter name="color" value="ffffff"/>
  246. </processor>
  247. </create>
  248. </xsl:template>
  249. </xsl:stylesheet>