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