1 diff -ruNp docbook-xsl-1.74.0.orig/html/docbook.xsl docbook-xsl-1.74.0/html/docbook.xsl
2 --- docbook-xsl-1.74.0.orig/html/docbook.xsl 2008-06-01 23:36:39.000000000 +0200
3 +++ docbook-xsl-1.74.0/html/docbook.xsl 2008-08-06 13:37:35.000000000 +0200
5 <xsl:include href="../VERSION"/>
6 <xsl:include href="param.xsl"/>
7 <xsl:include href="../lib/lib.xsl"/>
8 +<xsl:include href="../lib/dumpfragment.xsl"/>
9 <xsl:include href="../common/l10n.xsl"/>
10 <xsl:include href="../common/common.xsl"/>
11 <xsl:include href="../common/utility.xsl"/>
13 <xsl:include href="graphics.xsl"/>
14 <xsl:include href="xref.xsl"/>
15 <xsl:include href="formal.xsl"/>
16 +<xsl:include href="dtbl.xsl"/>
17 <xsl:include href="table.xsl"/>
18 <xsl:include href="htmltbl.xsl"/>
19 <xsl:include href="sections.xsl"/>
20 diff -ruNp docbook-xsl-1.74.0.orig/html/dtbl.xsl docbook-xsl-1.74.0/html/dtbl.xsl
21 --- docbook-xsl-1.74.0.orig/html/dtbl.xsl 1970-01-01 01:00:00.000000000 +0100
22 +++ docbook-xsl-1.74.0/html/dtbl.xsl 2008-08-06 13:37:35.000000000 +0200
24 +<?xml version="1.0" encoding="US-ASCII"?>
25 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
26 + xmlns:exsl="http://exslt.org/common"
27 + xmlns:func="http://exslt.org/functions"
28 + xmlns:dtbl="http://docbook.sourceforge.net/dtbl"
29 + extension-element-prefixes="func"
30 + exclude-result-prefixes="exsl func dtbl"
33 +<func:function name="dtbl:convertLength">
34 + <xsl:param name="arbitrary.length"/>
36 + <xsl:variable name="pixels.per.inch" select="96"/>
38 + <xsl:variable name="unscaled.length"
39 + select="translate($arbitrary.length, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ', '')"/>
41 + <xsl:variable name="units"
42 + select="translate($arbitrary.length,'+-0123456789. ', '')"/>
44 + <xsl:variable name="scaled.length">
46 + <xsl:when test="$units='in'">
47 + <xsl:value-of select="$unscaled.length * $pixels.per.inch"/>
49 + <xsl:when test="$units='cm'">
50 + <xsl:value-of select="$unscaled.length * ($pixels.per.inch div 2.54)"/>
52 + <xsl:when test="$units='mm'">
53 + <xsl:value-of select="$unscaled.length * ($pixels.per.inch div 25.4)"/>
55 + <xsl:when test="$units='pc'">
56 + <xsl:value-of select="$unscaled.length * (($pixels.per.inch div 72) * 12)"/>
58 + <xsl:when test="$units='pt'">
59 + <xsl:value-of select="$unscaled.length * ($pixels.per.inch div 72)"/>
61 + <xsl:when test="$units='px' or $units=''">
62 + <xsl:value-of select="$unscaled.length"/>
65 + <xsl:message terminate="no">
66 + <xsl:text>"</xsl:text>
67 + <xsl:value-of select="$units"/>
68 + <xsl:text>" is not a known unit. Applying scaling factor of 1 instead.</xsl:text>
70 + <xsl:value-of select="$unscaled.length"/>
75 + <func:result select="round($scaled.length)"/>
78 +<func:function name="dtbl:adjustColumnWidths">
79 + <xsl:param name="colgroup"/>
81 + <xsl:if test="$adjustColumnWidths.debug">
83 + <xsl:text>entering adjustColumnWidths(</xsl:text>
84 + <xsl:call-template name="dump-fragment">
85 + <xsl:with-param name="fragment" select="$colgroup"/>
86 + </xsl:call-template>
87 + <xsl:text>)</xsl:text>
91 + <xsl:variable name="expanded.colgroup">
92 + <xsl:apply-templates select="exsl:node-set($colgroup)/*" mode="dtbl-split-widths"/>
95 + <xsl:variable name="absolute.widths.total">
96 + <xsl:value-of select="sum(exsl:node-set($expanded.colgroup)//col/@abswidth)"/>
99 + <xsl:variable name="relative.widths.total">
100 + <xsl:value-of select="sum(exsl:node-set($expanded.colgroup)//col/@relwidth)"/>
103 + <xsl:if test="$adjustColumnWidths.debug">
105 + <xsl:text>total relative widths = (</xsl:text>
106 + <xsl:value-of select="$relative.widths.total"/>
107 + <xsl:text>)</xsl:text>
110 + <xsl:text>total absolute widths = (</xsl:text>
111 + <xsl:value-of select="$absolute.widths.total"/>
112 + <xsl:text>)</xsl:text>
116 + <xsl:variable name="adjusted.colgroup">
118 + <xsl:when test="$relative.widths.total = 0">
119 + <xsl:if test="$adjustColumnWidths.debug">
120 + <xsl:message>all widths are absolute</xsl:message>
122 + <xsl:apply-templates select="exsl:node-set($expanded.colgroup)/*"
123 + mode="dtbl-use-absolute-widths"/>
125 + <xsl:when test="$absolute.widths.total = 0">
126 + <xsl:if test="$adjustColumnWidths.debug">
127 + <xsl:message>all widths are relative</xsl:message>
129 + <xsl:apply-templates select="exsl:node-set($expanded.colgroup)/*"
130 + mode="dtbl-use-relative-widths">
131 + <xsl:with-param name="relative.widths.total"
132 + select="$relative.widths.total"/>
133 + </xsl:apply-templates>
138 + <xsl:variable name="corrected.adjusted.colgroup">
140 + <xsl:when test="$relative.widths.total = 0">
141 + <xsl:copy-of select="$adjusted.colgroup"/>
144 + <xsl:variable name="widths.total"
145 + select="sum(exsl:node-set($adjusted.colgroup)//col/@width)"/>
146 + <xsl:variable name="n.columns"
147 + select="count(exsl:node-set($adjusted.colgroup)//col)"/>
148 + <xsl:variable name="error"
149 + select="100 - $widths.total"/>
150 + <xsl:variable name="first.bad.column"
151 + select="($n.columns - $error) + 1"/>
152 + <xsl:apply-templates select="exsl:node-set($adjusted.colgroup)/*"
153 + mode="dtbl-correct-rounding-error">
154 + <xsl:with-param name="first.bad.column"
155 + select="$first.bad.column"/>
156 + </xsl:apply-templates>
161 + <xsl:if test="$adjustColumnWidths.debug">
163 + <xsl:text>result = (</xsl:text>
164 + <xsl:call-template name="dump-fragment">
165 + <xsl:with-param name="fragment" select="$corrected.adjusted.colgroup"/>
166 + </xsl:call-template>
167 + <xsl:text>)</xsl:text>
171 + <func:result select="$corrected.adjusted.colgroup"/>
174 +<xsl:template match="colgroup" mode="dtbl-correct-rounding-error">
175 + <xsl:param name="first.bad.column"/>
177 + <xsl:if test="$adjustColumnWidths.debug">
179 + <xsl:text>first.bad.column = (</xsl:text>
180 + <xsl:value-of select="$first.bad.column"/>
181 + <xsl:text>)</xsl:text>
186 + <xsl:for-each select="col[position() < $first.bad.column]">
187 + <xsl:element name="col">
188 + <xsl:attribute name="width">
189 + <xsl:value-of select="concat(@width, '%')"/>
193 + <xsl:for-each select="col[position() >= $first.bad.column]">
194 + <xsl:element name="col">
195 + <xsl:attribute name="width">
196 + <xsl:value-of select="concat(@width + 1, '%')"/>
203 +<xsl:template match="col" mode="dtbl-correct-rounding-error">
204 + <xsl:param name="relative.widths.total"/>
205 + <xsl:param name="error"/>
207 + <xsl:element name="col">
208 + <xsl:attribute name="width">
209 + <xsl:value-of select="concat('', round((@relwidth div $relative.widths.total) * 100))"/>
211 + <xsl:apply-templates mode="dtbl-use-absolute-widths"/>
215 +<xsl:template match="colgroup" mode="dtbl-use-relative-widths">
216 + <xsl:param name="relative.widths.total"/>
219 + <xsl:apply-templates mode="dtbl-use-relative-widths">
220 + <xsl:with-param name="relative.widths.total"
221 + select="$relative.widths.total"/>
222 + </xsl:apply-templates>
226 +<xsl:template match="col" mode="dtbl-use-relative-widths">
227 + <xsl:param name="relative.widths.total"/>
229 + <xsl:element name="col">
230 + <xsl:attribute name="width">
231 + <xsl:value-of select="round((@relwidth div $relative.widths.total) * 100)"/>
233 + <xsl:apply-templates mode="dtbl-use-absolute-widths"/>
237 +<xsl:template match="colgroup" mode="dtbl-use-absolute-widths">
239 + <xsl:apply-templates mode="dtbl-use-absolute-widths"/>
243 +<xsl:template match="col" mode="dtbl-use-absolute-widths">
244 + <xsl:element name="col">
245 + <xsl:attribute name="width">
246 + <xsl:value-of select="@abswidth"/>
248 + <xsl:apply-templates mode="dtbl-use-absolute-widths"/>
252 +<xsl:template match="colgroup" mode="dtbl-split-widths">
254 + <xsl:apply-templates mode="dtbl-split-widths"/>
258 +<xsl:template match="col" mode="dtbl-split-widths">
260 + <!-- width = @width ? @width : '1*' -->
261 + <xsl:variable name="width">
263 + <xsl:when test="@width != ''">
264 + <xsl:value-of select="@width"/>
267 + <xsl:text>1*</xsl:text>
272 + <!-- absolute.width = contains($width,'*') ? substring-after($width, '*') : $width -->
273 + <xsl:variable name="absolute.width">
275 + <xsl:when test="contains($width, '*')">
276 + <xsl:value-of select="substring-after($width, '*')"/>
279 + <xsl:value-of select="$width"/>
284 + <xsl:variable name="converted.absolute.width">
286 + <xsl:when test="$absolute.width != ''">
287 + <xsl:value-of select="dtbl:convertLength($absolute.width)"/>
289 + <xsl:otherwise>0</xsl:otherwise>
293 + <xsl:variable name="relative.width">
295 + <xsl:when test="substring-before($width, '*') != ''">
296 + <xsl:value-of select="substring-before($width, '*')"/>
298 + <xsl:otherwise>0</xsl:otherwise>
302 + <xsl:element name="col">
303 + <xsl:attribute name="width">
304 + <xsl:value-of select="$width"/>
306 + <xsl:attribute name="relwidth">
307 + <xsl:value-of select="$relative.width"/>
309 + <xsl:attribute name="abswidth">
310 + <xsl:value-of select="$converted.absolute.width"/>
312 + <xsl:apply-templates mode="dtbl-split-widths"/>
317 diff -ruNp docbook-xsl-1.74.0.orig/html/table.xsl docbook-xsl-1.74.0/html/table.xsl
318 --- docbook-xsl-1.74.0.orig/html/table.xsl 2008-06-01 23:36:39.000000000 +0200
319 +++ docbook-xsl-1.74.0/html/table.xsl 2008-08-06 13:37:35.000000000 +0200
321 xmlns:xtbl="xalan://com.nwalsh.xalan.Table"
322 xmlns:lxslt="http://xml.apache.org/xslt"
323 xmlns:ptbl="http://nwalsh.com/xslt/ext/xsltproc/python/Table"
324 - exclude-result-prefixes="doc stbl xtbl lxslt ptbl"
325 + xmlns:dtbl="http://docbook.sourceforge.net/dtbl"
326 + exclude-result-prefixes="doc stbl xtbl lxslt ptbl dtbl"
329 <xsl:include href="../common/table.xsl"/>
331 <xsl:when test="$use.extensions != 0
332 and $tablecolumns.extension != 0">
334 + <xsl:when test="function-available('dtbl:convertLength')">
335 + <xsl:value-of select="dtbl:convertLength($table.width)"/>
337 <xsl:when test="function-available('stbl:convertLength')">
338 <xsl:value-of select="stbl:convertLength($table.width)"/>
341 <xsl:when test="$use.extensions != 0
342 and $tablecolumns.extension != 0">
344 + <xsl:when test="function-available('dtbl:adjustColumnWidths')">
345 + <xsl:copy-of select="dtbl:adjustColumnWidths($colgroup)"/>
347 <xsl:when test="function-available('stbl:adjustColumnWidths')">
348 <xsl:copy-of select="stbl:adjustColumnWidths($colgroup)"/>
350 diff -ruNp docbook-xsl-1.74.0.orig/lib/dumpfragment.xsl docbook-xsl-1.74.0/lib/dumpfragment.xsl
351 --- docbook-xsl-1.74.0.orig/lib/dumpfragment.xsl 1970-01-01 01:00:00.000000000 +0100
352 +++ docbook-xsl-1.74.0/lib/dumpfragment.xsl 2008-08-06 13:37:35.000000000 +0200
354 +<?xml version="1.0" encoding="US-ASCII"?>
355 +<xsl:stylesheet version="1.0"
356 + xmlns:exsl="http://exslt.org/common"
357 + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
358 + xmlns="http://www.w3.org/1999/xhtml"
359 + exclude-result-prefixes="exsl">
361 +<xsl:template name="dump-fragment">
362 + <xsl:param name="fragment"/>
363 + <xsl:apply-templates select="exsl:node-set($fragment)/*" mode="dump-fragment"/>
366 +<xsl:template match="@*" mode="dump-fragment">
367 + <xsl:text> </xsl:text>
368 + <xsl:value-of select="local-name(.)"/>
369 + <xsl:text>="</xsl:text>
370 + <xsl:value-of select="."/>
371 + <xsl:text>"</xsl:text>
374 +<xsl:template match="*" mode="dump-fragment">
375 + <xsl:text><</xsl:text><xsl:value-of select="local-name(.)"/>
376 + <xsl:apply-templates select="@*" mode="dump-fragment"/>
377 + <xsl:text>></xsl:text>
378 + <xsl:apply-templates mode="dump-fragment"/>
379 + <xsl:text></</xsl:text><xsl:value-of select="local-name(.)"/>
380 + <xsl:text>></xsl:text>
384 diff -urNp docbook-xsl-1.76.0-orig/html/param.xsl docbook-xsl-1.76.0/html/param.xsl
385 --- docbook-xsl-1.76.0-orig/html/param.xsl 2010-08-31 09:27:22.000000000 +0200
386 +++ docbook-xsl-1.76.0/html/param.xsl 2010-09-06 11:01:07.916914161 +0200
387 @@ -68,6 +68,7 @@ div.annotation-close { position: absolut
388 http://docbook.sourceforge.net/release/images/annot-close.png</xsl:param>
389 <xsl:param name="annotation.graphic.open">http://docbook.sourceforge.net/release/images/annot-open.png</xsl:param>
391 +<xsl:param name="adjustColumnWidths.debug" select="false()"/>
392 <xsl:param name="annotation.js">
393 <xsl:text>http://docbook.sourceforge.net/release/script/AnchorPosition.js http://docbook.sourceforge.net/release/script/PopupWindow.js</xsl:text></xsl:param>