docbook_xsl_wrapper 0.1.2 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
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,531 @@
1
+ <?xml version="1.0"?>
2
+
3
+ <!--This file was created automatically by xhtml2xhtml5.xsl from the xhtml stylesheet.-->
4
+
5
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d="http://docbook.org/ns/docbook"
6
+ xmlns:exsl="http://exslt.org/common" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="exsl d" version="1.0">
7
+
8
+ <!--Same as xhtml but with doctypes removed from xsl:output -->
9
+ <!--and including from ../xhtml directory -->
10
+ <xslo:output xmlns:xslo="http://www.w3.org/1999/XSL/Transform" method="xml" encoding="UTF-8" indent="no"/>
11
+
12
+ <!-- ********************************************************************
13
+ $Id: docbook.xsl 9865 2014-01-29 02:50:08Z bobstayton $
14
+ ********************************************************************
15
+
16
+ This file is part of the XSL DocBook Stylesheet distribution.
17
+ See ../README or http://docbook.sf.net/release/xsl/current/ for
18
+ copyright and other information.
19
+
20
+ ******************************************************************** -->
21
+
22
+ <!-- ==================================================================== -->
23
+
24
+ <xsl:include href="../VERSION.xsl"/>
25
+ <xsl:include href="../xhtml/param.xsl"/>
26
+ <xsl:include href="../lib/lib.xsl"/>
27
+ <xsl:include href="../common/l10n.xsl"/>
28
+ <xsl:include href="../common/common.xsl"/>
29
+ <xsl:include href="../common/utility.xsl"/>
30
+ <xsl:include href="../common/labels.xsl"/>
31
+ <xsl:include href="../common/titles.xsl"/>
32
+ <xsl:include href="../common/subtitles.xsl"/>
33
+ <xsl:include href="../common/gentext.xsl"/>
34
+ <xsl:include href="../common/targets.xsl"/>
35
+ <xsl:include href="../common/olink.xsl"/>
36
+ <xsl:include href="../common/pi.xsl"/>
37
+ <xsl:include href="../xhtml/autotoc.xsl"/>
38
+ <xsl:include href="../xhtml/autoidx.xsl"/>
39
+ <xsl:include href="../xhtml/lists.xsl"/>
40
+ <xsl:include href="../xhtml/callout.xsl"/>
41
+ <xsl:include href="../xhtml/verbatim.xsl"/>
42
+ <xsl:include href="../xhtml/graphics.xsl"/>
43
+ <xsl:include href="../xhtml/xref.xsl"/>
44
+ <xsl:include href="../xhtml/formal.xsl"/>
45
+ <xsl:include href="../xhtml/table.xsl"/>
46
+ <xsl:include href="../xhtml/htmltbl.xsl"/>
47
+ <xsl:include href="../xhtml/sections.xsl"/>
48
+ <xsl:include href="../xhtml/inline.xsl"/>
49
+ <xsl:include href="../xhtml/footnote.xsl"/>
50
+ <xsl:include href="../xhtml/html.xsl"/>
51
+ <xsl:include href="../xhtml/its.xsl"/>
52
+ <xsl:include href="../xhtml/info.xsl"/>
53
+ <xsl:include href="../xhtml/keywords.xsl"/>
54
+ <xsl:include href="../xhtml/division.xsl"/>
55
+ <xsl:include href="../xhtml/toc.xsl"/>
56
+ <xsl:include href="../xhtml/index.xsl"/>
57
+ <xsl:include href="../xhtml/refentry.xsl"/>
58
+ <xsl:include href="../xhtml/math.xsl"/>
59
+ <xsl:include href="../xhtml/admon.xsl"/>
60
+ <xsl:include href="../xhtml/component.xsl"/>
61
+ <xsl:include href="../xhtml/biblio.xsl"/>
62
+ <xsl:include href="../xhtml/biblio-iso690.xsl"/>
63
+ <xsl:include href="../xhtml/glossary.xsl"/>
64
+ <xsl:include href="../xhtml/block.xsl"/>
65
+ <xsl:include href="../xhtml/task.xsl"/>
66
+ <xsl:include href="../xhtml/qandaset.xsl"/>
67
+ <xsl:include href="../xhtml/synop.xsl"/>
68
+ <xsl:include href="../xhtml/titlepage.xsl"/>
69
+ <xsl:include href="../xhtml/titlepage.templates.xsl"/>
70
+ <xsl:include href="../xhtml/pi.xsl"/>
71
+ <xsl:include href="../xhtml/ebnf.xsl"/>
72
+ <xsl:include href="../xhtml/chunker.xsl"/>
73
+ <xsl:include href="../xhtml/html-rtf.xsl"/>
74
+ <xsl:include href="../xhtml/annotations.xsl"/>
75
+ <xsl:include href="../common/addns.xsl"/>
76
+
77
+ <xsl:param name="stylesheet.result.type" select="'xhtml'"/>
78
+ <xsl:param name="htmlhelp.output" select="0"/>
79
+
80
+ <!-- ==================================================================== -->
81
+
82
+ <xsl:key name="id" match="*" use="@id|@xml:id"/>
83
+ <xsl:key name="gid" match="*" use="generate-id()"/>
84
+
85
+ <!-- ==================================================================== -->
86
+
87
+ <xsl:template match="*">
88
+ <xsl:message>
89
+ <xsl:text>Element </xsl:text>
90
+ <xsl:value-of select="local-name(.)"/>
91
+ <xsl:text> in namespace '</xsl:text>
92
+ <xsl:value-of select="namespace-uri(.)"/>
93
+ <xsl:text>' encountered</xsl:text>
94
+ <xsl:if test="parent::*">
95
+ <xsl:text> in </xsl:text>
96
+ <xsl:value-of select="name(parent::*)"/>
97
+ </xsl:if>
98
+ <xsl:text>, but no template matches.</xsl:text>
99
+ </xsl:message>
100
+
101
+ <span style="color: red">
102
+ <xsl:text>&lt;</xsl:text>
103
+ <xsl:value-of select="name(.)"/>
104
+ <xsl:text>&gt;</xsl:text>
105
+ <xsl:apply-templates/>
106
+ <xsl:text>&lt;/</xsl:text>
107
+ <xsl:value-of select="name(.)"/>
108
+ <xsl:text>&gt;</xsl:text>
109
+ </span>
110
+ </xsl:template>
111
+
112
+ <xsl:template match="text()">
113
+ <xsl:value-of select="."/>
114
+ </xsl:template>
115
+
116
+ <xsl:template name="body.attributes"><xslo:if xmlns:xslo="http://www.w3.org/1999/XSL/Transform" test="starts-with($writing.mode, 'rl')"><xslo:attribute name="dir">rtl</xslo:attribute></xslo:if>
117
+ <!-- no apply-templates; make it empty except for dir for rtl-->
118
+ </xsl:template>
119
+
120
+ <xsl:template name="head.content.base">
121
+ <xsl:param name="node" select="."/>
122
+ <base href="{$html.base}"/>
123
+ </xsl:template>
124
+
125
+ <xsl:template name="head.content.abstract">
126
+ <xsl:param name="node" select="."/>
127
+ <xsl:variable name="info" select="(d:articleinfo |d:bookinfo |d:prefaceinfo |d:chapterinfo |d:appendixinfo |d:sectioninfo |d:sect1info |d:sect2info |d:sect3info |d:sect4info |d:sect5info |d:referenceinfo |d:refentryinfo |d:partinfo |d:info |d:docinfo)[1]"/>
128
+ <xsl:if test="$info and $info/d:abstract">
129
+ <meta name="description">
130
+ <xsl:attribute name="content">
131
+ <xsl:for-each select="$info/d:abstract[1]/*">
132
+ <xsl:value-of select="normalize-space(.)"/>
133
+ <xsl:if test="position() &lt; last()">
134
+ <xsl:text> </xsl:text>
135
+ </xsl:if>
136
+ </xsl:for-each>
137
+ </xsl:attribute>
138
+ </meta>
139
+ </xsl:if>
140
+ </xsl:template>
141
+
142
+ <xsl:template name="head.content.link.made">
143
+ <xsl:param name="node" select="."/>
144
+
145
+ <link rev="made" href="{$link.mailto.url}"/>
146
+ </xsl:template>
147
+
148
+ <xsl:template name="head.content.generator">
149
+ <xsl:param name="node" select="."/>
150
+ <meta name="generator" content="DocBook {$DistroTitle} V{$VERSION}"/>
151
+ </xsl:template>
152
+
153
+ <xsl:template name="head.content.style">
154
+ <xsl:param name="node" select="."/>
155
+ <style type="text/css"><xsl:text>
156
+ body { background-image: url('</xsl:text>
157
+ <xsl:value-of select="$draft.watermark.image"/><xsl:text>');
158
+ background-repeat: no-repeat;
159
+ background-position: top left;
160
+ /* The following properties make the watermark "fixed" on the page. */
161
+ /* I think that's just a bit too distracting for the reader... */
162
+ /* background-attachment: fixed; */
163
+ /* background-position: center center; */
164
+ }</xsl:text>
165
+ </style>
166
+ </xsl:template>
167
+
168
+ <xsl:template name="head.content">
169
+ <xsl:param name="node" select="."/>
170
+ <xsl:param name="title">
171
+ <xsl:apply-templates select="$node" mode="object.title.markup.textonly"/>
172
+ </xsl:param>
173
+
174
+ <xsl:call-template name="user.head.title">
175
+ <xsl:with-param name="title" select="$title"/>
176
+ <xsl:with-param name="node" select="$node"/>
177
+ </xsl:call-template>
178
+
179
+ <xsl:if test="$html.base != ''">
180
+ <xsl:call-template name="head.content.base">
181
+ <xsl:with-param name="node" select="$node"/>
182
+ </xsl:call-template>
183
+ </xsl:if>
184
+
185
+ <!-- Insert links to CSS files or insert literal style elements -->
186
+ <xsl:call-template name="generate.css"/>
187
+
188
+ <xsl:if test="$html.stylesheet != ''">
189
+ <xsl:call-template name="output.html.stylesheets">
190
+ <xsl:with-param name="stylesheets" select="normalize-space($html.stylesheet)"/>
191
+ </xsl:call-template>
192
+ </xsl:if>
193
+
194
+ <xsl:if test="$html.script != ''">
195
+ <xsl:call-template name="output.html.scripts">
196
+ <xsl:with-param name="scripts" select="normalize-space($html.script)"/>
197
+ </xsl:call-template>
198
+ </xsl:if>
199
+
200
+ <xsl:if test="$link.mailto.url != ''">
201
+ <xsl:call-template name="head.content.link.made">
202
+ <xsl:with-param name="node" select="$node"/>
203
+ </xsl:call-template>
204
+ </xsl:if>
205
+
206
+ <xsl:call-template name="head.content.generator">
207
+ <xsl:with-param name="node" select="$node"/>
208
+ </xsl:call-template>
209
+
210
+ <xsl:if test="$generate.meta.abstract != 0">
211
+ <xsl:call-template name="head.content.abstract">
212
+ <xsl:with-param name="node" select="$node"/>
213
+ </xsl:call-template>
214
+ </xsl:if>
215
+
216
+ <xsl:if test="($draft.mode = 'yes' or ($draft.mode = 'maybe' and ancestor-or-self::*[@status][1]/@status = 'draft')) and $draft.watermark.image != ''">
217
+ <xsl:call-template name="head.content.style">
218
+ <xsl:with-param name="node" select="$node"/>
219
+ </xsl:call-template>
220
+ </xsl:if>
221
+ <xsl:apply-templates select="." mode="head.keywords.content"/>
222
+ </xsl:template>
223
+
224
+ <xsl:template name="output.html.stylesheets">
225
+ <xsl:param name="stylesheets" select="''"/>
226
+
227
+ <xsl:choose>
228
+ <xsl:when test="contains($stylesheets, ' ')">
229
+ <xsl:variable name="css.filename" select="substring-before($stylesheets, ' ')"/>
230
+
231
+ <xsl:call-template name="make.css.link">
232
+ <xsl:with-param name="css.filename" select="$css.filename"/>
233
+ </xsl:call-template>
234
+
235
+ <xsl:call-template name="output.html.stylesheets">
236
+ <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
237
+ </xsl:call-template>
238
+ </xsl:when>
239
+ <xsl:when test="$stylesheets != ''">
240
+ <xsl:call-template name="make.css.link">
241
+ <xsl:with-param name="css.filename" select="$stylesheets"/>
242
+ </xsl:call-template>
243
+ </xsl:when>
244
+ </xsl:choose>
245
+ </xsl:template>
246
+
247
+ <xsl:template name="output.html.scripts">
248
+ <xsl:param name="scripts" select="''"/>
249
+
250
+ <xsl:choose>
251
+ <xsl:when test="contains($scripts, ' ')">
252
+ <xsl:variable name="script.filename" select="substring-before($scripts, ' ')"/>
253
+
254
+ <xsl:call-template name="make.script.link">
255
+ <xsl:with-param name="script.filename" select="$script.filename"/>
256
+ </xsl:call-template>
257
+
258
+ <xsl:call-template name="output.html.scripts">
259
+ <xsl:with-param name="scripts" select="substring-after($scripts, ' ')"/>
260
+ </xsl:call-template>
261
+ </xsl:when>
262
+ <xsl:when test="$scripts != ''">
263
+ <xsl:call-template name="make.script.link">
264
+ <xsl:with-param name="script.filename" select="$scripts"/>
265
+ </xsl:call-template>
266
+ </xsl:when>
267
+ </xsl:choose>
268
+ </xsl:template>
269
+
270
+ <!-- ============================================================ -->
271
+
272
+ <xsl:template match="*" mode="head.keywords.content">
273
+ <xsl:apply-templates select="d:chapterinfo/d:keywordset" mode="html.header"/>
274
+ <xsl:apply-templates select="d:appendixinfo/d:keywordset" mode="html.header"/>
275
+ <xsl:apply-templates select="d:prefaceinfo/d:keywordset" mode="html.header"/>
276
+ <xsl:apply-templates select="d:bookinfo/d:keywordset" mode="html.header"/>
277
+ <xsl:apply-templates select="d:setinfo/d:keywordset" mode="html.header"/>
278
+ <xsl:apply-templates select="d:articleinfo/d:keywordset" mode="html.header"/>
279
+ <xsl:apply-templates select="d:artheader/d:keywordset" mode="html.header"/>
280
+ <xsl:apply-templates select="d:sect1info/d:keywordset" mode="html.header"/>
281
+ <xsl:apply-templates select="d:sect2info/d:keywordset" mode="html.header"/>
282
+ <xsl:apply-templates select="d:sect3info/d:keywordset" mode="html.header"/>
283
+ <xsl:apply-templates select="d:sect4info/d:keywordset" mode="html.header"/>
284
+ <xsl:apply-templates select="d:sect5info/d:keywordset" mode="html.header"/>
285
+ <xsl:apply-templates select="d:sectioninfo/d:keywordset" mode="html.header"/>
286
+ <xsl:apply-templates select="d:refsect1info/d:keywordset" mode="html.header"/>
287
+ <xsl:apply-templates select="d:refsect2info/d:keywordset" mode="html.header"/>
288
+ <xsl:apply-templates select="d:refsect3info/d:keywordset" mode="html.header"/>
289
+ <xsl:apply-templates select="d:bibliographyinfo/d:keywordset" mode="html.header"/>
290
+ <xsl:apply-templates select="d:glossaryinfo/d:keywordset" mode="html.header"/>
291
+ <xsl:apply-templates select="d:indexinfo/d:keywordset" mode="html.header"/>
292
+ <xsl:apply-templates select="d:refentryinfo/d:keywordset" mode="html.header"/>
293
+ <xsl:apply-templates select="d:partinfo/d:keywordset" mode="html.header"/>
294
+ <xsl:apply-templates select="d:referenceinfo/d:keywordset" mode="html.header"/>
295
+ <xsl:apply-templates select="d:docinfo/d:keywordset" mode="html.header"/>
296
+ <xsl:apply-templates select="d:info/d:keywordset" mode="html.header"/>
297
+
298
+ <xsl:if test="$inherit.keywords != 0 and parent::*">
299
+ <xsl:apply-templates select="parent::*" mode="head.keywords.content"/>
300
+ </xsl:if>
301
+ </xsl:template>
302
+
303
+ <!-- ============================================================ -->
304
+
305
+ <xsl:template name="system.head.content">
306
+ <xsl:param name="node" select="."/>
307
+
308
+ <!-- FIXME: When chunking, only the annotations actually used
309
+ in this chunk should be referenced. I don't think it
310
+ does any harm to reference them all, but it adds
311
+ unnecessary bloat to each chunk. -->
312
+ <xsl:if test="$annotation.support != 0 and //d:annotation">
313
+ <xsl:call-template name="add.annotation.links"/>
314
+ <script type="text/javascript">
315
+ <xsl:text>
316
+ // Create PopupWindow objects</xsl:text>
317
+ <xsl:for-each select="//d:annotation">
318
+ <xsl:text>
319
+ var popup_</xsl:text>
320
+ <xsl:value-of select="generate-id(.)"/>
321
+ <xsl:text> = new PopupWindow("popup-</xsl:text>
322
+ <xsl:value-of select="generate-id(.)"/>
323
+ <xsl:text>");
324
+ </xsl:text>
325
+ <xsl:text>popup_</xsl:text>
326
+ <xsl:value-of select="generate-id(.)"/>
327
+ <xsl:text>.offsetY = 15;
328
+ </xsl:text>
329
+ <xsl:text>popup_</xsl:text>
330
+ <xsl:value-of select="generate-id(.)"/>
331
+ <xsl:text>.autoHide();
332
+ </xsl:text>
333
+ </xsl:for-each>
334
+ </script>
335
+
336
+ <style type="text/css">
337
+ <xsl:value-of select="$annotation.css"/>
338
+ </style>
339
+ </xsl:if>
340
+
341
+ <!-- system.head.content is like user.head.content, except that
342
+ it is called before head.content. This is important because it
343
+ means, for example, that <style> elements output by system.head.content
344
+ have a lower CSS precedence than the users stylesheet. -->
345
+ </xsl:template>
346
+
347
+ <!-- ============================================================ -->
348
+
349
+ <xsl:template name="user.preroot">
350
+ <!-- Pre-root output, can be used to output comments and PIs. -->
351
+ <!-- This must not output any element content! -->
352
+ </xsl:template>
353
+
354
+ <xsl:template name="user.head.title">
355
+ <xsl:param name="node" select="."/>
356
+ <xsl:param name="title"/>
357
+
358
+ <title>
359
+ <xsl:copy-of select="$title"/>
360
+ </title>
361
+ </xsl:template>
362
+
363
+ <xsl:template name="user.head.content">
364
+ <xsl:param name="node" select="."/>
365
+ </xsl:template>
366
+
367
+ <xsl:template name="user.header.navigation">
368
+ <xsl:param name="node" select="."/>
369
+ <xsl:param name="prev" select="/d:foo"/>
370
+ <xsl:param name="next" select="/d:foo"/>
371
+ <xsl:param name="nav.context"/>
372
+ </xsl:template>
373
+
374
+ <xsl:template name="user.header.content">
375
+ <xsl:param name="node" select="."/>
376
+ </xsl:template>
377
+
378
+ <xsl:template name="user.footer.content">
379
+ <xsl:param name="node" select="."/>
380
+ </xsl:template>
381
+
382
+ <xsl:template name="user.footer.navigation">
383
+ <xsl:param name="node" select="."/>
384
+ <xsl:param name="prev" select="/d:foo"/>
385
+ <xsl:param name="next" select="/d:foo"/>
386
+ <xsl:param name="nav.context"/>
387
+ </xsl:template>
388
+
389
+ <!-- To use the same namespace-adjusted nodeset everywhere, it should
390
+ be created as a global variable here.
391
+ Used by docbook.xsl, chunk-common.xsl, chunktoc.xsl, and
392
+ chunk-code.xsl; and in $chunk.hierarchy used in chunkfast.xsl -->
393
+ <xsl:variable name="with.namespace">
394
+ <xsl:if test="$exsl.node.set.available != 0 and namespace-uri(/*) != 'http://docbook.org/ns/docbook'">
395
+ <xsl:apply-templates select="/*" mode="addNS"/>
396
+ </xsl:if>
397
+ </xsl:variable>
398
+
399
+ <xsl:template match="/">
400
+ <!-- * Get a title for current doc so that we let the user -->
401
+ <!-- * know what document we are processing at this point. -->
402
+ <xsl:variable name="doc.title">
403
+ <xsl:call-template name="get.doc.title"/>
404
+ </xsl:variable>
405
+ <xsl:choose>
406
+ <!-- fix namespace if necessary -->
407
+ <xsl:when test="$exsl.node.set.available != 0 and namespace-uri(/*) != 'http://docbook.org/ns/docbook'">
408
+ <xsl:call-template name="log.message">
409
+ <xsl:with-param name="level">Note</xsl:with-param>
410
+ <xsl:with-param name="source" select="$doc.title"/>
411
+ <xsl:with-param name="context-desc">
412
+ <xsl:text>namesp. add</xsl:text>
413
+ </xsl:with-param>
414
+ <xsl:with-param name="message">
415
+ <xsl:text>added namespace before processing</xsl:text>
416
+ </xsl:with-param>
417
+ </xsl:call-template>
418
+ <!-- DEBUG: uncomment to save namespace-fixed document.
419
+ <xsl:message>Saving namespace-fixed document.</xsl:message>
420
+ <xsl:call-template name="write.chunk">
421
+ <xsl:with-param name="filename" select="'namespace-fixed.debug.xml'"/>
422
+ <xsl:with-param name="method" select="'xml'"/>
423
+ <xsl:with-param name="content">
424
+ <xsl:copy-of select="exsl:node-set($with.namespace)"/>
425
+ </xsl:with-param>
426
+ </xsl:call-template>
427
+ -->
428
+ <xsl:apply-templates select="exsl:node-set($with.namespace)"/>
429
+ </xsl:when>
430
+ <!-- Can't process unless namespace fixed with exsl node-set()-->
431
+ <xsl:when test="namespace-uri(/*) != 'http://docbook.org/ns/docbook'">
432
+ <xsl:message terminate="yes">
433
+ <xsl:text>Unable to add the namespace from DB4 document,</xsl:text>
434
+ <xsl:text> cannot proceed.</xsl:text>
435
+ </xsl:message>
436
+ </xsl:when>
437
+ <xsl:otherwise>
438
+ <xsl:choose>
439
+ <xsl:when test="$rootid != ''">
440
+ <xsl:choose>
441
+ <xsl:when test="count(key('id',$rootid)) = 0">
442
+ <xsl:message terminate="yes">
443
+ <xsl:text>ID '</xsl:text>
444
+ <xsl:value-of select="$rootid"/>
445
+ <xsl:text>' not found in document.</xsl:text>
446
+ </xsl:message>
447
+ </xsl:when>
448
+ <xsl:otherwise>
449
+ <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
450
+ <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
451
+ </xsl:if>
452
+ <xsl:if test="$collect.xref.targets != 'only'">
453
+ <xsl:apply-templates select="key('id',$rootid)" mode="process.root"/>
454
+ <xsl:if test="$tex.math.in.alt != ''">
455
+ <xsl:apply-templates select="key('id',$rootid)" mode="collect.tex.math"/>
456
+ </xsl:if>
457
+ </xsl:if>
458
+ </xsl:otherwise>
459
+ </xsl:choose>
460
+ </xsl:when>
461
+ <xsl:otherwise>
462
+ <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
463
+ <xsl:apply-templates select="/" mode="collect.targets"/>
464
+ </xsl:if>
465
+ <xsl:if test="$collect.xref.targets != 'only'">
466
+ <xsl:apply-templates select="/" mode="process.root"/>
467
+ <xsl:if test="$tex.math.in.alt != ''">
468
+ <xsl:apply-templates select="/" mode="collect.tex.math"/>
469
+ </xsl:if>
470
+ </xsl:if>
471
+ </xsl:otherwise>
472
+ </xsl:choose>
473
+ </xsl:otherwise>
474
+ </xsl:choose>
475
+ </xsl:template>
476
+
477
+ <xsl:template match="*" mode="process.root">
478
+ <xsl:variable name="doc" select="self::*"/>
479
+
480
+ <xsl:call-template name="user.preroot"/>
481
+ <xsl:call-template name="root.messages"/>
482
+
483
+ <html>
484
+ <xsl:call-template name="root.attributes"/>
485
+ <head>
486
+ <xsl:call-template name="system.head.content">
487
+ <xsl:with-param name="node" select="$doc"/>
488
+ </xsl:call-template>
489
+ <xsl:call-template name="head.content">
490
+ <xsl:with-param name="node" select="$doc"/>
491
+ </xsl:call-template>
492
+ <xsl:call-template name="user.head.content">
493
+ <xsl:with-param name="node" select="$doc"/>
494
+ </xsl:call-template>
495
+ </head>
496
+ <body>
497
+ <xsl:call-template name="body.attributes"/>
498
+ <xsl:call-template name="user.header.content">
499
+ <xsl:with-param name="node" select="$doc"/>
500
+ </xsl:call-template>
501
+ <xsl:apply-templates select="."/>
502
+ <xsl:call-template name="user.footer.content">
503
+ <xsl:with-param name="node" select="$doc"/>
504
+ </xsl:call-template>
505
+ </body>
506
+ </html>
507
+ <xsl:value-of select="$html.append"/>
508
+
509
+ <!-- Generate any css files only once, not once per chunk -->
510
+ <xsl:call-template name="generate.css.files"/>
511
+ </xsl:template>
512
+
513
+ <xsl:template name="root.attributes">
514
+ <!-- customize to add attributes to <html> element -->
515
+ </xsl:template>
516
+
517
+ <xsl:template name="root.messages">
518
+ <!-- redefine this any way you'd like to output messages -->
519
+ <!-- DO NOT OUTPUT ANYTHING FROM THIS TEMPLATE -->
520
+ </xsl:template>
521
+
522
+ <!-- ==================================================================== -->
523
+
524
+ <xsl:template name="chunk">
525
+ <xsl:param name="node" select="."/>
526
+
527
+ <!-- The default is that we are not chunking... -->
528
+ <xsl:text>0</xsl:text>
529
+ </xsl:template>
530
+
531
+ </xsl:stylesheet>