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,440 @@
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:d="http://docbook.org/ns/docbook"
5
+ xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="doc d" version="1.0">
6
+
7
+ <!-- ********************************************************************
8
+ $Id: qandaset.xsl 9354 2012-05-12 23:29:36Z bobstayton $
9
+ ********************************************************************
10
+
11
+ This file is part of the XSL DocBook Stylesheet distribution.
12
+ See ../README or http://docbook.sf.net/release/xsl/current/ for
13
+ copyright and other information.
14
+
15
+ ******************************************************************** -->
16
+
17
+ <!-- ==================================================================== -->
18
+
19
+ <xsl:template match="d:qandaset">
20
+ <xsl:variable name="title" select="(d:blockinfo/d:title|d:info/d:title|d:title)[1]"/>
21
+ <xsl:variable name="preamble" select="*[local-name(.) != 'title' and local-name(.) != 'titleabbrev' and local-name(.) != 'qandadiv' and local-name(.) != 'qandaentry']"/>
22
+ <xsl:variable name="toc">
23
+ <xsl:call-template name="pi.dbhtml_toc"/>
24
+ </xsl:variable>
25
+
26
+ <xsl:variable name="toc.params">
27
+ <xsl:call-template name="find.path.params">
28
+ <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
29
+ </xsl:call-template>
30
+ </xsl:variable>
31
+
32
+ <div>
33
+ <xsl:apply-templates select="." mode="common.html.attributes"/>
34
+ <xsl:call-template name="id.attribute">
35
+ <xsl:with-param name="conditional" select="0"/>
36
+ </xsl:call-template>
37
+ <xsl:apply-templates select="$title"/>
38
+ <xsl:if test="not($title)">
39
+ <!-- andhor is output on title if there is one -->
40
+ <xsl:call-template name="anchor">
41
+ <xsl:with-param name="conditional" select="0"/>
42
+ </xsl:call-template>
43
+ </xsl:if>
44
+ <xsl:if test="((contains($toc.params, 'toc') and $toc != '0') or $toc = '1') and not(ancestor::d:answer and not($qanda.nested.in.toc=0))">
45
+ <xsl:call-template name="process.qanda.toc"/>
46
+ </xsl:if>
47
+ <xsl:apply-templates select="$preamble"/>
48
+ <xsl:call-template name="process.qandaset"/>
49
+ </div>
50
+ </xsl:template>
51
+
52
+ <xsl:template match="d:qandaset/d:blockinfo/d:title| d:qandaset/d:info/d:title| d:qandaset/d:title">
53
+ <xsl:variable name="qalevel">
54
+ <xsl:call-template name="qanda.section.level"/>
55
+ </xsl:variable>
56
+ <xsl:element name="h{string(number($qalevel)+1)}" namespace="http://www.w3.org/1999/xhtml">
57
+ <xsl:apply-templates select="." mode="class.attribute"/>
58
+ <xsl:call-template name="anchor">
59
+ <xsl:with-param name="node" select=".."/>
60
+ <xsl:with-param name="conditional" select="0"/>
61
+ </xsl:call-template>
62
+ <xsl:apply-templates/>
63
+ </xsl:element>
64
+ </xsl:template>
65
+
66
+ <xsl:template match="d:qandaset/d:blockinfo|d:qandaset/d:info">
67
+ <!-- what should this template really do? -->
68
+ <xsl:apply-templates select="d:legalnotice" mode="titlepage.mode"/>
69
+ </xsl:template>
70
+
71
+ <xsl:template match="d:qandadiv">
72
+ <xsl:variable name="preamble" select="*[local-name(.) != 'title' and local-name(.) != 'titleabbrev' and local-name(.) != 'qandadiv' and local-name(.) != 'qandaentry']"/>
73
+
74
+ <xsl:if test="d:blockinfo/d:title|d:info/d:title|d:title">
75
+ <tr class="qandadiv">
76
+ <td align="{$direction.align.start}" valign="top" colspan="2">
77
+ <xsl:apply-templates select="(d:blockinfo/d:title|d:info/d:title|d:title)[1]"/>
78
+ </td>
79
+ </tr>
80
+ </xsl:if>
81
+
82
+ <xsl:variable name="toc">
83
+ <xsl:call-template name="pi.dbhtml_toc"/>
84
+ </xsl:variable>
85
+
86
+ <xsl:variable name="toc.params">
87
+ <xsl:call-template name="find.path.params">
88
+ <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
89
+ </xsl:call-template>
90
+ </xsl:variable>
91
+
92
+ <xsl:if test="(contains($toc.params, 'toc') and $toc != '0') or $toc = '1'">
93
+ <tr class="toc">
94
+ <td align="{$direction.align.start}" valign="top" colspan="2">
95
+ <xsl:call-template name="process.qanda.toc"/>
96
+ </td>
97
+ </tr>
98
+ </xsl:if>
99
+ <xsl:if test="$preamble">
100
+ <tr class="toc">
101
+ <td align="{$direction.align.start}" valign="top" colspan="2">
102
+ <xsl:apply-templates select="$preamble"/>
103
+ </td>
104
+ </tr>
105
+ </xsl:if>
106
+ <xsl:apply-templates select="d:qandadiv|d:qandaentry"/>
107
+ </xsl:template>
108
+
109
+ <xsl:template match="d:qandadiv/d:blockinfo/d:title| d:qandadiv/d:info/d:title| d:qandadiv/d:title">
110
+ <xsl:variable name="qalevel">
111
+ <xsl:call-template name="qandadiv.section.level"/>
112
+ </xsl:variable>
113
+
114
+ <xsl:element name="h{string(number($qalevel)+1)}" namespace="http://www.w3.org/1999/xhtml">
115
+ <xsl:apply-templates select="." mode="class.attribute"/>
116
+ <xsl:call-template name="id.attribute">
117
+ <xsl:with-param name="node" select=".."/>
118
+ <xsl:with-param name="conditional" select="0"/>
119
+ </xsl:call-template>
120
+ <xsl:call-template name="anchor">
121
+ <xsl:with-param name="node" select=".."/>
122
+ <xsl:with-param name="conditional" select="0"/>
123
+ </xsl:call-template>
124
+ <xsl:apply-templates select="parent::d:qandadiv" mode="label.markup"/>
125
+ <xsl:if test="$qandadiv.autolabel != 0">
126
+ <xsl:apply-templates select="." mode="intralabel.punctuation"/>
127
+ <xsl:text> </xsl:text>
128
+ </xsl:if>
129
+ <xsl:apply-templates/>
130
+ </xsl:element>
131
+ </xsl:template>
132
+
133
+ <xsl:template match="d:qandaentry">
134
+ <xsl:apply-templates/>
135
+ </xsl:template>
136
+
137
+ <xsl:template match="d:question">
138
+ <xsl:variable name="deflabel">
139
+ <xsl:apply-templates select="." mode="qanda.defaultlabel"/>
140
+ </xsl:variable>
141
+
142
+ <tr>
143
+ <xsl:apply-templates select="." mode="common.html.attributes"/>
144
+ <!-- capture the id of the quandaentry -->
145
+ <xsl:call-template name="id.attribute">
146
+ <xsl:with-param name="node" select=".."/>
147
+ <xsl:with-param name="conditional" select="0"/>
148
+ </xsl:call-template>
149
+ <td align="{$direction.align.start}" valign="top">
150
+ <!-- and the id of the question too -->
151
+ <xsl:call-template name="id.attribute">
152
+ <xsl:with-param name="conditional" select="0"/>
153
+ </xsl:call-template>
154
+ <xsl:call-template name="anchor">
155
+ <xsl:with-param name="node" select=".."/>
156
+ <xsl:with-param name="conditional" select="0"/>
157
+ </xsl:call-template>
158
+ <xsl:call-template name="anchor">
159
+ <xsl:with-param name="conditional" select="0"/>
160
+ </xsl:call-template>
161
+
162
+ <xsl:variable name="label.content">
163
+ <xsl:apply-templates select="." mode="qanda.label"/>
164
+ </xsl:variable>
165
+
166
+ <xsl:if test="string-length($label.content) &gt; 0">
167
+ <p><strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
168
+ <xsl:copy-of select="$label.content"/>
169
+ </strong></p>
170
+ </xsl:if>
171
+ </td>
172
+ <td align="{$direction.align.start}" valign="top">
173
+ <xsl:choose>
174
+ <xsl:when test="$deflabel = 'none' and not(d:label)">
175
+ <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform"><xsl:apply-templates select="*[local-name(.) != 'label']"/></strong>
176
+ </xsl:when>
177
+ <xsl:otherwise>
178
+ <xsl:apply-templates select="*[local-name(.) != 'label']"/>
179
+ </xsl:otherwise>
180
+ </xsl:choose>
181
+ </td>
182
+ </tr>
183
+ </xsl:template>
184
+
185
+ <xsl:template match="*" mode="qanda.defaultlabel">
186
+ <xsl:choose>
187
+ <xsl:when test="ancestor-or-self::*[@defaultlabel]">
188
+ <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()] /@defaultlabel"/>
189
+ </xsl:when>
190
+ <xsl:otherwise>
191
+ <xsl:value-of select="$qanda.defaultlabel"/>
192
+ </xsl:otherwise>
193
+ </xsl:choose>
194
+ </xsl:template>
195
+
196
+ <xsl:template match="d:question" mode="qanda.label">
197
+ <xsl:variable name="deflabel">
198
+ <xsl:apply-templates select="." mode="qanda.defaultlabel"/>
199
+ </xsl:variable>
200
+ <xsl:apply-templates select="." mode="label.markup"/>
201
+ <xsl:if test="contains($deflabel, 'number') and not(d:label)">
202
+ <xsl:apply-templates select="." mode="intralabel.punctuation"/>
203
+ </xsl:if>
204
+ </xsl:template>
205
+
206
+ <xsl:template match="d:answer">
207
+ <xsl:variable name="deflabel">
208
+ <xsl:apply-templates select="." mode="qanda.defaultlabel"/>
209
+ </xsl:variable>
210
+
211
+ <tr>
212
+ <xsl:apply-templates select="." mode="common.html.attributes"/>
213
+ <xsl:call-template name="id.attribute"/>
214
+ <td align="{$direction.align.start}" valign="top">
215
+ <xsl:call-template name="anchor"/>
216
+ <xsl:variable name="answer.label">
217
+ <xsl:apply-templates select="." mode="label.markup"/>
218
+ </xsl:variable>
219
+ <xsl:if test="string-length($answer.label) &gt; 0">
220
+ <p><strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
221
+ <xsl:copy-of select="$answer.label"/>
222
+ </strong></p>
223
+ </xsl:if>
224
+ </td>
225
+ <td align="{$direction.align.start}" valign="top">
226
+ <xsl:apply-templates select="*[local-name(.) != 'label' and local-name(.) != 'qandaentry']"/>
227
+ <!-- * handle nested answer/qandaentry instances -->
228
+ <!-- * (bug 1509043 from Daniel Leidert) -->
229
+ <xsl:if test="descendant::d:question">
230
+ <xsl:call-template name="process.qandaset"/>
231
+ </xsl:if>
232
+ </td>
233
+ </tr>
234
+ </xsl:template>
235
+
236
+ <xsl:template match="d:answer" mode="qanda.label">
237
+ <xsl:apply-templates select="." mode="label.markup"/>
238
+ </xsl:template>
239
+
240
+ <xsl:template match="d:label">
241
+ <xsl:apply-templates/>
242
+ </xsl:template>
243
+
244
+ <!-- ==================================================================== -->
245
+
246
+ <xsl:template name="process.qanda.toc">
247
+ <!-- * if user wants nested qandaset and qandaentry in main Qandaset TOC, -->
248
+ <!-- * then don't also include the nested stuff in the sub TOCs -->
249
+ <dl>
250
+ <xsl:apply-templates select="d:qandadiv" mode="qandatoc.mode"/>
251
+ <xsl:apply-templates select="d:qandaset|d:qandaentry" mode="qandatoc.mode"/>
252
+ </dl>
253
+ </xsl:template>
254
+
255
+ <xsl:template match="d:qandadiv" mode="qandatoc.mode">
256
+ <dt><xsl:apply-templates select="d:title" mode="qandatoc.mode"/></dt>
257
+ <dd><xsl:call-template name="process.qanda.toc"/></dd>
258
+ </xsl:template>
259
+
260
+ <xsl:template match="d:qandadiv/d:blockinfo/d:title| d:qandadiv/d:info/d:title| d:qandadiv/d:title" mode="qandatoc.mode">
261
+ <xsl:variable name="qalevel">
262
+ <xsl:call-template name="qandadiv.section.level"/>
263
+ </xsl:variable>
264
+ <xsl:variable name="id">
265
+ <xsl:call-template name="object.id">
266
+ <xsl:with-param name="object" select="parent::*"/>
267
+ </xsl:call-template>
268
+ </xsl:variable>
269
+
270
+ <xsl:variable name="div.label">
271
+ <xsl:apply-templates select="parent::d:qandadiv" mode="label.markup"/>
272
+ </xsl:variable>
273
+ <xsl:if test="string-length($div.label) != 0">
274
+ <xsl:copy-of select="$div.label"/>
275
+ <xsl:value-of select="$autotoc.label.separator"/>
276
+ </xsl:if>
277
+ <xsl:text> </xsl:text>
278
+ <a>
279
+ <xsl:attribute name="href">
280
+ <xsl:call-template name="href.target">
281
+ <xsl:with-param name="object" select="parent::*"/>
282
+ </xsl:call-template>
283
+ </xsl:attribute>
284
+ <xsl:apply-templates/>
285
+ </a>
286
+ </xsl:template>
287
+
288
+ <xsl:template match="d:qandaset" mode="qandatoc.mode">
289
+ <xsl:for-each select="d:qandaentry">
290
+ <xsl:apply-templates select="." mode="qandatoc.mode"/>
291
+ </xsl:for-each>
292
+ </xsl:template>
293
+
294
+ <xsl:template match="d:qandaentry" mode="qandatoc.mode">
295
+ <xsl:apply-templates select="d:question" mode="qandatoc.mode"/>
296
+ </xsl:template>
297
+
298
+ <xsl:template match="d:question" mode="qandatoc.mode">
299
+ <xsl:variable name="firstch">
300
+ <!-- Use a titleabbrev or title if available -->
301
+ <xsl:choose>
302
+ <xsl:when test="../d:blockinfo/d:titleabbrev">
303
+ <xsl:apply-templates select="../d:blockinfo/d:titleabbrev[1]/node()"/>
304
+ </xsl:when>
305
+ <xsl:when test="../d:blockinfo/d:title">
306
+ <xsl:apply-templates select="../d:blockinfo/d:title[1]/node()"/>
307
+ </xsl:when>
308
+ <xsl:when test="../d:info/d:titleabbrev">
309
+ <xsl:apply-templates select="../d:info/d:titleabbrev[1]/node()"/>
310
+ </xsl:when>
311
+ <xsl:when test="../d:titleabbrev">
312
+ <xsl:apply-templates select="../d:titleabbrev[1]/node()"/>
313
+ </xsl:when>
314
+ <xsl:when test="../d:info/d:title">
315
+ <xsl:apply-templates select="../d:info/d:title[1]/node()"/>
316
+ </xsl:when>
317
+ <xsl:when test="../d:title">
318
+ <xsl:apply-templates select="../d:title[1]/node()"/>
319
+ </xsl:when>
320
+ <xsl:otherwise>
321
+ <xsl:apply-templates select="(*[local-name(.)!='label'])[1]/node()"/>
322
+ </xsl:otherwise>
323
+ </xsl:choose>
324
+ </xsl:variable>
325
+ <xsl:variable name="deflabel">
326
+ <xsl:choose>
327
+ <xsl:when test="ancestor-or-self::*[@defaultlabel]">
328
+ <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()] /@defaultlabel"/>
329
+ </xsl:when>
330
+ <xsl:otherwise>
331
+ <xsl:value-of select="$qanda.defaultlabel"/>
332
+ </xsl:otherwise>
333
+ </xsl:choose>
334
+ </xsl:variable>
335
+
336
+ <dt>
337
+ <xsl:apply-templates select="." mode="label.markup"/>
338
+ <xsl:if test="contains($deflabel,'number') and not(d:label)">
339
+ <xsl:apply-templates select="." mode="intralabel.punctuation"/>
340
+ </xsl:if>
341
+ <xsl:text> </xsl:text>
342
+ <a>
343
+ <xsl:attribute name="href">
344
+ <xsl:call-template name="href.target">
345
+ <xsl:with-param name="object" select=".."/>
346
+ </xsl:call-template>
347
+ </xsl:attribute>
348
+ <xsl:value-of select="$firstch"/>
349
+ </a>
350
+ </dt>
351
+ <!-- * include nested qandaset/qandaentry in TOC if user wants it -->
352
+ <xsl:if test="not($qanda.nested.in.toc = 0)">
353
+ <xsl:apply-templates select="following-sibling::d:answer" mode="qandatoc.mode"/>
354
+ </xsl:if>
355
+ </xsl:template>
356
+
357
+ <xsl:template match="d:answer" mode="qandatoc.mode">
358
+ <xsl:if test="descendant::d:question">
359
+ <dd>
360
+ <xsl:call-template name="process.qanda.toc"/>
361
+ </dd>
362
+ </xsl:if>
363
+ </xsl:template>
364
+
365
+ <!-- ==================================================================== -->
366
+
367
+ <xsl:template name="process.qandaset">
368
+
369
+ <xsl:variable name="deflabel">
370
+ <xsl:apply-templates select="." mode="qanda.defaultlabel"/>
371
+ </xsl:variable>
372
+
373
+ <xsl:variable name="label-width">
374
+ <xsl:call-template name="pi.dbhtml_label-width"/>
375
+ </xsl:variable>
376
+
377
+ <xsl:variable name="table-summary">
378
+ <xsl:call-template name="pi.dbhtml_table-summary"/>
379
+ </xsl:variable>
380
+
381
+ <xsl:variable name="cellpadding">
382
+ <xsl:call-template name="pi.dbhtml_cellpadding"/>
383
+ </xsl:variable>
384
+
385
+ <xsl:variable name="cellspacing">
386
+ <xsl:call-template name="pi.dbhtml_cellspacing"/>
387
+ </xsl:variable>
388
+
389
+ <table border="{$table.border.off}">
390
+ <xsl:if test="$css.decoration != 0">
391
+ <xsl:attribute name="style">width: 100%;</xsl:attribute>
392
+ </xsl:if>
393
+ <xsl:if test="$table-summary != ''">
394
+ <xsl:attribute name="summary">
395
+ <xsl:value-of select="$table-summary"/>
396
+ </xsl:attribute>
397
+ </xsl:if>
398
+
399
+ <xsl:if test="$cellpadding != ''">
400
+ <xsl:attribute name="cellpadding">
401
+ <xsl:value-of select="$cellpadding"/>
402
+ </xsl:attribute>
403
+ </xsl:if>
404
+
405
+ <xsl:if test="$cellspacing != ''">
406
+ <xsl:attribute name="cellspacing">
407
+ <xsl:value-of select="$cellspacing"/>
408
+ </xsl:attribute>
409
+ </xsl:if>
410
+
411
+ <colgroup>
412
+ <col align="{$direction.align.start}">
413
+ <xsl:attribute name="width">
414
+ <xsl:choose>
415
+ <xsl:when test="$label-width != ''">
416
+ <xsl:value-of select="$label-width"/>
417
+ </xsl:when>
418
+ <xsl:otherwise>
419
+ <xsl:text>1%</xsl:text>
420
+ </xsl:otherwise>
421
+ </xsl:choose>
422
+ </xsl:attribute>
423
+ </col>
424
+ <col/>
425
+ </colgroup>
426
+ <tbody>
427
+ <xsl:apply-templates select="d:qandaentry|d:qandadiv"/>
428
+ </tbody>
429
+ </table>
430
+ </xsl:template>
431
+
432
+ <!-- ==================================================================== -->
433
+
434
+ <xsl:template match="*" mode="no.wrapper.mode">
435
+ <xsl:apply-templates/>
436
+ </xsl:template>
437
+
438
+ <!-- ==================================================================== -->
439
+
440
+ </xsl:stylesheet>
@@ -0,0 +1,307 @@
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: refentry.xsl 9297 2012-04-22 03:56:16Z 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:reference">
21
+ <xsl:call-template name="id.warning"/>
22
+
23
+ <div>
24
+ <xsl:call-template name="common.html.attributes">
25
+ <xsl:with-param name="inherit" select="1"/>
26
+ </xsl:call-template>
27
+ <xsl:call-template name="id.attribute">
28
+ <xsl:with-param name="conditional" select="0"/>
29
+ </xsl:call-template>
30
+
31
+ <xsl:call-template name="reference.titlepage"/>
32
+
33
+ <xsl:variable name="toc.params">
34
+ <xsl:call-template name="find.path.params">
35
+ <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
36
+ </xsl:call-template>
37
+ </xsl:variable>
38
+
39
+ <xsl:if test="not(d:partintro) and contains($toc.params, 'toc')">
40
+ <xsl:call-template name="division.toc"/>
41
+ </xsl:if>
42
+ <xsl:apply-templates/>
43
+ </div>
44
+ </xsl:template>
45
+
46
+ <xsl:template match="d:reference" mode="division.number">
47
+ <xsl:number from="d:book" count="d:reference" format="I."/>
48
+ </xsl:template>
49
+
50
+ <xsl:template match="d:reference/d:docinfo"/>
51
+ <xsl:template match="d:reference/d:referenceinfo"/>
52
+ <xsl:template match="d:reference/d:title"/>
53
+ <xsl:template match="d:reference/d:subtitle"/>
54
+ <xsl:template match="d:reference/d:titleabbrev"/>
55
+
56
+ <!-- ==================================================================== -->
57
+
58
+ <xsl:template name="refentry.title">
59
+ <xsl:param name="node" select="."/>
60
+ <xsl:variable name="refmeta" select="$node//d:refmeta"/>
61
+ <xsl:variable name="refentrytitle" select="$refmeta//d:refentrytitle"/>
62
+ <xsl:variable name="refnamediv" select="$node//d:refnamediv"/>
63
+ <xsl:variable name="refname" select="$refnamediv//d:refname"/>
64
+ <xsl:variable name="refdesc" select="$refnamediv//d:refdescriptor"/>
65
+ <xsl:variable name="title">
66
+ <xsl:choose>
67
+ <xsl:when test="$refentrytitle">
68
+ <xsl:apply-templates select="$refentrytitle[1]" mode="title"/>
69
+ </xsl:when>
70
+ <xsl:when test="$refdesc">
71
+ <xsl:apply-templates select="$refdesc[1]" mode="title"/>
72
+ </xsl:when>
73
+ <xsl:when test="$refname">
74
+ <xsl:apply-templates select="$refname[1]" mode="title"/>
75
+ </xsl:when>
76
+ <xsl:otherwise/>
77
+ </xsl:choose>
78
+ </xsl:variable>
79
+
80
+ <h1 class="title">
81
+ <xsl:copy-of select="$title"/>
82
+ </h1>
83
+ </xsl:template>
84
+
85
+ <xsl:template match="d:refentry">
86
+ <xsl:call-template name="id.warning"/>
87
+
88
+ <div>
89
+ <xsl:call-template name="common.html.attributes">
90
+ <xsl:with-param name="inherit" select="1"/>
91
+ </xsl:call-template>
92
+ <xsl:call-template name="id.attribute">
93
+ <xsl:with-param name="conditional" select="0"/>
94
+ </xsl:call-template>
95
+ <xsl:if test="$refentry.separator != 0 and preceding-sibling::d:refentry">
96
+ <div class="refentry.separator">
97
+ <hr/>
98
+ </div>
99
+ </xsl:if>
100
+ <xsl:call-template name="anchor">
101
+ <xsl:with-param name="conditional" select="0"/>
102
+ </xsl:call-template>
103
+ <xsl:call-template name="refentry.titlepage"/>
104
+ <xsl:apply-templates/>
105
+ <xsl:call-template name="process.footnotes"/>
106
+ </div>
107
+ </xsl:template>
108
+
109
+ <xsl:template match="d:refentry/d:docinfo|d:refentry/d:refentryinfo"/>
110
+ <xsl:template match="d:refentry/d:info"/>
111
+
112
+ <xsl:template match="d:refentrytitle|d:refname|d:refdescriptor" mode="title">
113
+ <xsl:apply-templates/>
114
+ </xsl:template>
115
+
116
+ <xsl:template match="d:refmeta">
117
+ </xsl:template>
118
+
119
+ <xsl:template match="d:manvolnum">
120
+ <xsl:if test="$refentry.xref.manvolnum != 0">
121
+ <xsl:text>(</xsl:text>
122
+ <xsl:apply-templates/>
123
+ <xsl:text>)</xsl:text>
124
+ </xsl:if>
125
+ </xsl:template>
126
+
127
+ <xsl:template match="d:refmiscinfo">
128
+ </xsl:template>
129
+
130
+ <xsl:template match="d:refentrytitle">
131
+ <xsl:call-template name="inline.charseq"/>
132
+ </xsl:template>
133
+
134
+ <xsl:template match="d:refnamediv">
135
+ <div>
136
+ <xsl:call-template name="common.html.attributes">
137
+ <xsl:with-param name="inherit" select="1"/>
138
+ </xsl:call-template>
139
+ <xsl:call-template name="id.attribute"/>
140
+ <xsl:call-template name="anchor"/>
141
+
142
+ <xsl:choose>
143
+ <xsl:when test="preceding-sibling::d:refnamediv">
144
+ <!-- no title on secondary refnamedivs! -->
145
+ </xsl:when>
146
+ <xsl:when test="$refentry.generate.name != 0">
147
+ <h2>
148
+ <xsl:call-template name="gentext">
149
+ <xsl:with-param name="key" select="'RefName'"/>
150
+ </xsl:call-template>
151
+ </h2>
152
+ </xsl:when>
153
+ <xsl:when test="$refentry.generate.title != 0">
154
+ <h2>
155
+ <xsl:choose>
156
+ <xsl:when test="../d:refmeta/d:refentrytitle">
157
+ <xsl:apply-templates select="../d:refmeta/d:refentrytitle"/>
158
+ </xsl:when>
159
+ <xsl:otherwise>
160
+ <xsl:apply-templates select="d:refname[1]"/>
161
+ </xsl:otherwise>
162
+ </xsl:choose>
163
+ </h2>
164
+ </xsl:when>
165
+ </xsl:choose>
166
+
167
+ <p>
168
+ <xsl:apply-templates/>
169
+ </p>
170
+ </div>
171
+ </xsl:template>
172
+
173
+ <xsl:template match="d:refname">
174
+ <xsl:if test="not(preceding-sibling::d:refdescriptor)">
175
+ <xsl:apply-templates/>
176
+ <xsl:if test="following-sibling::d:refname">
177
+ <xsl:text>, </xsl:text>
178
+ </xsl:if>
179
+ </xsl:if>
180
+ </xsl:template>
181
+
182
+ <xsl:template match="d:refpurpose">
183
+ <xsl:if test="node()">
184
+ <xsl:text> </xsl:text>
185
+ <xsl:call-template name="dingbat">
186
+ <xsl:with-param name="dingbat">em-dash</xsl:with-param>
187
+ </xsl:call-template>
188
+ <xsl:text> </xsl:text>
189
+ <xsl:apply-templates/>
190
+ </xsl:if>
191
+ </xsl:template>
192
+
193
+ <xsl:template match="d:refdescriptor">
194
+ <xsl:apply-templates/>
195
+ </xsl:template>
196
+
197
+ <xsl:template match="d:refclass">
198
+ <xsl:if test="$refclass.suppress = 0">
199
+ <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
200
+ <xsl:if test="@role">
201
+ <xsl:value-of select="@role"/>
202
+ <xsl:text>: </xsl:text>
203
+ </xsl:if>
204
+ <xsl:apply-templates/>
205
+ </strong>
206
+ </xsl:if>
207
+ </xsl:template>
208
+
209
+ <xsl:template match="d:refsynopsisdiv">
210
+ <div>
211
+ <xsl:call-template name="common.html.attributes">
212
+ <xsl:with-param name="inherit" select="1"/>
213
+ </xsl:call-template>
214
+ <xsl:call-template name="id.attribute"/>
215
+ <xsl:call-template name="anchor"/>
216
+ <h2>
217
+ <xsl:choose>
218
+ <xsl:when test="d:refsynopsisdiv/d:title|d:title">
219
+ <xsl:apply-templates select="(d:refsynopsisdiv/d:title|d:title)[1]" mode="titlepage.mode"/>
220
+ </xsl:when>
221
+ <xsl:otherwise>
222
+ <xsl:call-template name="gentext">
223
+ <xsl:with-param name="key" select="'RefSynopsisDiv'"/>
224
+ </xsl:call-template>
225
+ </xsl:otherwise>
226
+ </xsl:choose>
227
+ </h2>
228
+ <xsl:apply-templates/>
229
+ </div>
230
+ </xsl:template>
231
+
232
+ <xsl:template match="d:refsynopsisdivinfo"/>
233
+
234
+ <xsl:template match="d:refsynopsisdiv/d:title">
235
+ </xsl:template>
236
+
237
+ <xsl:template match="d:refsynopsisdiv/d:title" mode="titlepage.mode">
238
+ <xsl:apply-templates/>
239
+ </xsl:template>
240
+
241
+ <xsl:template match="d:refsection|d:refsect1|d:refsect2|d:refsect3">
242
+ <div>
243
+ <xsl:call-template name="common.html.attributes">
244
+ <xsl:with-param name="inherit" select="1"/>
245
+ </xsl:call-template>
246
+ <xsl:call-template name="id.attribute">
247
+ <xsl:with-param name="conditional" select="0"/>
248
+ </xsl:call-template>
249
+ <xsl:call-template name="anchor">
250
+ <xsl:with-param name="conditional" select="0"/>
251
+ </xsl:call-template>
252
+ <!-- pick up info title -->
253
+ <xsl:apply-templates select="(d:title|d:info/d:title)[1]"/>
254
+ <xsl:apply-templates select="node()[not(self::d:title) and not(self::d:info)]"/>
255
+ </div>
256
+ </xsl:template>
257
+
258
+ <xsl:template match="d:refsection/d:title|d:refsection/d:info/d:title">
259
+ <!-- the ID is output in the block.object call for refsect1 -->
260
+ <xsl:variable name="level" select="count(ancestor-or-self::d:refsection)"/>
261
+ <xsl:variable name="refsynopsisdiv">
262
+ <xsl:text>0</xsl:text>
263
+ <xsl:if test="ancestor::d:refsynopsisdiv">1</xsl:if>
264
+ </xsl:variable>
265
+ <xsl:variable name="hlevel">
266
+ <xsl:choose>
267
+ <xsl:when test="$level+$refsynopsisdiv &gt; 5">6</xsl:when>
268
+ <xsl:otherwise>
269
+ <xsl:value-of select="$level+1+$refsynopsisdiv"/>
270
+ </xsl:otherwise>
271
+ </xsl:choose>
272
+ </xsl:variable>
273
+ <xsl:element name="h{$hlevel}" namespace="http://www.w3.org/1999/xhtml">
274
+ <xsl:apply-templates/>
275
+ </xsl:element>
276
+ </xsl:template>
277
+
278
+ <xsl:template match="d:refsect1/d:title|d:refsect1/d:info/d:title">
279
+ <!-- the ID is output in the block.object call for refsect1 -->
280
+ <h2>
281
+ <xsl:apply-templates/>
282
+ </h2>
283
+ </xsl:template>
284
+
285
+ <xsl:template match="d:refsect2/d:title|d:refsect2/d:info/d:title">
286
+ <!-- the ID is output in the block.object call for refsect2 -->
287
+ <h3>
288
+ <xsl:apply-templates/>
289
+ </h3>
290
+ </xsl:template>
291
+
292
+ <xsl:template match="d:refsect3/d:title|d:refsect3/d:info/d:title">
293
+ <!-- the ID is output in the block.object call for refsect3 -->
294
+ <h4>
295
+ <xsl:apply-templates/>
296
+ </h4>
297
+ </xsl:template>
298
+
299
+ <xsl:template match="d:refsectioninfo|d:refsection/d:info"/>
300
+ <xsl:template match="d:refsect1info|d:refsect1/d:info"/>
301
+ <xsl:template match="d:refsect2info|d:refsect2/d:info"/>
302
+ <xsl:template match="d:refsect3info|d:refsect3/d:info"/>
303
+
304
+
305
+ <!-- ==================================================================== -->
306
+
307
+ </xsl:stylesheet>