division.xsl 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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: division.xsl 9366 2012-05-12 23:44:25Z bobstayton $
  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. <xsl:template match="set">
  14. <xsl:call-template name="id.warning"/>
  15. <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
  16. <xsl:apply-templates select="." mode="common.html.attributes"/>
  17. <xsl:call-template name="id.attribute">
  18. <xsl:with-param name="conditional" select="0"/>
  19. </xsl:call-template>
  20. <xsl:call-template name="dir">
  21. <xsl:with-param name="inherit" select="1"/>
  22. </xsl:call-template>
  23. <xsl:call-template name="language.attribute"/>
  24. <xsl:if test="$generate.id.attributes != 0">
  25. <xsl:attribute name="id">
  26. <xsl:call-template name="object.id"/>
  27. </xsl:attribute>
  28. </xsl:if>
  29. <xsl:call-template name="set.titlepage"/>
  30. <xsl:variable name="toc.params">
  31. <xsl:call-template name="find.path.params">
  32. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  33. </xsl:call-template>
  34. </xsl:variable>
  35. <xsl:call-template name="make.lots">
  36. <xsl:with-param name="toc.params" select="$toc.params"/>
  37. <xsl:with-param name="toc">
  38. <xsl:call-template name="set.toc">
  39. <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
  40. </xsl:call-template>
  41. </xsl:with-param>
  42. </xsl:call-template>
  43. <xsl:apply-templates/>
  44. </xsl:element>
  45. </xsl:template>
  46. <xsl:template match="set/setinfo"/>
  47. <xsl:template match="set/title"/>
  48. <xsl:template match="set/titleabbrev"/>
  49. <xsl:template match="set/subtitle"/>
  50. <!-- ==================================================================== -->
  51. <xsl:template match="book">
  52. <xsl:call-template name="id.warning"/>
  53. <div>
  54. <xsl:apply-templates select="." mode="common.html.attributes"/>
  55. <xsl:call-template name="id.attribute">
  56. <xsl:with-param name="conditional" select="0"/>
  57. </xsl:call-template>
  58. <xsl:call-template name="book.titlepage"/>
  59. <xsl:apply-templates select="dedication" mode="dedication"/>
  60. <xsl:apply-templates select="acknowledgements" mode="acknowledgements"/>
  61. <xsl:variable name="toc.params">
  62. <xsl:call-template name="find.path.params">
  63. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  64. </xsl:call-template>
  65. </xsl:variable>
  66. <xsl:call-template name="make.lots">
  67. <xsl:with-param name="toc.params" select="$toc.params"/>
  68. <xsl:with-param name="toc">
  69. <xsl:call-template name="division.toc">
  70. <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
  71. </xsl:call-template>
  72. </xsl:with-param>
  73. </xsl:call-template>
  74. <xsl:apply-templates/>
  75. </div>
  76. </xsl:template>
  77. <xsl:template match="book/bookinfo"/>
  78. <xsl:template match="book/info"/>
  79. <xsl:template match="book/title"/>
  80. <xsl:template match="book/titleabbrev"/>
  81. <xsl:template match="book/subtitle"/>
  82. <!-- ==================================================================== -->
  83. <xsl:template match="part">
  84. <xsl:call-template name="id.warning"/>
  85. <div>
  86. <xsl:apply-templates select="." mode="common.html.attributes"/>
  87. <xsl:call-template name="id.attribute">
  88. <xsl:with-param name="conditional" select="0"/>
  89. </xsl:call-template>
  90. <xsl:call-template name="part.titlepage"/>
  91. <xsl:variable name="toc.params">
  92. <xsl:call-template name="find.path.params">
  93. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  94. </xsl:call-template>
  95. </xsl:variable>
  96. <xsl:if test="not(partintro) and contains($toc.params, 'toc')">
  97. <xsl:call-template name="division.toc"/>
  98. </xsl:if>
  99. <xsl:apply-templates/>
  100. </div>
  101. </xsl:template>
  102. <xsl:template match="part" mode="make.part.toc">
  103. <xsl:call-template name="division.toc"/>
  104. </xsl:template>
  105. <xsl:template match="reference" mode="make.part.toc">
  106. <xsl:call-template name="division.toc"/>
  107. </xsl:template>
  108. <xsl:template match="part/docinfo"/>
  109. <xsl:template match="part/partinfo"/>
  110. <xsl:template match="part/info"/>
  111. <xsl:template match="part/title"/>
  112. <xsl:template match="part/titleabbrev"/>
  113. <xsl:template match="part/subtitle"/>
  114. <xsl:template match="partintro">
  115. <xsl:call-template name="id.warning"/>
  116. <div>
  117. <xsl:call-template name="common.html.attributes"/>
  118. <xsl:call-template name="id.attribute">
  119. <xsl:with-param name="conditional" select="0"/>
  120. </xsl:call-template>
  121. <xsl:call-template name="partintro.titlepage"/>
  122. <xsl:apply-templates/>
  123. <xsl:variable name="toc.params">
  124. <xsl:call-template name="find.path.params">
  125. <xsl:with-param name="node" select="parent::*"/>
  126. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  127. </xsl:call-template>
  128. </xsl:variable>
  129. <xsl:if test="contains($toc.params, 'toc')">
  130. <!-- not ancestor::part because partintro appears in reference -->
  131. <xsl:apply-templates select="parent::*" mode="make.part.toc"/>
  132. </xsl:if>
  133. <xsl:call-template name="process.footnotes"/>
  134. </div>
  135. </xsl:template>
  136. <xsl:template match="partintro/title"/>
  137. <xsl:template match="partintro/titleabbrev"/>
  138. <xsl:template match="partintro/subtitle"/>
  139. <xsl:template match="partintro/title" mode="partintro.title.mode">
  140. <h2>
  141. <xsl:apply-templates/>
  142. </h2>
  143. </xsl:template>
  144. <xsl:template match="partintro/subtitle" mode="partintro.title.mode">
  145. <h3>
  146. <em xmlns:xslo="http://www.w3.org/1999/XSL/Transform"><xsl:apply-templates/></em>
  147. </h3>
  148. </xsl:template>
  149. <!-- ==================================================================== -->
  150. <xsl:template match="book" mode="division.number">
  151. <xsl:number from="set" count="book" format="1."/>
  152. </xsl:template>
  153. <xsl:template match="part" mode="division.number">
  154. <xsl:number from="book" count="part" format="I."/>
  155. </xsl:template>
  156. <!-- ==================================================================== -->
  157. <xsl:template name="division.title">
  158. <xsl:param name="node" select="."/>
  159. <h1>
  160. <xsl:attribute name="class">title</xsl:attribute>
  161. <xsl:call-template name="anchor">
  162. <xsl:with-param name="node" select="$node"/>
  163. <xsl:with-param name="conditional" select="0"/>
  164. </xsl:call-template>
  165. <xsl:apply-templates select="$node" mode="object.title.markup">
  166. <xsl:with-param name="allow-anchors" select="1"/>
  167. </xsl:apply-templates>
  168. </h1>
  169. </xsl:template>
  170. </xsl:stylesheet>