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.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/CHANGELOG +41 -0
- data/README.md +9 -17
- data/bin/docbook_xsl_wrapper +9 -14
- data/docbook_xsl_wrapper.gemspec +8 -7
- data/lib/docbook_xsl_wrapper.rb +24 -1
- data/lib/docbook_xsl_wrapper/epub.rb +124 -122
- data/lib/docbook_xsl_wrapper/options.rb +1 -1
- data/lib/docbook_xsl_wrapper/validate.rb +22 -0
- data/lib/docbook_xsl_wrapper/version.rb +1 -1
- data/schema/docbookxi.rng +18654 -0
- data/spec/docbook_xsl_wrapper/validate_spec.rb +64 -0
- data/xsl/AUTHORS +4 -0
- data/xsl/COPYING +48 -0
- data/xsl/REVISION +1 -0
- data/xsl/VERSION.xsl +115 -0
- data/xsl/common/addns.xsl +124 -0
- data/xsl/common/af.xml +1272 -0
- data/xsl/common/am.xml +1272 -0
- data/xsl/common/ar.xml +1272 -0
- data/xsl/common/as.xml +703 -0
- data/xsl/common/ast.xml +703 -0
- data/xsl/common/autoidx-kimber.xsl +45 -0
- data/xsl/common/autoidx-kosek.xsl +155 -0
- data/xsl/common/az.xml +715 -0
- data/xsl/common/bg.xml +767 -0
- data/xsl/common/bn.xml +1272 -0
- data/xsl/common/bn_in.xml +703 -0
- data/xsl/common/bs.xml +705 -0
- data/xsl/common/ca.xml +703 -0
- data/xsl/common/charmap.xsl +222 -0
- data/xsl/common/common.xsl +2129 -0
- data/xsl/common/cs.xml +743 -0
- data/xsl/common/cy.xml +1288 -0
- data/xsl/common/da.xml +707 -0
- data/xsl/common/de.xml +709 -0
- data/xsl/common/el.xml +772 -0
- data/xsl/common/en.xml +1272 -0
- data/xsl/common/entities.ent +67 -0
- data/xsl/common/eo.xml +1272 -0
- data/xsl/common/es.xml +719 -0
- data/xsl/common/et.xml +1272 -0
- data/xsl/common/eu.xml +1272 -0
- data/xsl/common/fa.xml +703 -0
- data/xsl/common/fi.xml +713 -0
- data/xsl/common/fr.xml +733 -0
- data/xsl/common/ga.xml +1272 -0
- data/xsl/common/gentext.xsl +855 -0
- data/xsl/common/gl.xml +1272 -0
- data/xsl/common/gu.xml +703 -0
- data/xsl/common/he.xml +1272 -0
- data/xsl/common/hi.xml +703 -0
- data/xsl/common/hr.xml +705 -0
- data/xsl/common/hu.xml +721 -0
- data/xsl/common/id.xml +1272 -0
- data/xsl/common/insertfile.xsl +113 -0
- data/xsl/common/is.xml +715 -0
- data/xsl/common/it.xml +1272 -0
- data/xsl/common/ja.xml +703 -0
- data/xsl/common/ka.xml +743 -0
- data/xsl/common/kn.xml +1272 -0
- data/xsl/common/ko.xml +1272 -0
- data/xsl/common/ky.xml +775 -0
- data/xsl/common/l10n.dtd +64 -0
- data/xsl/common/l10n.xml +78 -0
- data/xsl/common/l10n.xsl +598 -0
- data/xsl/common/la.xml +1272 -0
- data/xsl/common/labels.xsl +933 -0
- data/xsl/common/lt.xml +721 -0
- data/xsl/common/lv.xml +1272 -0
- data/xsl/common/ml.xml +703 -0
- data/xsl/common/mn.xml +773 -0
- data/xsl/common/mr.xml +703 -0
- data/xsl/common/nb.xml +1272 -0
- data/xsl/common/nds.xml +709 -0
- data/xsl/common/nl.xml +703 -0
- data/xsl/common/nn.xml +1272 -0
- data/xsl/common/olink.xsl +1284 -0
- data/xsl/common/or.xml +1272 -0
- data/xsl/common/pa.xml +703 -0
- data/xsl/common/pi.xml +168 -0
- data/xsl/common/pi.xsl +347 -0
- data/xsl/common/pl.xml +721 -0
- data/xsl/common/pt.xml +1272 -0
- data/xsl/common/pt_br.xml +1272 -0
- data/xsl/common/refentry.xsl +1353 -0
- data/xsl/common/ro.xml +1272 -0
- data/xsl/common/ru.xml +769 -0
- data/xsl/common/sk.xml +1272 -0
- data/xsl/common/sl.xml +1272 -0
- data/xsl/common/sq.xml +1272 -0
- data/xsl/common/sr.xml +763 -0
- data/xsl/common/sr_Latn.xml +722 -0
- data/xsl/common/subtitles.xsl +181 -0
- data/xsl/common/sv.xml +707 -0
- data/xsl/common/ta.xml +703 -0
- data/xsl/common/table.xsl +515 -0
- data/xsl/common/targetdatabase.dtd +49 -0
- data/xsl/common/targets.xsl +338 -0
- data/xsl/common/te.xml +703 -0
- data/xsl/common/th.xml +1272 -0
- data/xsl/common/titles.xsl +850 -0
- data/xsl/common/tl.xml +1272 -0
- data/xsl/common/tr.xml +709 -0
- data/xsl/common/uk.xml +769 -0
- data/xsl/common/ur.xml +705 -0
- data/xsl/common/utility.xsl +291 -0
- data/xsl/common/vi.xml +1272 -0
- data/xsl/common/xh.xml +1272 -0
- data/xsl/common/zh.xml +703 -0
- data/xsl/common/zh_cn.xml +703 -0
- data/xsl/common/zh_tw.xml +703 -0
- data/xsl/epub/docbook.xsl +1769 -0
- data/xsl/epub3/chunk.xsl +30 -0
- data/xsl/epub3/docbook-epub.css.xml +142 -0
- data/xsl/epub3/docbook.xsl +20 -0
- data/xsl/epub3/epub3-chunk-mods.xsl +52 -0
- data/xsl/epub3/epub3-element-mods.xsl +2533 -0
- data/xsl/epub3/titlepage.templates.xml +712 -0
- data/xsl/epub3/titlepage.templates.xsl +3842 -0
- data/xsl/lib/lib.xsl +533 -0
- data/xsl/xhtml/admon.xsl +142 -0
- data/xsl/xhtml/annotations.xsl +160 -0
- data/xsl/xhtml/autoidx.xsl +831 -0
- data/xsl/xhtml/autotoc.xsl +706 -0
- data/xsl/xhtml/biblio-iso690.xsl +1302 -0
- data/xsl/xhtml/biblio.xsl +1371 -0
- data/xsl/xhtml/block.xsl +584 -0
- data/xsl/xhtml/callout.xsl +210 -0
- data/xsl/xhtml/chunk-code.xsl +675 -0
- data/xsl/xhtml/chunk-common.xsl +1627 -0
- data/xsl/xhtml/chunker.xsl +317 -0
- data/xsl/xhtml/component.xsl +440 -0
- data/xsl/xhtml/division.xsl +214 -0
- data/xsl/xhtml/ebnf.xsl +331 -0
- data/xsl/xhtml/footnote.xsl +346 -0
- data/xsl/xhtml/formal.xsl +496 -0
- data/xsl/xhtml/glossary.xsl +602 -0
- data/xsl/xhtml/graphics.xsl +1537 -0
- data/xsl/xhtml/html-rtf.xsl +321 -0
- data/xsl/xhtml/html.xsl +690 -0
- data/xsl/xhtml/htmltbl.xsl +102 -0
- data/xsl/xhtml/index.xsl +264 -0
- data/xsl/xhtml/info.xsl +48 -0
- data/xsl/xhtml/inline.xsl +1508 -0
- data/xsl/xhtml/its.xsl +109 -0
- data/xsl/xhtml/keywords.xsl +38 -0
- data/xsl/xhtml/lists.xsl +1227 -0
- data/xsl/xhtml/math.xsl +286 -0
- data/xsl/xhtml/param.xsl +449 -0
- data/xsl/xhtml/pi.xsl +1237 -0
- data/xsl/xhtml/qandaset.xsl +440 -0
- data/xsl/xhtml/refentry.xsl +307 -0
- data/xsl/xhtml/sections.xsl +564 -0
- data/xsl/xhtml/synop.xsl +1623 -0
- data/xsl/xhtml/table.xsl +1179 -0
- data/xsl/xhtml/task.xsl +76 -0
- data/xsl/xhtml/titlepage.templates.xsl +4005 -0
- data/xsl/xhtml/titlepage.xsl +1108 -0
- data/xsl/xhtml/toc.xsl +334 -0
- data/xsl/xhtml/verbatim.xsl +389 -0
- data/xsl/xhtml/xref.xsl +1268 -0
- data/xsl/xhtml5/docbook.xsl +22 -0
- data/xsl/xhtml5/html5-chunk-mods.xsl +112 -0
- data/xsl/xhtml5/html5-element-mods.xsl +791 -0
- data/xsl/xhtml5/xhtml-docbook.xsl +531 -0
- metadata +207 -27
- data/.rvmrc +0 -48
- data/xslt/obfuscate.xsl +0 -12
data/xsl/xhtml/toc.xsl
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
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: toc.xsl 9796 2013-09-03 16:26: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:set/d:toc | d:book/d:toc | d:part/d:toc">
|
|
21
|
+
<xsl:variable name="toc.params">
|
|
22
|
+
<xsl:call-template name="find.path.params">
|
|
23
|
+
<xsl:with-param name="node" select="parent::*"/>
|
|
24
|
+
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
|
|
25
|
+
</xsl:call-template>
|
|
26
|
+
</xsl:variable>
|
|
27
|
+
|
|
28
|
+
<!-- Do not output the toc element if one is already generated
|
|
29
|
+
by the use of $generate.toc parameter, or if
|
|
30
|
+
generating a source toc is turned off -->
|
|
31
|
+
<xsl:if test="not(contains($toc.params, 'toc')) and ($process.source.toc != 0 or $process.empty.source.toc != 0)">
|
|
32
|
+
<xsl:variable name="content">
|
|
33
|
+
<xsl:choose>
|
|
34
|
+
<xsl:when test="* and $process.source.toc != 0">
|
|
35
|
+
<xsl:apply-templates/>
|
|
36
|
+
</xsl:when>
|
|
37
|
+
<xsl:when test="count(*) = 0 and $process.empty.source.toc != 0">
|
|
38
|
+
<!-- trick to switch context node to parent element -->
|
|
39
|
+
<xsl:for-each select="parent::*">
|
|
40
|
+
<xsl:choose>
|
|
41
|
+
<xsl:when test="self::d:set">
|
|
42
|
+
<xsl:call-template name="set.toc">
|
|
43
|
+
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
|
|
44
|
+
</xsl:call-template>
|
|
45
|
+
</xsl:when>
|
|
46
|
+
<xsl:when test="self::d:book">
|
|
47
|
+
<xsl:call-template name="division.toc">
|
|
48
|
+
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
|
|
49
|
+
</xsl:call-template>
|
|
50
|
+
</xsl:when>
|
|
51
|
+
<xsl:when test="self::d:part">
|
|
52
|
+
<xsl:call-template name="division.toc">
|
|
53
|
+
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
|
|
54
|
+
</xsl:call-template>
|
|
55
|
+
</xsl:when>
|
|
56
|
+
</xsl:choose>
|
|
57
|
+
</xsl:for-each>
|
|
58
|
+
</xsl:when>
|
|
59
|
+
</xsl:choose>
|
|
60
|
+
</xsl:variable>
|
|
61
|
+
|
|
62
|
+
<xsl:if test="string-length(normalize-space($content)) != 0">
|
|
63
|
+
<xsl:copy-of select="$content"/>
|
|
64
|
+
</xsl:if>
|
|
65
|
+
</xsl:if>
|
|
66
|
+
</xsl:template>
|
|
67
|
+
|
|
68
|
+
<xsl:template match="d:chapter/d:toc | d:appendix/d:toc | d:preface/d:toc | d:article/d:toc">
|
|
69
|
+
<xsl:variable name="toc.params">
|
|
70
|
+
<xsl:call-template name="find.path.params">
|
|
71
|
+
<xsl:with-param name="node" select="parent::*"/>
|
|
72
|
+
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
|
|
73
|
+
</xsl:call-template>
|
|
74
|
+
</xsl:variable>
|
|
75
|
+
|
|
76
|
+
<!-- Do not output the toc element if one is already generated
|
|
77
|
+
by the use of $generate.toc parameter, or if
|
|
78
|
+
generating a source toc is turned off -->
|
|
79
|
+
<xsl:if test="not(contains($toc.params, 'toc')) and ($process.source.toc != 0 or $process.empty.source.toc != 0)">
|
|
80
|
+
<xsl:choose>
|
|
81
|
+
<xsl:when test="* and $process.source.toc != 0">
|
|
82
|
+
<div>
|
|
83
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
84
|
+
<xsl:call-template name="id.attribute"/>
|
|
85
|
+
<xsl:apply-templates select="d:title"/>
|
|
86
|
+
<dl>
|
|
87
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
88
|
+
<xsl:apply-templates select="*[not(self::d:title)]"/>
|
|
89
|
+
</dl>
|
|
90
|
+
</div>
|
|
91
|
+
<xsl:call-template name="component.toc.separator"/>
|
|
92
|
+
</xsl:when>
|
|
93
|
+
<xsl:when test="count(*) = 0 and $process.empty.source.toc != 0">
|
|
94
|
+
<!-- trick to switch context node to section element -->
|
|
95
|
+
<xsl:for-each select="parent::*">
|
|
96
|
+
<xsl:call-template name="component.toc">
|
|
97
|
+
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
|
|
98
|
+
</xsl:call-template>
|
|
99
|
+
</xsl:for-each>
|
|
100
|
+
<xsl:call-template name="component.toc.separator"/>
|
|
101
|
+
</xsl:when>
|
|
102
|
+
</xsl:choose>
|
|
103
|
+
</xsl:if>
|
|
104
|
+
</xsl:template>
|
|
105
|
+
|
|
106
|
+
<xsl:template match="d:section/d:toc |d:sect1/d:toc |d:sect2/d:toc |d:sect3/d:toc |d:sect4/d:toc |d:sect5/d:toc">
|
|
107
|
+
|
|
108
|
+
<xsl:variable name="toc.params">
|
|
109
|
+
<xsl:call-template name="find.path.params">
|
|
110
|
+
<xsl:with-param name="node" select="parent::*"/>
|
|
111
|
+
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
|
|
112
|
+
</xsl:call-template>
|
|
113
|
+
</xsl:variable>
|
|
114
|
+
|
|
115
|
+
<!-- Do not output the toc element if one is already generated
|
|
116
|
+
by the use of $generate.toc parameter, or if
|
|
117
|
+
generating a source toc is turned off -->
|
|
118
|
+
<xsl:if test="not(contains($toc.params, 'toc')) and ($process.source.toc != 0 or $process.empty.source.toc != 0)">
|
|
119
|
+
<xsl:choose>
|
|
120
|
+
<xsl:when test="* and $process.source.toc != 0">
|
|
121
|
+
<div>
|
|
122
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
123
|
+
<xsl:call-template name="id.attribute"/>
|
|
124
|
+
<xsl:apply-templates select="d:title"/>
|
|
125
|
+
<dl>
|
|
126
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
127
|
+
<xsl:apply-templates select="*[not(self::d:title)]"/>
|
|
128
|
+
</dl>
|
|
129
|
+
</div>
|
|
130
|
+
<xsl:call-template name="section.toc.separator"/>
|
|
131
|
+
</xsl:when>
|
|
132
|
+
<xsl:when test="count(*) = 0 and $process.empty.source.toc != 0">
|
|
133
|
+
<!-- trick to switch context node to section element -->
|
|
134
|
+
<xsl:for-each select="parent::*">
|
|
135
|
+
<xsl:call-template name="section.toc">
|
|
136
|
+
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
|
|
137
|
+
</xsl:call-template>
|
|
138
|
+
</xsl:for-each>
|
|
139
|
+
<xsl:call-template name="section.toc.separator"/>
|
|
140
|
+
</xsl:when>
|
|
141
|
+
</xsl:choose>
|
|
142
|
+
</xsl:if>
|
|
143
|
+
</xsl:template>
|
|
144
|
+
|
|
145
|
+
<!-- ==================================================================== -->
|
|
146
|
+
|
|
147
|
+
<xsl:template match="d:tocpart|d:tocchap |d:toclevel1|d:toclevel2|d:toclevel3|d:toclevel4|d:toclevel5">
|
|
148
|
+
<xsl:variable name="sub-toc">
|
|
149
|
+
<xsl:if test="d:tocchap|d:toclevel1|d:toclevel2|d:toclevel3|d:toclevel4|d:toclevel5">
|
|
150
|
+
<xsl:choose>
|
|
151
|
+
<xsl:when test="$toc.list.type = 'dl'">
|
|
152
|
+
<dd>
|
|
153
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
154
|
+
<xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
|
|
155
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
156
|
+
<xsl:apply-templates select="d:tocchap|d:toclevel1|d:toclevel2| d:toclevel3|d:toclevel4|d:toclevel5"/>
|
|
157
|
+
</xsl:element>
|
|
158
|
+
</dd>
|
|
159
|
+
</xsl:when>
|
|
160
|
+
<xsl:otherwise>
|
|
161
|
+
<xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
|
|
162
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
163
|
+
<xsl:apply-templates select="d:tocchap|d:toclevel1|d:toclevel2| d:toclevel3|d:toclevel4|d:toclevel5"/>
|
|
164
|
+
</xsl:element>
|
|
165
|
+
</xsl:otherwise>
|
|
166
|
+
</xsl:choose>
|
|
167
|
+
</xsl:if>
|
|
168
|
+
</xsl:variable>
|
|
169
|
+
|
|
170
|
+
<xsl:apply-templates select="d:tocentry[position() != last()]"/>
|
|
171
|
+
|
|
172
|
+
<xsl:choose>
|
|
173
|
+
<xsl:when test="$toc.list.type = 'dl'">
|
|
174
|
+
<dt>
|
|
175
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
176
|
+
<xsl:apply-templates select="d:tocentry[position() = last()]"/>
|
|
177
|
+
</dt>
|
|
178
|
+
<xsl:copy-of select="$sub-toc"/>
|
|
179
|
+
</xsl:when>
|
|
180
|
+
<xsl:otherwise>
|
|
181
|
+
<li>
|
|
182
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
183
|
+
<xsl:apply-templates select="d:tocentry[position() = last()]"/>
|
|
184
|
+
<xsl:copy-of select="$sub-toc"/>
|
|
185
|
+
</li>
|
|
186
|
+
</xsl:otherwise>
|
|
187
|
+
</xsl:choose>
|
|
188
|
+
</xsl:template>
|
|
189
|
+
|
|
190
|
+
<xsl:template match="d:tocentry|d:tocdiv|d:lotentry|d:tocfront|d:tocback">
|
|
191
|
+
<xsl:choose>
|
|
192
|
+
<xsl:when test="$toc.list.type = 'dl'">
|
|
193
|
+
<dt>
|
|
194
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
195
|
+
<xsl:call-template name="tocentry-content"/>
|
|
196
|
+
</dt>
|
|
197
|
+
</xsl:when>
|
|
198
|
+
<xsl:otherwise>
|
|
199
|
+
<li>
|
|
200
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
201
|
+
<xsl:call-template name="tocentry-content"/>
|
|
202
|
+
</li>
|
|
203
|
+
</xsl:otherwise>
|
|
204
|
+
</xsl:choose>
|
|
205
|
+
</xsl:template>
|
|
206
|
+
|
|
207
|
+
<xsl:template match="d:tocentry[position() = last()]" priority="2">
|
|
208
|
+
<xsl:call-template name="tocentry-content"/>
|
|
209
|
+
</xsl:template>
|
|
210
|
+
|
|
211
|
+
<xsl:template name="tocentry-content">
|
|
212
|
+
<xsl:variable name="targets" select="key('id',@linkend)"/>
|
|
213
|
+
<xsl:variable name="target" select="$targets[1]"/>
|
|
214
|
+
|
|
215
|
+
<xsl:choose>
|
|
216
|
+
<xsl:when test="@linkend">
|
|
217
|
+
<xsl:call-template name="check.id.unique">
|
|
218
|
+
<xsl:with-param name="linkend" select="@linkend"/>
|
|
219
|
+
</xsl:call-template>
|
|
220
|
+
<a>
|
|
221
|
+
<xsl:attribute name="href">
|
|
222
|
+
<xsl:call-template name="href.target">
|
|
223
|
+
<xsl:with-param name="object" select="$target"/>
|
|
224
|
+
</xsl:call-template>
|
|
225
|
+
</xsl:attribute>
|
|
226
|
+
<xsl:apply-templates/>
|
|
227
|
+
</a>
|
|
228
|
+
</xsl:when>
|
|
229
|
+
<xsl:otherwise>
|
|
230
|
+
<xsl:apply-templates/>
|
|
231
|
+
</xsl:otherwise>
|
|
232
|
+
</xsl:choose>
|
|
233
|
+
</xsl:template>
|
|
234
|
+
|
|
235
|
+
<xsl:template match="d:toc/d:title | d:tocdiv/d:title">
|
|
236
|
+
<div>
|
|
237
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
238
|
+
<xsl:apply-templates/>
|
|
239
|
+
</div>
|
|
240
|
+
</xsl:template>
|
|
241
|
+
|
|
242
|
+
<xsl:template match="d:toc/d:subtitle | d:tocdiv/d:subtitle">
|
|
243
|
+
<div>
|
|
244
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
245
|
+
<xsl:apply-templates/>
|
|
246
|
+
</div>
|
|
247
|
+
</xsl:template>
|
|
248
|
+
|
|
249
|
+
<xsl:template match="d:toc/d:titleabbrev | d:tocdiv/d:titleabbrev">
|
|
250
|
+
</xsl:template>
|
|
251
|
+
|
|
252
|
+
<!-- ==================================================================== -->
|
|
253
|
+
|
|
254
|
+
<!-- A lot element must have content, because there is no attribute
|
|
255
|
+
to select what kind of list should be generated -->
|
|
256
|
+
<xsl:template match="d:book/d:lot | d:part/d:lot">
|
|
257
|
+
<!-- Don't generate a page sequence unless there is content -->
|
|
258
|
+
<xsl:variable name="content">
|
|
259
|
+
<xsl:choose>
|
|
260
|
+
<xsl:when test="* and $process.source.toc != 0">
|
|
261
|
+
<div>
|
|
262
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
263
|
+
<xsl:apply-templates/>
|
|
264
|
+
</div>
|
|
265
|
+
</xsl:when>
|
|
266
|
+
<xsl:when test="not(child::*) and $process.empty.source.toc != 0">
|
|
267
|
+
<xsl:call-template name="process.empty.lot"/>
|
|
268
|
+
</xsl:when>
|
|
269
|
+
</xsl:choose>
|
|
270
|
+
</xsl:variable>
|
|
271
|
+
|
|
272
|
+
<xsl:if test="string-length(normalize-space($content)) != 0">
|
|
273
|
+
<xsl:copy-of select="$content"/>
|
|
274
|
+
</xsl:if>
|
|
275
|
+
</xsl:template>
|
|
276
|
+
|
|
277
|
+
<xsl:template match="d:chapter/d:lot | d:appendix/d:lot | d:preface/d:lot | d:article/d:lot">
|
|
278
|
+
<xsl:choose>
|
|
279
|
+
<xsl:when test="* and $process.source.toc != 0">
|
|
280
|
+
<div>
|
|
281
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
282
|
+
<xsl:apply-templates/>
|
|
283
|
+
</div>
|
|
284
|
+
<xsl:call-template name="component.toc.separator"/>
|
|
285
|
+
</xsl:when>
|
|
286
|
+
<xsl:when test="not(child::*) and $process.empty.source.toc != 0">
|
|
287
|
+
<xsl:call-template name="process.empty.lot"/>
|
|
288
|
+
</xsl:when>
|
|
289
|
+
</xsl:choose>
|
|
290
|
+
</xsl:template>
|
|
291
|
+
|
|
292
|
+
<xsl:template match="d:section/d:lot |d:sect1/d:lot |d:sect2/d:lot |d:sect3/d:lot |d:sect4/d:lot |d:sect5/d:lot">
|
|
293
|
+
<xsl:choose>
|
|
294
|
+
<xsl:when test="* and $process.source.toc != 0">
|
|
295
|
+
<div>
|
|
296
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
297
|
+
<xsl:apply-templates/>
|
|
298
|
+
</div>
|
|
299
|
+
<xsl:call-template name="section.toc.separator"/>
|
|
300
|
+
</xsl:when>
|
|
301
|
+
<xsl:when test="not(child::*) and $process.empty.source.toc != 0">
|
|
302
|
+
<xsl:call-template name="process.empty.lot"/>
|
|
303
|
+
</xsl:when>
|
|
304
|
+
</xsl:choose>
|
|
305
|
+
</xsl:template>
|
|
306
|
+
|
|
307
|
+
<xsl:template name="process.empty.lot">
|
|
308
|
+
<!-- An empty lot element does not provide any information to indicate
|
|
309
|
+
what should be included in it. You can customize this
|
|
310
|
+
template to generate a lot based on @role or something -->
|
|
311
|
+
<xsl:message>
|
|
312
|
+
<xsl:text>Warning: don't know what to generate for </xsl:text>
|
|
313
|
+
<xsl:text>lot that has no children.</xsl:text>
|
|
314
|
+
</xsl:message>
|
|
315
|
+
</xsl:template>
|
|
316
|
+
|
|
317
|
+
<xsl:template match="d:lot/d:title">
|
|
318
|
+
<div>
|
|
319
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
320
|
+
<xsl:apply-templates/>
|
|
321
|
+
</div>
|
|
322
|
+
</xsl:template>
|
|
323
|
+
|
|
324
|
+
<xsl:template match="d:lot/d:subtitle">
|
|
325
|
+
<div>
|
|
326
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
327
|
+
<xsl:apply-templates/>
|
|
328
|
+
</div>
|
|
329
|
+
</xsl:template>
|
|
330
|
+
|
|
331
|
+
<xsl:template match="d:lot/d:titleabbrev">
|
|
332
|
+
</xsl:template>
|
|
333
|
+
|
|
334
|
+
</xsl:stylesheet>
|
|
@@ -0,0 +1,389 @@
|
|
|
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:sverb="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Verbatim" xmlns:xverb="xalan://com.nwalsh.xalan.Verbatim" xmlns:lxslt="http://xml.apache.org/xslt" xmlns:exsl="http://exslt.org/common" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="sverb xverb lxslt exsl d" version="1.0">
|
|
6
|
+
|
|
7
|
+
<!-- ********************************************************************
|
|
8
|
+
$Id: verbatim.xsl 9589 2012-09-02 20:52:15Z tom_schr $
|
|
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
|
+
<!-- XSLTHL highlighting is turned off by default. See highlighting/README
|
|
18
|
+
for instructions on how to turn on XSLTHL -->
|
|
19
|
+
<xsl:template name="apply-highlighting">
|
|
20
|
+
<xsl:apply-templates/>
|
|
21
|
+
</xsl:template>
|
|
22
|
+
|
|
23
|
+
<lxslt:component prefix="xverb" functions="numberLines"/>
|
|
24
|
+
|
|
25
|
+
<xsl:template match="d:programlisting|d:screen|d:synopsis">
|
|
26
|
+
<xsl:param name="suppress-numbers" select="'0'"/>
|
|
27
|
+
|
|
28
|
+
<xsl:call-template name="anchor"/>
|
|
29
|
+
|
|
30
|
+
<xsl:variable name="div.element">pre</xsl:variable>
|
|
31
|
+
|
|
32
|
+
<xsl:if test="$shade.verbatim != 0">
|
|
33
|
+
<xsl:message>
|
|
34
|
+
<xsl:text>The shade.verbatim parameter is deprecated. </xsl:text>
|
|
35
|
+
<xsl:text>Use CSS instead,</xsl:text>
|
|
36
|
+
</xsl:message>
|
|
37
|
+
<xsl:message>
|
|
38
|
+
<xsl:text>for example: pre.</xsl:text>
|
|
39
|
+
<xsl:value-of select="local-name(.)"/>
|
|
40
|
+
<xsl:text> { background-color: #E0E0E0; }</xsl:text>
|
|
41
|
+
</xsl:message>
|
|
42
|
+
</xsl:if>
|
|
43
|
+
|
|
44
|
+
<xsl:choose>
|
|
45
|
+
<xsl:when test="$suppress-numbers = '0' and @linenumbering = 'numbered' and $use.extensions != '0' and $linenumbering.extension != '0'">
|
|
46
|
+
<xsl:variable name="rtf">
|
|
47
|
+
<xsl:choose>
|
|
48
|
+
<xsl:when test="$highlight.source != 0">
|
|
49
|
+
<xsl:call-template name="apply-highlighting"/>
|
|
50
|
+
</xsl:when>
|
|
51
|
+
<xsl:otherwise>
|
|
52
|
+
<xsl:apply-templates/>
|
|
53
|
+
</xsl:otherwise>
|
|
54
|
+
</xsl:choose>
|
|
55
|
+
</xsl:variable>
|
|
56
|
+
<xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
|
|
57
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
58
|
+
<xsl:call-template name="id.attribute"/>
|
|
59
|
+
<xsl:if test="@width != ''">
|
|
60
|
+
<xsl:attribute name="width">
|
|
61
|
+
<xsl:value-of select="@width"/>
|
|
62
|
+
</xsl:attribute>
|
|
63
|
+
</xsl:if>
|
|
64
|
+
<xsl:call-template name="number.rtf.lines">
|
|
65
|
+
<xsl:with-param name="rtf" select="$rtf"/>
|
|
66
|
+
</xsl:call-template>
|
|
67
|
+
</xsl:element>
|
|
68
|
+
</xsl:when>
|
|
69
|
+
<xsl:otherwise>
|
|
70
|
+
<xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
|
|
71
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
72
|
+
<xsl:call-template name="id.attribute"/>
|
|
73
|
+
<xsl:if test="@width != ''">
|
|
74
|
+
<xsl:attribute name="width">
|
|
75
|
+
<xsl:value-of select="@width"/>
|
|
76
|
+
</xsl:attribute>
|
|
77
|
+
</xsl:if>
|
|
78
|
+
<xsl:choose>
|
|
79
|
+
<xsl:when test="$highlight.source != 0">
|
|
80
|
+
<xsl:call-template name="apply-highlighting"/>
|
|
81
|
+
</xsl:when>
|
|
82
|
+
<xsl:otherwise>
|
|
83
|
+
<xsl:apply-templates/>
|
|
84
|
+
</xsl:otherwise>
|
|
85
|
+
</xsl:choose>
|
|
86
|
+
</xsl:element>
|
|
87
|
+
</xsl:otherwise>
|
|
88
|
+
</xsl:choose>
|
|
89
|
+
</xsl:template>
|
|
90
|
+
|
|
91
|
+
<xsl:template match="d:literallayout">
|
|
92
|
+
<xsl:param name="suppress-numbers" select="'0'"/>
|
|
93
|
+
|
|
94
|
+
<xsl:variable name="rtf">
|
|
95
|
+
<xsl:apply-templates/>
|
|
96
|
+
</xsl:variable>
|
|
97
|
+
|
|
98
|
+
<xsl:if test="$shade.verbatim != 0 and @class='monospaced'">
|
|
99
|
+
<xsl:message>
|
|
100
|
+
<xsl:text>The shade.verbatim parameter is deprecated. </xsl:text>
|
|
101
|
+
<xsl:text>Use CSS instead,</xsl:text>
|
|
102
|
+
</xsl:message>
|
|
103
|
+
<xsl:message>
|
|
104
|
+
<xsl:text>for example: pre.</xsl:text>
|
|
105
|
+
<xsl:value-of select="local-name(.)"/>
|
|
106
|
+
<xsl:text> { background-color: #E0E0E0; }</xsl:text>
|
|
107
|
+
</xsl:message>
|
|
108
|
+
</xsl:if>
|
|
109
|
+
|
|
110
|
+
<xsl:choose>
|
|
111
|
+
<xsl:when test="$suppress-numbers = '0' and @linenumbering = 'numbered' and $use.extensions != '0' and $linenumbering.extension != '0'">
|
|
112
|
+
<xsl:choose>
|
|
113
|
+
<xsl:when test="@class='monospaced'">
|
|
114
|
+
<pre>
|
|
115
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
116
|
+
<xsl:call-template name="id.attribute"/>
|
|
117
|
+
<xsl:call-template name="number.rtf.lines">
|
|
118
|
+
<xsl:with-param name="rtf" select="$rtf"/>
|
|
119
|
+
</xsl:call-template>
|
|
120
|
+
</pre>
|
|
121
|
+
</xsl:when>
|
|
122
|
+
<xsl:otherwise>
|
|
123
|
+
<div>
|
|
124
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
125
|
+
<xsl:call-template name="id.attribute"/>
|
|
126
|
+
<p>
|
|
127
|
+
<xsl:call-template name="number.rtf.lines">
|
|
128
|
+
<xsl:with-param name="rtf" select="$rtf"/>
|
|
129
|
+
</xsl:call-template>
|
|
130
|
+
</p>
|
|
131
|
+
</div>
|
|
132
|
+
</xsl:otherwise>
|
|
133
|
+
</xsl:choose>
|
|
134
|
+
</xsl:when>
|
|
135
|
+
<xsl:otherwise>
|
|
136
|
+
<xsl:choose>
|
|
137
|
+
<xsl:when test="@class='monospaced'">
|
|
138
|
+
<pre>
|
|
139
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
140
|
+
<xsl:call-template name="id.attribute"/>
|
|
141
|
+
<xsl:copy-of select="$rtf"/>
|
|
142
|
+
</pre>
|
|
143
|
+
</xsl:when>
|
|
144
|
+
<xsl:otherwise>
|
|
145
|
+
<div>
|
|
146
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
147
|
+
<xsl:call-template name="id.attribute"/>
|
|
148
|
+
<p>
|
|
149
|
+
<xsl:call-template name="make-verbatim">
|
|
150
|
+
<xsl:with-param name="rtf" select="$rtf"/>
|
|
151
|
+
</xsl:call-template>
|
|
152
|
+
</p>
|
|
153
|
+
</div>
|
|
154
|
+
</xsl:otherwise>
|
|
155
|
+
</xsl:choose>
|
|
156
|
+
</xsl:otherwise>
|
|
157
|
+
</xsl:choose>
|
|
158
|
+
</xsl:template>
|
|
159
|
+
|
|
160
|
+
<xsl:template match="d:address">
|
|
161
|
+
<xsl:param name="suppress-numbers" select="'0'"/>
|
|
162
|
+
|
|
163
|
+
<xsl:variable name="rtf">
|
|
164
|
+
<xsl:apply-templates/>
|
|
165
|
+
</xsl:variable>
|
|
166
|
+
|
|
167
|
+
<xsl:choose>
|
|
168
|
+
<xsl:when test="$suppress-numbers = '0' and @linenumbering = 'numbered' and $use.extensions != '0' and $linenumbering.extension != '0'">
|
|
169
|
+
<div>
|
|
170
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
171
|
+
<xsl:call-template name="id.attribute"/>
|
|
172
|
+
<p>
|
|
173
|
+
<xsl:call-template name="number.rtf.lines">
|
|
174
|
+
<xsl:with-param name="rtf" select="$rtf"/>
|
|
175
|
+
</xsl:call-template>
|
|
176
|
+
</p>
|
|
177
|
+
</div>
|
|
178
|
+
</xsl:when>
|
|
179
|
+
|
|
180
|
+
<xsl:otherwise>
|
|
181
|
+
<div>
|
|
182
|
+
<xsl:apply-templates select="." mode="common.html.attributes"/>
|
|
183
|
+
<xsl:call-template name="id.attribute"/>
|
|
184
|
+
<p>
|
|
185
|
+
<xsl:call-template name="make-verbatim">
|
|
186
|
+
<xsl:with-param name="rtf" select="$rtf"/>
|
|
187
|
+
</xsl:call-template>
|
|
188
|
+
</p>
|
|
189
|
+
</div>
|
|
190
|
+
</xsl:otherwise>
|
|
191
|
+
</xsl:choose>
|
|
192
|
+
</xsl:template>
|
|
193
|
+
|
|
194
|
+
<xsl:template name="number.rtf.lines">
|
|
195
|
+
<xsl:param name="rtf" select="''"/>
|
|
196
|
+
<xsl:param name="pi.context" select="."/>
|
|
197
|
+
|
|
198
|
+
<!-- Save the global values -->
|
|
199
|
+
<xsl:variable name="global.linenumbering.everyNth" select="$linenumbering.everyNth"/>
|
|
200
|
+
|
|
201
|
+
<xsl:variable name="global.linenumbering.separator" select="$linenumbering.separator"/>
|
|
202
|
+
|
|
203
|
+
<xsl:variable name="global.linenumbering.width" select="$linenumbering.width"/>
|
|
204
|
+
|
|
205
|
+
<!-- Extract the <?dbhtml linenumbering.*?> PI values -->
|
|
206
|
+
<xsl:variable name="pi.linenumbering.everyNth">
|
|
207
|
+
<xsl:call-template name="pi.dbhtml_linenumbering.everyNth">
|
|
208
|
+
<xsl:with-param name="node" select="$pi.context"/>
|
|
209
|
+
</xsl:call-template>
|
|
210
|
+
</xsl:variable>
|
|
211
|
+
|
|
212
|
+
<xsl:variable name="pi.linenumbering.separator">
|
|
213
|
+
<xsl:call-template name="pi.dbhtml_linenumbering.separator">
|
|
214
|
+
<xsl:with-param name="node" select="$pi.context"/>
|
|
215
|
+
</xsl:call-template>
|
|
216
|
+
</xsl:variable>
|
|
217
|
+
|
|
218
|
+
<xsl:variable name="pi.linenumbering.width">
|
|
219
|
+
<xsl:call-template name="pi.dbhtml_linenumbering.width">
|
|
220
|
+
<xsl:with-param name="node" select="$pi.context"/>
|
|
221
|
+
</xsl:call-template>
|
|
222
|
+
</xsl:variable>
|
|
223
|
+
|
|
224
|
+
<!-- Construct the 'in-context' values -->
|
|
225
|
+
<xsl:variable name="linenumbering.everyNth">
|
|
226
|
+
<xsl:choose>
|
|
227
|
+
<xsl:when test="$pi.linenumbering.everyNth != ''">
|
|
228
|
+
<xsl:value-of select="$pi.linenumbering.everyNth"/>
|
|
229
|
+
</xsl:when>
|
|
230
|
+
<xsl:otherwise>
|
|
231
|
+
<xsl:value-of select="$global.linenumbering.everyNth"/>
|
|
232
|
+
</xsl:otherwise>
|
|
233
|
+
</xsl:choose>
|
|
234
|
+
</xsl:variable>
|
|
235
|
+
|
|
236
|
+
<xsl:variable name="linenumbering.separator">
|
|
237
|
+
<xsl:choose>
|
|
238
|
+
<xsl:when test="$pi.linenumbering.separator != ''">
|
|
239
|
+
<xsl:value-of select="$pi.linenumbering.separator"/>
|
|
240
|
+
</xsl:when>
|
|
241
|
+
<xsl:otherwise>
|
|
242
|
+
<xsl:value-of select="$global.linenumbering.separator"/>
|
|
243
|
+
</xsl:otherwise>
|
|
244
|
+
</xsl:choose>
|
|
245
|
+
</xsl:variable>
|
|
246
|
+
|
|
247
|
+
<xsl:variable name="linenumbering.width">
|
|
248
|
+
<xsl:choose>
|
|
249
|
+
<xsl:when test="$pi.linenumbering.width != ''">
|
|
250
|
+
<xsl:value-of select="$pi.linenumbering.width"/>
|
|
251
|
+
</xsl:when>
|
|
252
|
+
<xsl:otherwise>
|
|
253
|
+
<xsl:value-of select="$global.linenumbering.width"/>
|
|
254
|
+
</xsl:otherwise>
|
|
255
|
+
</xsl:choose>
|
|
256
|
+
</xsl:variable>
|
|
257
|
+
|
|
258
|
+
<xsl:variable name="linenumbering.startinglinenumber">
|
|
259
|
+
<xsl:choose>
|
|
260
|
+
<xsl:when test="$pi.context/@startinglinenumber">
|
|
261
|
+
<xsl:value-of select="$pi.context/@startinglinenumber"/>
|
|
262
|
+
</xsl:when>
|
|
263
|
+
<xsl:when test="$pi.context/@continuation='continues'">
|
|
264
|
+
<xsl:variable name="lastLine">
|
|
265
|
+
<xsl:choose>
|
|
266
|
+
<xsl:when test="$pi.context/self::d:programlisting">
|
|
267
|
+
<xsl:call-template name="lastLineNumber">
|
|
268
|
+
<xsl:with-param name="listings" select="preceding::d:programlisting[@linenumbering='numbered']"/>
|
|
269
|
+
</xsl:call-template>
|
|
270
|
+
</xsl:when>
|
|
271
|
+
<xsl:when test="$pi.context/self::d:screen">
|
|
272
|
+
<xsl:call-template name="lastLineNumber">
|
|
273
|
+
<xsl:with-param name="listings" select="preceding::d:screen[@linenumbering='numbered']"/>
|
|
274
|
+
</xsl:call-template>
|
|
275
|
+
</xsl:when>
|
|
276
|
+
<xsl:when test="$pi.context/self::d:literallayout">
|
|
277
|
+
<xsl:call-template name="lastLineNumber">
|
|
278
|
+
<xsl:with-param name="listings" select="preceding::d:literallayout[@linenumbering='numbered']"/>
|
|
279
|
+
</xsl:call-template>
|
|
280
|
+
</xsl:when>
|
|
281
|
+
<xsl:when test="$pi.context/self::d:address">
|
|
282
|
+
<xsl:call-template name="lastLineNumber">
|
|
283
|
+
<xsl:with-param name="listings" select="preceding::d:address[@linenumbering='numbered']"/>
|
|
284
|
+
</xsl:call-template>
|
|
285
|
+
</xsl:when>
|
|
286
|
+
<xsl:when test="$pi.context/self::d:synopsis">
|
|
287
|
+
<xsl:call-template name="lastLineNumber">
|
|
288
|
+
<xsl:with-param name="listings" select="preceding::d:synopsis[@linenumbering='numbered']"/>
|
|
289
|
+
</xsl:call-template>
|
|
290
|
+
</xsl:when>
|
|
291
|
+
<xsl:otherwise>
|
|
292
|
+
<xsl:message>
|
|
293
|
+
<xsl:text>Unexpected verbatim environment: </xsl:text>
|
|
294
|
+
<xsl:value-of select="local-name($pi.context)"/>
|
|
295
|
+
</xsl:message>
|
|
296
|
+
<xsl:value-of select="0"/>
|
|
297
|
+
</xsl:otherwise>
|
|
298
|
+
</xsl:choose>
|
|
299
|
+
</xsl:variable>
|
|
300
|
+
|
|
301
|
+
<xsl:value-of select="$lastLine + 1"/>
|
|
302
|
+
</xsl:when>
|
|
303
|
+
<xsl:otherwise>1</xsl:otherwise>
|
|
304
|
+
</xsl:choose>
|
|
305
|
+
</xsl:variable>
|
|
306
|
+
|
|
307
|
+
<xsl:choose>
|
|
308
|
+
<xsl:when test="function-available('sverb:numberLines')">
|
|
309
|
+
<xsl:copy-of select="sverb:numberLines($rtf)"/>
|
|
310
|
+
</xsl:when>
|
|
311
|
+
<xsl:when test="function-available('xverb:numberLines')">
|
|
312
|
+
<xsl:copy-of select="xverb:numberLines($rtf)"/>
|
|
313
|
+
</xsl:when>
|
|
314
|
+
<xsl:otherwise>
|
|
315
|
+
<xsl:message terminate="yes">
|
|
316
|
+
<xsl:text>No numberLines function available.</xsl:text>
|
|
317
|
+
</xsl:message>
|
|
318
|
+
</xsl:otherwise>
|
|
319
|
+
</xsl:choose>
|
|
320
|
+
</xsl:template>
|
|
321
|
+
|
|
322
|
+
<xsl:template name="make-verbatim">
|
|
323
|
+
<xsl:param name="rtf"/>
|
|
324
|
+
|
|
325
|
+
<!-- I want to make this RTF verbatim. There are two possibilities: either
|
|
326
|
+
I have access to the exsl:node-set extension function and I can "do it right"
|
|
327
|
+
or I have to rely on CSS. -->
|
|
328
|
+
|
|
329
|
+
<xsl:choose>
|
|
330
|
+
<xsl:when test="$exsl.node.set.available != 0">
|
|
331
|
+
<xsl:apply-templates select="exsl:node-set($rtf)" mode="make.verbatim.mode"/>
|
|
332
|
+
</xsl:when>
|
|
333
|
+
<xsl:otherwise>
|
|
334
|
+
<span style="white-space: pre;">
|
|
335
|
+
<xsl:copy-of select="$rtf"/>
|
|
336
|
+
</span>
|
|
337
|
+
</xsl:otherwise>
|
|
338
|
+
</xsl:choose>
|
|
339
|
+
</xsl:template>
|
|
340
|
+
|
|
341
|
+
<!-- ======================================================================== -->
|
|
342
|
+
|
|
343
|
+
<xsl:template name="lastLineNumber">
|
|
344
|
+
<xsl:param name="listings"/>
|
|
345
|
+
<xsl:param name="number" select="0"/>
|
|
346
|
+
|
|
347
|
+
<xsl:variable name="lines">
|
|
348
|
+
<xsl:call-template name="countLines">
|
|
349
|
+
<xsl:with-param name="listing" select="string($listings[1])"/>
|
|
350
|
+
</xsl:call-template>
|
|
351
|
+
</xsl:variable>
|
|
352
|
+
|
|
353
|
+
<xsl:choose>
|
|
354
|
+
<xsl:when test="not($listings)">
|
|
355
|
+
<xsl:value-of select="$number"/>
|
|
356
|
+
</xsl:when>
|
|
357
|
+
<xsl:when test="$listings[1]/@startinglinenumber">
|
|
358
|
+
<xsl:value-of select="$number + $listings[1]/@startinglinenumber + $lines - 1"/>
|
|
359
|
+
</xsl:when>
|
|
360
|
+
<xsl:when test="$listings[1]/@continuation='continues'">
|
|
361
|
+
<xsl:call-template name="lastLineNumber">
|
|
362
|
+
<xsl:with-param name="listings" select="$listings[position() > 1]"/>
|
|
363
|
+
<xsl:with-param name="number" select="$number + $lines"/>
|
|
364
|
+
</xsl:call-template>
|
|
365
|
+
</xsl:when>
|
|
366
|
+
<xsl:otherwise>
|
|
367
|
+
<xsl:value-of select="$lines"/>
|
|
368
|
+
</xsl:otherwise>
|
|
369
|
+
</xsl:choose>
|
|
370
|
+
</xsl:template>
|
|
371
|
+
|
|
372
|
+
<xsl:template name="countLines">
|
|
373
|
+
<xsl:param name="listing"/>
|
|
374
|
+
<xsl:param name="count" select="1"/>
|
|
375
|
+
|
|
376
|
+
<xsl:choose>
|
|
377
|
+
<xsl:when test="contains($listing, ' ')">
|
|
378
|
+
<xsl:call-template name="countLines">
|
|
379
|
+
<xsl:with-param name="listing" select="substring-after($listing, ' ')"/>
|
|
380
|
+
<xsl:with-param name="count" select="$count + 1"/>
|
|
381
|
+
</xsl:call-template>
|
|
382
|
+
</xsl:when>
|
|
383
|
+
<xsl:otherwise>
|
|
384
|
+
<xsl:value-of select="$count"/>
|
|
385
|
+
</xsl:otherwise>
|
|
386
|
+
</xsl:choose>
|
|
387
|
+
</xsl:template>
|
|
388
|
+
|
|
389
|
+
</xsl:stylesheet>
|