docbook_xsl_wrapper 0.1.2 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/CHANGELOG +41 -0
  4. data/README.md +9 -17
  5. data/bin/docbook_xsl_wrapper +9 -14
  6. data/docbook_xsl_wrapper.gemspec +8 -7
  7. data/lib/docbook_xsl_wrapper.rb +24 -1
  8. data/lib/docbook_xsl_wrapper/epub.rb +124 -122
  9. data/lib/docbook_xsl_wrapper/options.rb +1 -1
  10. data/lib/docbook_xsl_wrapper/validate.rb +22 -0
  11. data/lib/docbook_xsl_wrapper/version.rb +1 -1
  12. data/schema/docbookxi.rng +18654 -0
  13. data/spec/docbook_xsl_wrapper/validate_spec.rb +64 -0
  14. data/xsl/AUTHORS +4 -0
  15. data/xsl/COPYING +48 -0
  16. data/xsl/REVISION +1 -0
  17. data/xsl/VERSION.xsl +115 -0
  18. data/xsl/common/addns.xsl +124 -0
  19. data/xsl/common/af.xml +1272 -0
  20. data/xsl/common/am.xml +1272 -0
  21. data/xsl/common/ar.xml +1272 -0
  22. data/xsl/common/as.xml +703 -0
  23. data/xsl/common/ast.xml +703 -0
  24. data/xsl/common/autoidx-kimber.xsl +45 -0
  25. data/xsl/common/autoidx-kosek.xsl +155 -0
  26. data/xsl/common/az.xml +715 -0
  27. data/xsl/common/bg.xml +767 -0
  28. data/xsl/common/bn.xml +1272 -0
  29. data/xsl/common/bn_in.xml +703 -0
  30. data/xsl/common/bs.xml +705 -0
  31. data/xsl/common/ca.xml +703 -0
  32. data/xsl/common/charmap.xsl +222 -0
  33. data/xsl/common/common.xsl +2129 -0
  34. data/xsl/common/cs.xml +743 -0
  35. data/xsl/common/cy.xml +1288 -0
  36. data/xsl/common/da.xml +707 -0
  37. data/xsl/common/de.xml +709 -0
  38. data/xsl/common/el.xml +772 -0
  39. data/xsl/common/en.xml +1272 -0
  40. data/xsl/common/entities.ent +67 -0
  41. data/xsl/common/eo.xml +1272 -0
  42. data/xsl/common/es.xml +719 -0
  43. data/xsl/common/et.xml +1272 -0
  44. data/xsl/common/eu.xml +1272 -0
  45. data/xsl/common/fa.xml +703 -0
  46. data/xsl/common/fi.xml +713 -0
  47. data/xsl/common/fr.xml +733 -0
  48. data/xsl/common/ga.xml +1272 -0
  49. data/xsl/common/gentext.xsl +855 -0
  50. data/xsl/common/gl.xml +1272 -0
  51. data/xsl/common/gu.xml +703 -0
  52. data/xsl/common/he.xml +1272 -0
  53. data/xsl/common/hi.xml +703 -0
  54. data/xsl/common/hr.xml +705 -0
  55. data/xsl/common/hu.xml +721 -0
  56. data/xsl/common/id.xml +1272 -0
  57. data/xsl/common/insertfile.xsl +113 -0
  58. data/xsl/common/is.xml +715 -0
  59. data/xsl/common/it.xml +1272 -0
  60. data/xsl/common/ja.xml +703 -0
  61. data/xsl/common/ka.xml +743 -0
  62. data/xsl/common/kn.xml +1272 -0
  63. data/xsl/common/ko.xml +1272 -0
  64. data/xsl/common/ky.xml +775 -0
  65. data/xsl/common/l10n.dtd +64 -0
  66. data/xsl/common/l10n.xml +78 -0
  67. data/xsl/common/l10n.xsl +598 -0
  68. data/xsl/common/la.xml +1272 -0
  69. data/xsl/common/labels.xsl +933 -0
  70. data/xsl/common/lt.xml +721 -0
  71. data/xsl/common/lv.xml +1272 -0
  72. data/xsl/common/ml.xml +703 -0
  73. data/xsl/common/mn.xml +773 -0
  74. data/xsl/common/mr.xml +703 -0
  75. data/xsl/common/nb.xml +1272 -0
  76. data/xsl/common/nds.xml +709 -0
  77. data/xsl/common/nl.xml +703 -0
  78. data/xsl/common/nn.xml +1272 -0
  79. data/xsl/common/olink.xsl +1284 -0
  80. data/xsl/common/or.xml +1272 -0
  81. data/xsl/common/pa.xml +703 -0
  82. data/xsl/common/pi.xml +168 -0
  83. data/xsl/common/pi.xsl +347 -0
  84. data/xsl/common/pl.xml +721 -0
  85. data/xsl/common/pt.xml +1272 -0
  86. data/xsl/common/pt_br.xml +1272 -0
  87. data/xsl/common/refentry.xsl +1353 -0
  88. data/xsl/common/ro.xml +1272 -0
  89. data/xsl/common/ru.xml +769 -0
  90. data/xsl/common/sk.xml +1272 -0
  91. data/xsl/common/sl.xml +1272 -0
  92. data/xsl/common/sq.xml +1272 -0
  93. data/xsl/common/sr.xml +763 -0
  94. data/xsl/common/sr_Latn.xml +722 -0
  95. data/xsl/common/subtitles.xsl +181 -0
  96. data/xsl/common/sv.xml +707 -0
  97. data/xsl/common/ta.xml +703 -0
  98. data/xsl/common/table.xsl +515 -0
  99. data/xsl/common/targetdatabase.dtd +49 -0
  100. data/xsl/common/targets.xsl +338 -0
  101. data/xsl/common/te.xml +703 -0
  102. data/xsl/common/th.xml +1272 -0
  103. data/xsl/common/titles.xsl +850 -0
  104. data/xsl/common/tl.xml +1272 -0
  105. data/xsl/common/tr.xml +709 -0
  106. data/xsl/common/uk.xml +769 -0
  107. data/xsl/common/ur.xml +705 -0
  108. data/xsl/common/utility.xsl +291 -0
  109. data/xsl/common/vi.xml +1272 -0
  110. data/xsl/common/xh.xml +1272 -0
  111. data/xsl/common/zh.xml +703 -0
  112. data/xsl/common/zh_cn.xml +703 -0
  113. data/xsl/common/zh_tw.xml +703 -0
  114. data/xsl/epub/docbook.xsl +1769 -0
  115. data/xsl/epub3/chunk.xsl +30 -0
  116. data/xsl/epub3/docbook-epub.css.xml +142 -0
  117. data/xsl/epub3/docbook.xsl +20 -0
  118. data/xsl/epub3/epub3-chunk-mods.xsl +52 -0
  119. data/xsl/epub3/epub3-element-mods.xsl +2533 -0
  120. data/xsl/epub3/titlepage.templates.xml +712 -0
  121. data/xsl/epub3/titlepage.templates.xsl +3842 -0
  122. data/xsl/lib/lib.xsl +533 -0
  123. data/xsl/xhtml/admon.xsl +142 -0
  124. data/xsl/xhtml/annotations.xsl +160 -0
  125. data/xsl/xhtml/autoidx.xsl +831 -0
  126. data/xsl/xhtml/autotoc.xsl +706 -0
  127. data/xsl/xhtml/biblio-iso690.xsl +1302 -0
  128. data/xsl/xhtml/biblio.xsl +1371 -0
  129. data/xsl/xhtml/block.xsl +584 -0
  130. data/xsl/xhtml/callout.xsl +210 -0
  131. data/xsl/xhtml/chunk-code.xsl +675 -0
  132. data/xsl/xhtml/chunk-common.xsl +1627 -0
  133. data/xsl/xhtml/chunker.xsl +317 -0
  134. data/xsl/xhtml/component.xsl +440 -0
  135. data/xsl/xhtml/division.xsl +214 -0
  136. data/xsl/xhtml/ebnf.xsl +331 -0
  137. data/xsl/xhtml/footnote.xsl +346 -0
  138. data/xsl/xhtml/formal.xsl +496 -0
  139. data/xsl/xhtml/glossary.xsl +602 -0
  140. data/xsl/xhtml/graphics.xsl +1537 -0
  141. data/xsl/xhtml/html-rtf.xsl +321 -0
  142. data/xsl/xhtml/html.xsl +690 -0
  143. data/xsl/xhtml/htmltbl.xsl +102 -0
  144. data/xsl/xhtml/index.xsl +264 -0
  145. data/xsl/xhtml/info.xsl +48 -0
  146. data/xsl/xhtml/inline.xsl +1508 -0
  147. data/xsl/xhtml/its.xsl +109 -0
  148. data/xsl/xhtml/keywords.xsl +38 -0
  149. data/xsl/xhtml/lists.xsl +1227 -0
  150. data/xsl/xhtml/math.xsl +286 -0
  151. data/xsl/xhtml/param.xsl +449 -0
  152. data/xsl/xhtml/pi.xsl +1237 -0
  153. data/xsl/xhtml/qandaset.xsl +440 -0
  154. data/xsl/xhtml/refentry.xsl +307 -0
  155. data/xsl/xhtml/sections.xsl +564 -0
  156. data/xsl/xhtml/synop.xsl +1623 -0
  157. data/xsl/xhtml/table.xsl +1179 -0
  158. data/xsl/xhtml/task.xsl +76 -0
  159. data/xsl/xhtml/titlepage.templates.xsl +4005 -0
  160. data/xsl/xhtml/titlepage.xsl +1108 -0
  161. data/xsl/xhtml/toc.xsl +334 -0
  162. data/xsl/xhtml/verbatim.xsl +389 -0
  163. data/xsl/xhtml/xref.xsl +1268 -0
  164. data/xsl/xhtml5/docbook.xsl +22 -0
  165. data/xsl/xhtml5/html5-chunk-mods.xsl +112 -0
  166. data/xsl/xhtml5/html5-element-mods.xsl +791 -0
  167. data/xsl/xhtml5/xhtml-docbook.xsl +531 -0
  168. metadata +207 -27
  169. data/.rvmrc +0 -48
  170. data/xslt/obfuscate.xsl +0 -12
@@ -0,0 +1,564 @@
1
+ <?xml version="1.0" encoding="ASCII"?>
2
+ <!--This file was created automatically by html2xhtml-->
3
+ <!--from the HTML stylesheets.-->
4
+ <xsl:stylesheet exclude-result-prefixes="d"
5
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d="http://docbook.org/ns/docbook"
6
+ xmlns="http://www.w3.org/1999/xhtml" version="1.0">
7
+
8
+ <!-- ********************************************************************
9
+ $Id: sections.xsl 9392 2012-06-02 20:10:58Z bobstayton $
10
+ ********************************************************************
11
+
12
+ This file is part of the XSL DocBook Stylesheet distribution.
13
+ See ../README or http://docbook.sf.net/release/xsl/current/ for
14
+ copyright and other information.
15
+
16
+ ******************************************************************** -->
17
+
18
+ <!-- ==================================================================== -->
19
+
20
+ <xsl:template match="d:section">
21
+ <xsl:variable name="depth" select="count(ancestor::d:section)+1"/>
22
+
23
+ <xsl:call-template name="id.warning"/>
24
+
25
+ <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
26
+ <xsl:call-template name="common.html.attributes">
27
+ <xsl:with-param name="inherit" select="1"/>
28
+ </xsl:call-template>
29
+ <xsl:call-template name="id.attribute">
30
+ <xsl:with-param name="conditional" select="0"/>
31
+ </xsl:call-template>
32
+ <xsl:call-template name="section.titlepage"/>
33
+
34
+ <xsl:variable name="toc.params">
35
+ <xsl:call-template name="find.path.params">
36
+ <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
37
+ </xsl:call-template>
38
+ </xsl:variable>
39
+
40
+ <xsl:if test="contains($toc.params, 'toc') and $depth &lt;= $generate.section.toc.level">
41
+ <xsl:call-template name="section.toc">
42
+ <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
43
+ </xsl:call-template>
44
+ <xsl:call-template name="section.toc.separator"/>
45
+ </xsl:if>
46
+ <xsl:apply-templates/>
47
+ <xsl:call-template name="process.chunk.footnotes"/>
48
+ </xsl:element>
49
+ </xsl:template>
50
+
51
+ <xsl:template name="section.title">
52
+ <!-- the context node should be the title of a section when called -->
53
+ <xsl:variable name="section" select="(ancestor::d:section |ancestor::d:simplesect |ancestor::d:sect1 |ancestor::d:sect2 |ancestor::d:sect3 |ancestor::d:sect4 |ancestor::d:sect5)[last()]"/>
54
+
55
+ <xsl:variable name="renderas">
56
+ <xsl:choose>
57
+ <xsl:when test="$section/@renderas = 'sect1'">1</xsl:when>
58
+ <xsl:when test="$section/@renderas = 'sect2'">2</xsl:when>
59
+ <xsl:when test="$section/@renderas = 'sect3'">3</xsl:when>
60
+ <xsl:when test="$section/@renderas = 'sect4'">4</xsl:when>
61
+ <xsl:when test="$section/@renderas = 'sect5'">5</xsl:when>
62
+ <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
63
+ </xsl:choose>
64
+ </xsl:variable>
65
+
66
+ <xsl:variable name="level">
67
+ <xsl:choose>
68
+ <xsl:when test="$renderas != ''">
69
+ <xsl:value-of select="$renderas"/>
70
+ </xsl:when>
71
+ <xsl:otherwise>
72
+ <xsl:call-template name="section.level">
73
+ <xsl:with-param name="node" select="$section"/>
74
+ </xsl:call-template>
75
+ </xsl:otherwise>
76
+ </xsl:choose>
77
+ </xsl:variable>
78
+
79
+ <xsl:call-template name="section.heading">
80
+ <xsl:with-param name="section" select="$section"/>
81
+ <xsl:with-param name="level" select="$level"/>
82
+ <xsl:with-param name="title">
83
+ <xsl:apply-templates select="$section" mode="object.title.markup">
84
+ <xsl:with-param name="allow-anchors" select="1"/>
85
+ </xsl:apply-templates>
86
+ </xsl:with-param>
87
+ </xsl:call-template>
88
+ </xsl:template>
89
+
90
+ <xsl:template match="d:section/d:title |d:section/d:info/d:title |d:sectioninfo/d:title" mode="titlepage.mode" priority="2">
91
+ <xsl:call-template name="section.title"/>
92
+ </xsl:template>
93
+
94
+ <xsl:template match="d:sect1">
95
+ <xsl:call-template name="id.warning"/>
96
+
97
+ <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
98
+ <xsl:call-template name="common.html.attributes">
99
+ <xsl:with-param name="inherit" select="1"/>
100
+ </xsl:call-template>
101
+ <xsl:call-template name="id.attribute">
102
+ <xsl:with-param name="conditional" select="0"/>
103
+ </xsl:call-template>
104
+
105
+ <xsl:choose>
106
+ <xsl:when test="@renderas = 'sect2'">
107
+ <xsl:call-template name="sect2.titlepage"/>
108
+ </xsl:when>
109
+ <xsl:when test="@renderas = 'sect3'">
110
+ <xsl:call-template name="sect3.titlepage"/>
111
+ </xsl:when>
112
+ <xsl:when test="@renderas = 'sect4'">
113
+ <xsl:call-template name="sect4.titlepage"/>
114
+ </xsl:when>
115
+ <xsl:when test="@renderas = 'sect5'">
116
+ <xsl:call-template name="sect5.titlepage"/>
117
+ </xsl:when>
118
+ <xsl:otherwise>
119
+ <xsl:call-template name="sect1.titlepage"/>
120
+ </xsl:otherwise>
121
+ </xsl:choose>
122
+
123
+ <xsl:variable name="toc.params">
124
+ <xsl:call-template name="find.path.params">
125
+ <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
126
+ </xsl:call-template>
127
+ </xsl:variable>
128
+
129
+ <xsl:if test="contains($toc.params, 'toc') and $generate.section.toc.level &gt;= 1">
130
+ <xsl:call-template name="section.toc">
131
+ <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
132
+ </xsl:call-template>
133
+ <xsl:call-template name="section.toc.separator"/>
134
+ </xsl:if>
135
+ <xsl:apply-templates/>
136
+ <xsl:call-template name="process.chunk.footnotes"/>
137
+ </xsl:element>
138
+ </xsl:template>
139
+
140
+ <xsl:template match="d:sect1/d:title |d:sect1/d:info/d:title |d:sect1info/d:title" mode="titlepage.mode" priority="2">
141
+ <xsl:call-template name="section.title"/>
142
+ </xsl:template>
143
+
144
+ <xsl:template match="d:sect2">
145
+ <xsl:call-template name="id.warning"/>
146
+
147
+ <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
148
+ <xsl:call-template name="common.html.attributes">
149
+ <xsl:with-param name="inherit" select="1"/>
150
+ </xsl:call-template>
151
+ <xsl:call-template name="id.attribute">
152
+ <xsl:with-param name="conditional" select="0"/>
153
+ </xsl:call-template>
154
+
155
+ <xsl:choose>
156
+ <xsl:when test="@renderas = 'sect1'">
157
+ <xsl:call-template name="sect1.titlepage"/>
158
+ </xsl:when>
159
+ <xsl:when test="@renderas = 'sect3'">
160
+ <xsl:call-template name="sect3.titlepage"/>
161
+ </xsl:when>
162
+ <xsl:when test="@renderas = 'sect4'">
163
+ <xsl:call-template name="sect4.titlepage"/>
164
+ </xsl:when>
165
+ <xsl:when test="@renderas = 'sect5'">
166
+ <xsl:call-template name="sect5.titlepage"/>
167
+ </xsl:when>
168
+ <xsl:otherwise>
169
+ <xsl:call-template name="sect2.titlepage"/>
170
+ </xsl:otherwise>
171
+ </xsl:choose>
172
+
173
+ <xsl:variable name="toc.params">
174
+ <xsl:call-template name="find.path.params">
175
+ <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
176
+ </xsl:call-template>
177
+ </xsl:variable>
178
+
179
+ <xsl:if test="contains($toc.params, 'toc') and $generate.section.toc.level &gt;= 2">
180
+ <xsl:call-template name="section.toc">
181
+ <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
182
+ </xsl:call-template>
183
+ <xsl:call-template name="section.toc.separator"/>
184
+ </xsl:if>
185
+ <xsl:apply-templates/>
186
+ <xsl:call-template name="process.chunk.footnotes"/>
187
+ </xsl:element>
188
+ </xsl:template>
189
+
190
+ <xsl:template match="d:sect2/d:title |d:sect2/d:info/d:title |d:sect2info/d:title" mode="titlepage.mode" priority="2">
191
+ <xsl:call-template name="section.title"/>
192
+ </xsl:template>
193
+
194
+ <xsl:template match="d:sect3">
195
+ <xsl:call-template name="id.warning"/>
196
+
197
+ <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
198
+ <xsl:call-template name="common.html.attributes">
199
+ <xsl:with-param name="inherit" select="1"/>
200
+ </xsl:call-template>
201
+ <xsl:call-template name="id.attribute">
202
+ <xsl:with-param name="conditional" select="0"/>
203
+ </xsl:call-template>
204
+
205
+ <xsl:choose>
206
+ <xsl:when test="@renderas = 'sect1'">
207
+ <xsl:call-template name="sect1.titlepage"/>
208
+ </xsl:when>
209
+ <xsl:when test="@renderas = 'sect2'">
210
+ <xsl:call-template name="sect2.titlepage"/>
211
+ </xsl:when>
212
+ <xsl:when test="@renderas = 'sect4'">
213
+ <xsl:call-template name="sect4.titlepage"/>
214
+ </xsl:when>
215
+ <xsl:when test="@renderas = 'sect5'">
216
+ <xsl:call-template name="sect5.titlepage"/>
217
+ </xsl:when>
218
+ <xsl:otherwise>
219
+ <xsl:call-template name="sect3.titlepage"/>
220
+ </xsl:otherwise>
221
+ </xsl:choose>
222
+
223
+ <xsl:variable name="toc.params">
224
+ <xsl:call-template name="find.path.params">
225
+ <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
226
+ </xsl:call-template>
227
+ </xsl:variable>
228
+
229
+ <xsl:if test="contains($toc.params, 'toc') and $generate.section.toc.level &gt;= 3">
230
+ <xsl:call-template name="section.toc">
231
+ <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
232
+ </xsl:call-template>
233
+ <xsl:call-template name="section.toc.separator"/>
234
+ </xsl:if>
235
+ <xsl:apply-templates/>
236
+ <xsl:call-template name="process.chunk.footnotes"/>
237
+ </xsl:element>
238
+ </xsl:template>
239
+
240
+ <xsl:template match="d:sect3/d:title |d:sect3/d:info/d:title |d:sect3info/d:title" mode="titlepage.mode" priority="2">
241
+ <xsl:call-template name="section.title"/>
242
+ </xsl:template>
243
+
244
+ <xsl:template match="d:sect4">
245
+ <xsl:call-template name="id.warning"/>
246
+
247
+ <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
248
+ <xsl:call-template name="common.html.attributes">
249
+ <xsl:with-param name="inherit" select="1"/>
250
+ </xsl:call-template>
251
+ <xsl:call-template name="id.attribute">
252
+ <xsl:with-param name="conditional" select="0"/>
253
+ </xsl:call-template>
254
+
255
+ <xsl:choose>
256
+ <xsl:when test="@renderas = 'sect1'">
257
+ <xsl:call-template name="sect1.titlepage"/>
258
+ </xsl:when>
259
+ <xsl:when test="@renderas = 'sect2'">
260
+ <xsl:call-template name="sect2.titlepage"/>
261
+ </xsl:when>
262
+ <xsl:when test="@renderas = 'sect3'">
263
+ <xsl:call-template name="sect3.titlepage"/>
264
+ </xsl:when>
265
+ <xsl:when test="@renderas = 'sect5'">
266
+ <xsl:call-template name="sect5.titlepage"/>
267
+ </xsl:when>
268
+ <xsl:otherwise>
269
+ <xsl:call-template name="sect4.titlepage"/>
270
+ </xsl:otherwise>
271
+ </xsl:choose>
272
+
273
+ <xsl:variable name="toc.params">
274
+ <xsl:call-template name="find.path.params">
275
+ <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
276
+ </xsl:call-template>
277
+ </xsl:variable>
278
+
279
+ <xsl:if test="contains($toc.params, 'toc') and $generate.section.toc.level &gt;= 4">
280
+ <xsl:call-template name="section.toc">
281
+ <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
282
+ </xsl:call-template>
283
+ <xsl:call-template name="section.toc.separator"/>
284
+ </xsl:if>
285
+ <xsl:apply-templates/>
286
+ <xsl:call-template name="process.chunk.footnotes"/>
287
+ </xsl:element>
288
+ </xsl:template>
289
+
290
+ <xsl:template match="d:sect4/d:title |d:sect4/d:info/d:title |d:sect4info/d:title" mode="titlepage.mode" priority="2">
291
+ <xsl:call-template name="section.title"/>
292
+ </xsl:template>
293
+
294
+ <xsl:template match="d:sect5">
295
+ <xsl:call-template name="id.warning"/>
296
+
297
+ <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
298
+ <xsl:call-template name="common.html.attributes">
299
+ <xsl:with-param name="inherit" select="1"/>
300
+ </xsl:call-template>
301
+ <xsl:call-template name="id.attribute">
302
+ <xsl:with-param name="conditional" select="0"/>
303
+ </xsl:call-template>
304
+
305
+ <xsl:choose>
306
+ <xsl:when test="@renderas = 'sect1'">
307
+ <xsl:call-template name="sect1.titlepage"/>
308
+ </xsl:when>
309
+ <xsl:when test="@renderas = 'sect2'">
310
+ <xsl:call-template name="sect2.titlepage"/>
311
+ </xsl:when>
312
+ <xsl:when test="@renderas = 'sect3'">
313
+ <xsl:call-template name="sect3.titlepage"/>
314
+ </xsl:when>
315
+ <xsl:when test="@renderas = 'sect4'">
316
+ <xsl:call-template name="sect4.titlepage"/>
317
+ </xsl:when>
318
+ <xsl:otherwise>
319
+ <xsl:call-template name="sect5.titlepage"/>
320
+ </xsl:otherwise>
321
+ </xsl:choose>
322
+
323
+ <xsl:variable name="toc.params">
324
+ <xsl:call-template name="find.path.params">
325
+ <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
326
+ </xsl:call-template>
327
+ </xsl:variable>
328
+
329
+ <xsl:if test="contains($toc.params, 'toc') and $generate.section.toc.level &gt;= 5">
330
+ <xsl:call-template name="section.toc">
331
+ <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
332
+ </xsl:call-template>
333
+ <xsl:call-template name="section.toc.separator"/>
334
+ </xsl:if>
335
+ <xsl:apply-templates/>
336
+ <xsl:call-template name="process.chunk.footnotes"/>
337
+ </xsl:element>
338
+ </xsl:template>
339
+
340
+ <xsl:template match="d:sect5/d:title |d:sect5/d:info/d:title |d:sect5info/d:title" mode="titlepage.mode" priority="2">
341
+ <xsl:call-template name="section.title"/>
342
+ </xsl:template>
343
+
344
+ <xsl:template match="d:simplesect">
345
+ <xsl:call-template name="id.warning"/>
346
+
347
+ <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
348
+ <xsl:call-template name="common.html.attributes">
349
+ <xsl:with-param name="inherit" select="1"/>
350
+ </xsl:call-template>
351
+ <xsl:call-template name="id.attribute">
352
+ <xsl:with-param name="conditional" select="0"/>
353
+ </xsl:call-template>
354
+
355
+ <xsl:call-template name="simplesect.titlepage"/>
356
+ <xsl:apply-templates/>
357
+ </xsl:element>
358
+ </xsl:template>
359
+
360
+ <xsl:template match="d:simplesect/d:title|d:simplesect/d:info/d:title" mode="titlepage.mode" priority="2">
361
+ <xsl:call-template name="section.title"/>
362
+ </xsl:template>
363
+
364
+ <xsl:template match="d:section/d:title"/>
365
+ <xsl:template match="d:section/d:titleabbrev"/>
366
+ <xsl:template match="d:section/d:subtitle"/>
367
+ <xsl:template match="d:sectioninfo"/>
368
+ <xsl:template match="d:section/d:info"/>
369
+
370
+ <xsl:template match="d:sect1/d:title"/>
371
+ <xsl:template match="d:sect1/d:titleabbrev"/>
372
+ <xsl:template match="d:sect1/d:subtitle"/>
373
+ <xsl:template match="d:sect1info"/>
374
+ <xsl:template match="d:sect1/d:info"/>
375
+
376
+ <xsl:template match="d:sect2/d:title"/>
377
+ <xsl:template match="d:sect2/d:subtitle"/>
378
+ <xsl:template match="d:sect2/d:titleabbrev"/>
379
+ <xsl:template match="d:sect2info"/>
380
+ <xsl:template match="d:sect2/d:info"/>
381
+
382
+ <xsl:template match="d:sect3/d:title"/>
383
+ <xsl:template match="d:sect3/d:subtitle"/>
384
+ <xsl:template match="d:sect3/d:titleabbrev"/>
385
+ <xsl:template match="d:sect3info"/>
386
+ <xsl:template match="d:sect3/d:info"/>
387
+
388
+ <xsl:template match="d:sect4/d:title"/>
389
+ <xsl:template match="d:sect4/d:subtitle"/>
390
+ <xsl:template match="d:sect4/d:titleabbrev"/>
391
+ <xsl:template match="d:sect4info"/>
392
+ <xsl:template match="d:sect4/d:info"/>
393
+
394
+ <xsl:template match="d:sect5/d:title"/>
395
+ <xsl:template match="d:sect5/d:subtitle"/>
396
+ <xsl:template match="d:sect5/d:titleabbrev"/>
397
+ <xsl:template match="d:sect5info"/>
398
+ <xsl:template match="d:sect5/d:info"/>
399
+
400
+ <xsl:template match="d:simplesect/d:title"/>
401
+ <xsl:template match="d:simplesect/d:subtitle"/>
402
+ <xsl:template match="d:simplesect/d:titleabbrev"/>
403
+ <xsl:template match="d:simplesect/d:info"/>
404
+
405
+ <!-- ==================================================================== -->
406
+
407
+ <xsl:template name="section.heading">
408
+ <xsl:param name="section" select="."/>
409
+ <xsl:param name="level" select="1"/>
410
+ <xsl:param name="allow-anchors" select="1"/>
411
+ <xsl:param name="title"/>
412
+ <xsl:param name="class" select="'title'"/>
413
+
414
+ <xsl:variable name="id">
415
+ <xsl:choose>
416
+ <!-- Make sure the subtitle doesn't get the same id as the title -->
417
+ <xsl:when test="self::d:subtitle">
418
+ <xsl:call-template name="object.id">
419
+ <xsl:with-param name="object" select="."/>
420
+ </xsl:call-template>
421
+ </xsl:when>
422
+ <!-- if title is in an *info wrapper, get the grandparent -->
423
+ <xsl:when test="contains(local-name(..), 'info')">
424
+ <xsl:call-template name="object.id">
425
+ <xsl:with-param name="object" select="../.."/>
426
+ </xsl:call-template>
427
+ </xsl:when>
428
+ <xsl:otherwise>
429
+ <xsl:call-template name="object.id">
430
+ <xsl:with-param name="object" select=".."/>
431
+ </xsl:call-template>
432
+ </xsl:otherwise>
433
+ </xsl:choose>
434
+ </xsl:variable>
435
+
436
+ <!-- HTML H level is one higher than section level -->
437
+ <xsl:variable name="hlevel">
438
+ <xsl:choose>
439
+ <!-- highest valid HTML H level is H6; so anything nested deeper
440
+ than 5 levels down just becomes H6 -->
441
+ <xsl:when test="$level &gt; 5">6</xsl:when>
442
+ <xsl:otherwise>
443
+ <xsl:value-of select="$level + 1"/>
444
+ </xsl:otherwise>
445
+ </xsl:choose>
446
+ </xsl:variable>
447
+ <xsl:element name="h{$hlevel}" namespace="http://www.w3.org/1999/xhtml">
448
+ <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
449
+ <xsl:if test="$css.decoration != '0'">
450
+ <xsl:if test="$hlevel&lt;3">
451
+ <xsl:attribute name="style">clear: both</xsl:attribute>
452
+ </xsl:if>
453
+ </xsl:if>
454
+ <xsl:if test="$allow-anchors != 0">
455
+ <xsl:call-template name="anchor">
456
+ <xsl:with-param name="node" select="$section"/>
457
+ <xsl:with-param name="conditional" select="0"/>
458
+ </xsl:call-template>
459
+ </xsl:if>
460
+ <xsl:copy-of select="$title"/>
461
+ </xsl:element>
462
+ </xsl:template>
463
+
464
+ <!-- ==================================================================== -->
465
+
466
+ <xsl:template match="d:bridgehead">
467
+ <xsl:variable name="container" select="(ancestor::d:appendix |ancestor::d:article |ancestor::d:bibliography |ancestor::d:chapter |ancestor::d:glossary |ancestor::d:glossdiv |ancestor::d:index |ancestor::d:partintro |ancestor::d:preface |ancestor::d:refsect1 |ancestor::d:refsect2 |ancestor::d:refsect3 |ancestor::d:sect1 |ancestor::d:sect2 |ancestor::d:sect3 |ancestor::d:sect4 |ancestor::d:sect5 |ancestor::d:section |ancestor::d:setindex |ancestor::d:simplesect)[last()]"/>
468
+
469
+ <xsl:variable name="clevel">
470
+ <xsl:choose>
471
+ <xsl:when test="local-name($container) = 'appendix' or local-name($container) = 'chapter' or local-name($container) = 'article' or local-name($container) = 'bibliography' or local-name($container) = 'glossary' or local-name($container) = 'index' or local-name($container) = 'partintro' or local-name($container) = 'preface' or local-name($container) = 'setindex'">1</xsl:when>
472
+ <xsl:when test="local-name($container) = 'glossdiv'">
473
+ <xsl:value-of select="count(ancestor::d:glossdiv)+1"/>
474
+ </xsl:when>
475
+ <xsl:when test="local-name($container) = 'sect1' or local-name($container) = 'sect2' or local-name($container) = 'sect3' or local-name($container) = 'sect4' or local-name($container) = 'sect5' or local-name($container) = 'refsect1' or local-name($container) = 'refsect2' or local-name($container) = 'refsect3' or local-name($container) = 'section' or local-name($container) = 'simplesect'">
476
+ <xsl:variable name="slevel">
477
+ <xsl:call-template name="section.level">
478
+ <xsl:with-param name="node" select="$container"/>
479
+ </xsl:call-template>
480
+ </xsl:variable>
481
+ <xsl:value-of select="$slevel + 1"/>
482
+ </xsl:when>
483
+ <xsl:otherwise>1</xsl:otherwise>
484
+ </xsl:choose>
485
+ </xsl:variable>
486
+
487
+ <!-- HTML H level is one higher than section level -->
488
+ <xsl:variable name="hlevel">
489
+ <xsl:choose>
490
+ <xsl:when test="@renderas = 'sect1'">2</xsl:when>
491
+ <xsl:when test="@renderas = 'sect2'">3</xsl:when>
492
+ <xsl:when test="@renderas = 'sect3'">4</xsl:when>
493
+ <xsl:when test="@renderas = 'sect4'">5</xsl:when>
494
+ <xsl:when test="@renderas = 'sect5'">6</xsl:when>
495
+ <xsl:otherwise>
496
+ <xsl:value-of select="$clevel + 1"/>
497
+ </xsl:otherwise>
498
+ </xsl:choose>
499
+ </xsl:variable>
500
+
501
+ <xsl:element name="h{$hlevel}" namespace="http://www.w3.org/1999/xhtml">
502
+ <xsl:call-template name="id.attribute">
503
+ <xsl:with-param name="conditional" select="0"/>
504
+ </xsl:call-template>
505
+ <xsl:call-template name="anchor">
506
+ <xsl:with-param name="conditional" select="0"/>
507
+ </xsl:call-template>
508
+ <xsl:apply-templates/>
509
+ </xsl:element>
510
+ </xsl:template>
511
+
512
+ <xsl:template match="d:section/d:subtitle" mode="titlepage.mode" priority="2">
513
+ <xsl:call-template name="section.subtitle"/>
514
+ </xsl:template>
515
+
516
+ <xsl:template match="d:simplesect/d:subtitle" mode="titlepage.mode" priority="2">
517
+ <xsl:call-template name="section.subtitle"/>
518
+ </xsl:template>
519
+
520
+ <xsl:template match="d:sect1/d:subtitle" mode="titlepage.mode" priority="2">
521
+ <xsl:call-template name="section.subtitle"/>
522
+ </xsl:template>
523
+
524
+ <xsl:template match="d:sect2/d:subtitle" mode="titlepage.mode" priority="2">
525
+ <xsl:call-template name="section.subtitle"/>
526
+ </xsl:template>
527
+
528
+ <xsl:template match="d:sect3/d:subtitle" mode="titlepage.mode" priority="2">
529
+ <xsl:call-template name="section.subtitle"/>
530
+ </xsl:template>
531
+
532
+ <xsl:template match="d:sect4/d:subtitle" mode="titlepage.mode" priority="2">
533
+ <xsl:call-template name="section.subtitle"/>
534
+ </xsl:template>
535
+
536
+ <xsl:template match="d:sect5/d:subtitle" mode="titlepage.mode" priority="2">
537
+ <xsl:call-template name="section.subtitle"/>
538
+ </xsl:template>
539
+
540
+ <xsl:template name="section.subtitle">
541
+ <!-- the context node should be the subtitle of a section when called -->
542
+ <xsl:variable name="section" select="(ancestor::d:section |ancestor::d:simplesect |ancestor::d:sect1 |ancestor::d:sect2 |ancestor::d:sect3 |ancestor::d:sect4 |ancestor::d:sect5)[last()]"/>
543
+
544
+ <xsl:variable name="level">
545
+ <xsl:call-template name="section.level">
546
+ <xsl:with-param name="node" select="$section"/>
547
+ </xsl:call-template>
548
+ </xsl:variable>
549
+
550
+ <xsl:call-template name="section.heading">
551
+ <xsl:with-param name="section" select=".."/>
552
+ <xsl:with-param name="allow-anchors" select="0"/>
553
+ <!-- subtitle heading level one higher than section level -->
554
+ <xsl:with-param name="level" select="$level + 1"/>
555
+ <xsl:with-param name="class" select="'subtitle'"/>
556
+ <xsl:with-param name="title">
557
+ <xsl:apply-templates select="$section" mode="object.subtitle.markup">
558
+ <xsl:with-param name="allow-anchors" select="0"/>
559
+ </xsl:apply-templates>
560
+ </xsl:with-param>
561
+ </xsl:call-template>
562
+ </xsl:template>
563
+
564
+ </xsl:stylesheet>