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
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!DOCTYPE xsl:stylesheet [
|
|
3
|
+
]>
|
|
4
|
+
<xsl:stylesheet
|
|
5
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
6
|
+
xmlns:d="http://docbook.org/ns/docbook"
|
|
7
|
+
xmlns:exsl="http://exslt.org/common"
|
|
8
|
+
xmlns="http://www.w3.org/1999/xhtml"
|
|
9
|
+
xmlns:stbl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Table"
|
|
10
|
+
xmlns:xtbl="xalan://com.nwalsh.xalan.Table"
|
|
11
|
+
xmlns:lxslt="http://xml.apache.org/xslt"
|
|
12
|
+
xmlns:ptbl="http://nwalsh.com/xslt/ext/xsltproc/python/Table"
|
|
13
|
+
exclude-result-prefixes="exsl stbl xtbl lxslt ptbl d"
|
|
14
|
+
version="1.0">
|
|
15
|
+
|
|
16
|
+
<!-- $Id: docbook.xsl,v 1.2 2011-09-18 17:47:28 bobs Exp $ -->
|
|
17
|
+
<xsl:import href="xhtml-docbook.xsl"/>
|
|
18
|
+
<xsl:include href="html5-element-mods.xsl"/>
|
|
19
|
+
|
|
20
|
+
<xsl:output method="xml" encoding="UTF-8" />
|
|
21
|
+
|
|
22
|
+
</xsl:stylesheet>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<xsl:stylesheet
|
|
3
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
4
|
+
xmlns:d="http://docbook.org/ns/docbook"
|
|
5
|
+
xmlns:exsl="http://exslt.org/common"
|
|
6
|
+
xmlns="http://www.w3.org/1999/xhtml"
|
|
7
|
+
exclude-result-prefixes="exsl d"
|
|
8
|
+
version="1.0">
|
|
9
|
+
|
|
10
|
+
<!-- $Id: html5-chunk-mods.xsl,v 1.1 2011-09-16 21:44:00 bobs Exp $ -->
|
|
11
|
+
|
|
12
|
+
<!-- call HTML5 header and footer templates for navigation -->
|
|
13
|
+
<xsl:template name="chunk-element-content">
|
|
14
|
+
<xsl:param name="prev"/>
|
|
15
|
+
<xsl:param name="next"/>
|
|
16
|
+
<xsl:param name="nav.context"/>
|
|
17
|
+
<xsl:param name="content">
|
|
18
|
+
<xsl:apply-imports/>
|
|
19
|
+
</xsl:param>
|
|
20
|
+
|
|
21
|
+
<xsl:call-template name="user.preroot"/>
|
|
22
|
+
|
|
23
|
+
<html>
|
|
24
|
+
<xsl:call-template name="root.attributes"/>
|
|
25
|
+
<xsl:call-template name="html.head">
|
|
26
|
+
<xsl:with-param name="prev" select="$prev"/>
|
|
27
|
+
<xsl:with-param name="next" select="$next"/>
|
|
28
|
+
</xsl:call-template>
|
|
29
|
+
|
|
30
|
+
<body>
|
|
31
|
+
<xsl:call-template name="body.attributes"/>
|
|
32
|
+
|
|
33
|
+
<xsl:call-template name="html5.header.navigation">
|
|
34
|
+
<xsl:with-param name="prev" select="$prev"/>
|
|
35
|
+
<xsl:with-param name="next" select="$next"/>
|
|
36
|
+
<xsl:with-param name="nav.context" select="$nav.context"/>
|
|
37
|
+
</xsl:call-template>
|
|
38
|
+
|
|
39
|
+
<xsl:call-template name="user.header.content"/>
|
|
40
|
+
|
|
41
|
+
<xsl:copy-of select="$content"/>
|
|
42
|
+
|
|
43
|
+
<xsl:call-template name="user.footer.content"/>
|
|
44
|
+
|
|
45
|
+
<xsl:call-template name="html5.footer.navigation">
|
|
46
|
+
<xsl:with-param name="prev" select="$prev"/>
|
|
47
|
+
<xsl:with-param name="next" select="$next"/>
|
|
48
|
+
<xsl:with-param name="nav.context" select="$nav.context"/>
|
|
49
|
+
</xsl:call-template>
|
|
50
|
+
|
|
51
|
+
</body>
|
|
52
|
+
</html>
|
|
53
|
+
<xsl:value-of select="$chunk.append"/>
|
|
54
|
+
</xsl:template>
|
|
55
|
+
|
|
56
|
+
<!-- Add HTML5 <header> wrapper, and convert some attributes to styles -->
|
|
57
|
+
<xsl:template name="html5.header.navigation">
|
|
58
|
+
<xsl:param name="prev" select="/d:foo"/>
|
|
59
|
+
<xsl:param name="next" select="/d:foo"/>
|
|
60
|
+
<xsl:param name="nav.context"/>
|
|
61
|
+
|
|
62
|
+
<xsl:variable name="content">
|
|
63
|
+
<header>
|
|
64
|
+
<xsl:call-template name="user.header.navigation">
|
|
65
|
+
<xsl:with-param name="prev" select="$prev"/>
|
|
66
|
+
<xsl:with-param name="next" select="$next"/>
|
|
67
|
+
<xsl:with-param name="nav.context" select="$nav.context"/>
|
|
68
|
+
</xsl:call-template>
|
|
69
|
+
|
|
70
|
+
<xsl:call-template name="header.navigation">
|
|
71
|
+
<xsl:with-param name="prev" select="$prev"/>
|
|
72
|
+
<xsl:with-param name="next" select="$next"/>
|
|
73
|
+
<xsl:with-param name="nav.context" select="$nav.context"/>
|
|
74
|
+
</xsl:call-template>
|
|
75
|
+
</header>
|
|
76
|
+
</xsl:variable>
|
|
77
|
+
|
|
78
|
+
<!-- And fix up any style atts -->
|
|
79
|
+
<xsl:call-template name="convert.styles">
|
|
80
|
+
<xsl:with-param name="content" select="$content"/>
|
|
81
|
+
</xsl:call-template>
|
|
82
|
+
</xsl:template>
|
|
83
|
+
|
|
84
|
+
<!-- Add HTML5 <footer> wrapper, and convert some attributes to styles -->
|
|
85
|
+
<xsl:template name="html5.footer.navigation">
|
|
86
|
+
<xsl:param name="prev" select="/d:foo"/>
|
|
87
|
+
<xsl:param name="next" select="/d:foo"/>
|
|
88
|
+
<xsl:param name="nav.context"/>
|
|
89
|
+
|
|
90
|
+
<xsl:variable name="content">
|
|
91
|
+
<footer>
|
|
92
|
+
<xsl:call-template name="user.footer.navigation">
|
|
93
|
+
<xsl:with-param name="prev" select="$prev"/>
|
|
94
|
+
<xsl:with-param name="next" select="$next"/>
|
|
95
|
+
<xsl:with-param name="nav.context" select="$nav.context"/>
|
|
96
|
+
</xsl:call-template>
|
|
97
|
+
|
|
98
|
+
<xsl:call-template name="footer.navigation">
|
|
99
|
+
<xsl:with-param name="prev" select="$prev"/>
|
|
100
|
+
<xsl:with-param name="next" select="$next"/>
|
|
101
|
+
<xsl:with-param name="nav.context" select="$nav.context"/>
|
|
102
|
+
</xsl:call-template>
|
|
103
|
+
</footer>
|
|
104
|
+
</xsl:variable>
|
|
105
|
+
|
|
106
|
+
<!-- And fix up any style atts -->
|
|
107
|
+
<xsl:call-template name="convert.styles">
|
|
108
|
+
<xsl:with-param name="content" select="$content"/>
|
|
109
|
+
</xsl:call-template>
|
|
110
|
+
</xsl:template>
|
|
111
|
+
|
|
112
|
+
</xsl:stylesheet>
|
|
@@ -0,0 +1,791 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!DOCTYPE xsl:stylesheet [
|
|
3
|
+
<!ENTITY % common.entities SYSTEM "../common/entities.ent">
|
|
4
|
+
%common.entities;
|
|
5
|
+
]>
|
|
6
|
+
<xsl:stylesheet
|
|
7
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
8
|
+
xmlns:d="http://docbook.org/ns/docbook"
|
|
9
|
+
xmlns:exsl="http://exslt.org/common"
|
|
10
|
+
xmlns="http://www.w3.org/1999/xhtml"
|
|
11
|
+
xmlns:stbl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Table"
|
|
12
|
+
xmlns:xtbl="xalan://com.nwalsh.xalan.Table"
|
|
13
|
+
xmlns:lxslt="http://xml.apache.org/xslt"
|
|
14
|
+
xmlns:ptbl="http://nwalsh.com/xslt/ext/xsltproc/python/Table"
|
|
15
|
+
exclude-result-prefixes="exsl stbl xtbl lxslt ptbl d"
|
|
16
|
+
version="1.0">
|
|
17
|
+
|
|
18
|
+
<!-- $Id: html5-element-mods.xsl,v 1.2 2011-09-18 17:47:28 bobs Exp $ -->
|
|
19
|
+
|
|
20
|
+
<!--==============================================================-->
|
|
21
|
+
<!-- DocBook XSL Parameter settings -->
|
|
22
|
+
<!--==============================================================-->
|
|
23
|
+
<!-- Set these to blank so can output special HTML5 empty DOCTYPE -->
|
|
24
|
+
<xsl:param name="chunker.output.doctype-system" select="''"/>
|
|
25
|
+
<xsl:param name="chunker.output.doctype-public" select="''"/>
|
|
26
|
+
|
|
27
|
+
<xsl:param name="table.borders.with.css" select="1"/>
|
|
28
|
+
<xsl:param name="html.ext">.xhtml</xsl:param>
|
|
29
|
+
<xsl:param name="toc.list.type">ul</xsl:param>
|
|
30
|
+
<xsl:param name="css.decoration" select="1"/>
|
|
31
|
+
<xsl:param name="make.clean.html" select="1"/>
|
|
32
|
+
<xsl:param name="generate.id.attributes" select="1"/>
|
|
33
|
+
<xsl:variable name="div.element">section</xsl:variable>
|
|
34
|
+
|
|
35
|
+
<!--==============================================================-->
|
|
36
|
+
<!-- Customized templates -->
|
|
37
|
+
<!--==============================================================-->
|
|
38
|
+
|
|
39
|
+
<!-- HTML5: needs special doctype -->
|
|
40
|
+
<xsl:template name="user.preroot">
|
|
41
|
+
<xsl:text disable-output-escaping="yes"><!DOCTYPE html></xsl:text>
|
|
42
|
+
</xsl:template>
|
|
43
|
+
|
|
44
|
+
<!-- HTML5: Replace HTML acronum with abbr for HTML 5 -->
|
|
45
|
+
<xsl:template match="d:acronym">
|
|
46
|
+
<xsl:call-template name="inline.charseq">
|
|
47
|
+
<xsl:with-param name="wrapper-name">abbr</xsl:with-param>
|
|
48
|
+
</xsl:call-template>
|
|
49
|
+
</xsl:template>
|
|
50
|
+
|
|
51
|
+
<!-- HTML5: replace border="0" with border="" -->
|
|
52
|
+
<!-- HTML5: No @summary allowed -->
|
|
53
|
+
<!-- HTML5: replace many table atts with CSS styles -->
|
|
54
|
+
<xsl:template match="d:tgroup" name="tgroup">
|
|
55
|
+
<xsl:if test="not(@cols) or @cols = '' or string(number(@cols)) = 'NaN'">
|
|
56
|
+
<xsl:message terminate="yes">
|
|
57
|
+
<xsl:text>Error: CALS tables must specify the number of columns.</xsl:text>
|
|
58
|
+
</xsl:message>
|
|
59
|
+
</xsl:if>
|
|
60
|
+
|
|
61
|
+
<xsl:variable name="summary">
|
|
62
|
+
<xsl:call-template name="pi.dbhtml_table-summary"/>
|
|
63
|
+
</xsl:variable>
|
|
64
|
+
|
|
65
|
+
<xsl:variable name="cellspacing">
|
|
66
|
+
<xsl:call-template name="pi.dbhtml_cellspacing"/>
|
|
67
|
+
</xsl:variable>
|
|
68
|
+
|
|
69
|
+
<xsl:variable name="cellpadding">
|
|
70
|
+
<xsl:call-template name="pi.dbhtml_cellpadding"/>
|
|
71
|
+
</xsl:variable>
|
|
72
|
+
|
|
73
|
+
<!-- First generate colgroup with attributes -->
|
|
74
|
+
<xsl:variable name="colgroup.with.attributes">
|
|
75
|
+
<colgroup>
|
|
76
|
+
<xsl:call-template name="generate.colgroup">
|
|
77
|
+
<xsl:with-param name="cols" select="@cols"/>
|
|
78
|
+
</xsl:call-template>
|
|
79
|
+
</colgroup>
|
|
80
|
+
</xsl:variable>
|
|
81
|
+
|
|
82
|
+
<!-- then modify colgroup attributes with extension -->
|
|
83
|
+
<xsl:variable name="colgroup.with.extension">
|
|
84
|
+
<xsl:choose>
|
|
85
|
+
<xsl:when test="$use.extensions != 0
|
|
86
|
+
and $tablecolumns.extension != 0">
|
|
87
|
+
<xsl:choose>
|
|
88
|
+
<xsl:when test="function-available('stbl:adjustColumnWidths')">
|
|
89
|
+
<xsl:copy-of select="stbl:adjustColumnWidths($colgroup.with.attributes)"/>
|
|
90
|
+
</xsl:when>
|
|
91
|
+
<xsl:when test="function-available('xtbl:adjustColumnWidths')">
|
|
92
|
+
<xsl:copy-of select="xtbl:adjustColumnWidths($colgroup.with.attributes)"/>
|
|
93
|
+
</xsl:when>
|
|
94
|
+
<xsl:when test="function-available('ptbl:adjustColumnWidths')">
|
|
95
|
+
<xsl:copy-of select="ptbl:adjustColumnWidths($colgroup.with.attributes)"/>
|
|
96
|
+
</xsl:when>
|
|
97
|
+
<xsl:otherwise>
|
|
98
|
+
<xsl:message terminate="yes">
|
|
99
|
+
<xsl:text>No adjustColumnWidths function available.</xsl:text>
|
|
100
|
+
</xsl:message>
|
|
101
|
+
</xsl:otherwise>
|
|
102
|
+
</xsl:choose>
|
|
103
|
+
</xsl:when>
|
|
104
|
+
<xsl:otherwise>
|
|
105
|
+
<xsl:copy-of select="$colgroup.with.attributes"/>
|
|
106
|
+
</xsl:otherwise>
|
|
107
|
+
</xsl:choose>
|
|
108
|
+
</xsl:variable>
|
|
109
|
+
|
|
110
|
+
<!-- Now convert to @style -->
|
|
111
|
+
<xsl:variable name="colgroup">
|
|
112
|
+
<xsl:call-template name="colgroup.with.style">
|
|
113
|
+
<xsl:with-param name="colgroup" select="$colgroup.with.extension"/>
|
|
114
|
+
</xsl:call-template>
|
|
115
|
+
</xsl:variable>
|
|
116
|
+
|
|
117
|
+
<xsl:variable name="explicit.table.width">
|
|
118
|
+
<xsl:call-template name="pi.dbhtml_table-width">
|
|
119
|
+
<xsl:with-param name="node" select=".."/>
|
|
120
|
+
</xsl:call-template>
|
|
121
|
+
</xsl:variable>
|
|
122
|
+
|
|
123
|
+
<xsl:variable name="table.width.candidate">
|
|
124
|
+
<xsl:choose>
|
|
125
|
+
<xsl:when test="$explicit.table.width != ''">
|
|
126
|
+
<xsl:value-of select="$explicit.table.width"/>
|
|
127
|
+
</xsl:when>
|
|
128
|
+
<xsl:when test="$default.table.width = ''">
|
|
129
|
+
<xsl:text>100%</xsl:text>
|
|
130
|
+
</xsl:when>
|
|
131
|
+
<xsl:otherwise>
|
|
132
|
+
<xsl:value-of select="$default.table.width"/>
|
|
133
|
+
</xsl:otherwise>
|
|
134
|
+
</xsl:choose>
|
|
135
|
+
</xsl:variable>
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
<xsl:variable name="table.width">
|
|
139
|
+
<xsl:if test="$default.table.width != ''
|
|
140
|
+
or $explicit.table.width != ''">
|
|
141
|
+
<xsl:choose>
|
|
142
|
+
<xsl:when test="contains($table.width.candidate, '%')">
|
|
143
|
+
<xsl:value-of select="$table.width.candidate"/>
|
|
144
|
+
</xsl:when>
|
|
145
|
+
<xsl:when test="$use.extensions != 0
|
|
146
|
+
and $tablecolumns.extension != 0">
|
|
147
|
+
<xsl:choose>
|
|
148
|
+
<xsl:when test="function-available('stbl:convertLength')">
|
|
149
|
+
<xsl:value-of select="stbl:convertLength($table.width.candidate)"/>
|
|
150
|
+
</xsl:when>
|
|
151
|
+
<xsl:when test="function-available('xtbl:convertLength')">
|
|
152
|
+
<xsl:value-of select="xtbl:convertLength($table.width.candidate)"/>
|
|
153
|
+
</xsl:when>
|
|
154
|
+
<xsl:otherwise>
|
|
155
|
+
<xsl:message terminate="yes">
|
|
156
|
+
<xsl:text>No convertLength function available.</xsl:text>
|
|
157
|
+
</xsl:message>
|
|
158
|
+
</xsl:otherwise>
|
|
159
|
+
</xsl:choose>
|
|
160
|
+
</xsl:when>
|
|
161
|
+
<xsl:otherwise>
|
|
162
|
+
<xsl:value-of select="$table.width.candidate"/>
|
|
163
|
+
</xsl:otherwise>
|
|
164
|
+
</xsl:choose>
|
|
165
|
+
</xsl:if>
|
|
166
|
+
</xsl:variable>
|
|
167
|
+
|
|
168
|
+
<!-- assemble a table @style -->
|
|
169
|
+
<xsl:variable name="table.style">
|
|
170
|
+
|
|
171
|
+
<xsl:if test="$cellspacing != '' or $html.cellspacing != ''">
|
|
172
|
+
<xsl:text>cellspacing: </xsl:text>
|
|
173
|
+
<xsl:choose>
|
|
174
|
+
<xsl:when test="$cellspacing != ''">
|
|
175
|
+
<xsl:value-of select="$cellspacing"/>
|
|
176
|
+
</xsl:when>
|
|
177
|
+
<xsl:otherwise>
|
|
178
|
+
<xsl:value-of select="$html.cellspacing"/>
|
|
179
|
+
</xsl:otherwise>
|
|
180
|
+
</xsl:choose>
|
|
181
|
+
<xsl:text>; </xsl:text>
|
|
182
|
+
</xsl:if>
|
|
183
|
+
|
|
184
|
+
<xsl:if test="$cellpadding != '' or $html.cellpadding != ''">
|
|
185
|
+
<xsl:text>cellpadding: </xsl:text>
|
|
186
|
+
<xsl:choose>
|
|
187
|
+
<xsl:when test="$cellpadding != ''">
|
|
188
|
+
<xsl:value-of select="$cellpadding"/>
|
|
189
|
+
</xsl:when>
|
|
190
|
+
<xsl:otherwise>
|
|
191
|
+
<xsl:value-of select="$html.cellpadding"/>
|
|
192
|
+
</xsl:otherwise>
|
|
193
|
+
</xsl:choose>
|
|
194
|
+
<xsl:text>; </xsl:text>
|
|
195
|
+
</xsl:if>
|
|
196
|
+
|
|
197
|
+
<xsl:choose>
|
|
198
|
+
<xsl:when test="string-length($table.width) != 0">
|
|
199
|
+
<xsl:text>width: </xsl:text>
|
|
200
|
+
<xsl:value-of select="$table.width"/>
|
|
201
|
+
<xsl:text>; </xsl:text>
|
|
202
|
+
</xsl:when>
|
|
203
|
+
<xsl:when test="../@pgwide=1 or local-name(.) = 'entrytbl'">
|
|
204
|
+
<xsl:text>width: 100%; </xsl:text>
|
|
205
|
+
</xsl:when>
|
|
206
|
+
<xsl:otherwise>
|
|
207
|
+
</xsl:otherwise>
|
|
208
|
+
</xsl:choose>
|
|
209
|
+
|
|
210
|
+
<xsl:choose>
|
|
211
|
+
<xsl:when test="../@frame='all' or (not(../@frame) and $default.table.frame='all')">
|
|
212
|
+
<xsl:text>border-collapse: collapse; </xsl:text>
|
|
213
|
+
<xsl:call-template name="border">
|
|
214
|
+
<xsl:with-param name="side" select="'top'"/>
|
|
215
|
+
<xsl:with-param name="style" select="$table.frame.border.style"/>
|
|
216
|
+
<xsl:with-param name="color" select="$table.frame.border.color"/>
|
|
217
|
+
<xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
|
218
|
+
</xsl:call-template>
|
|
219
|
+
<xsl:call-template name="border">
|
|
220
|
+
<xsl:with-param name="side" select="'bottom'"/>
|
|
221
|
+
<xsl:with-param name="style" select="$table.frame.border.style"/>
|
|
222
|
+
<xsl:with-param name="color" select="$table.frame.border.color"/>
|
|
223
|
+
<xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
|
224
|
+
</xsl:call-template>
|
|
225
|
+
<xsl:call-template name="border">
|
|
226
|
+
<xsl:with-param name="side" select="'left'"/>
|
|
227
|
+
<xsl:with-param name="style" select="$table.frame.border.style"/>
|
|
228
|
+
<xsl:with-param name="color" select="$table.frame.border.color"/>
|
|
229
|
+
<xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
|
230
|
+
</xsl:call-template>
|
|
231
|
+
<xsl:call-template name="border">
|
|
232
|
+
<xsl:with-param name="side" select="'right'"/>
|
|
233
|
+
<xsl:with-param name="style" select="$table.frame.border.style"/>
|
|
234
|
+
<xsl:with-param name="color" select="$table.frame.border.color"/>
|
|
235
|
+
<xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
|
236
|
+
</xsl:call-template>
|
|
237
|
+
</xsl:when>
|
|
238
|
+
<xsl:when test="../@frame='topbot' or (not(../@frame) and $default.table.frame='topbot')">
|
|
239
|
+
<xsl:text>border-collapse: collapse;</xsl:text>
|
|
240
|
+
<xsl:call-template name="border">
|
|
241
|
+
<xsl:with-param name="side" select="'top'"/>
|
|
242
|
+
<xsl:with-param name="style" select="$table.frame.border.style"/>
|
|
243
|
+
<xsl:with-param name="color" select="$table.frame.border.color"/>
|
|
244
|
+
<xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
|
245
|
+
</xsl:call-template>
|
|
246
|
+
<xsl:call-template name="border">
|
|
247
|
+
<xsl:with-param name="side" select="'bottom'"/>
|
|
248
|
+
<xsl:with-param name="style" select="$table.frame.border.style"/>
|
|
249
|
+
<xsl:with-param name="color" select="$table.frame.border.color"/>
|
|
250
|
+
<xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
|
251
|
+
</xsl:call-template>
|
|
252
|
+
</xsl:when>
|
|
253
|
+
<xsl:when test="../@frame='top' or (not(../@frame) and $default.table.frame='top')">
|
|
254
|
+
<xsl:text>border-collapse: collapse;</xsl:text>
|
|
255
|
+
<xsl:call-template name="border">
|
|
256
|
+
<xsl:with-param name="side" select="'top'"/>
|
|
257
|
+
<xsl:with-param name="style" select="$table.frame.border.style"/>
|
|
258
|
+
<xsl:with-param name="color" select="$table.frame.border.color"/>
|
|
259
|
+
<xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
|
260
|
+
</xsl:call-template>
|
|
261
|
+
</xsl:when>
|
|
262
|
+
<xsl:when test="../@frame='bottom' or (not(../@frame) and $default.table.frame='bottom')">
|
|
263
|
+
<xsl:text>border-collapse: collapse;</xsl:text>
|
|
264
|
+
<xsl:call-template name="border">
|
|
265
|
+
<xsl:with-param name="side" select="'bottom'"/>
|
|
266
|
+
<xsl:with-param name="style" select="$table.frame.border.style"/>
|
|
267
|
+
<xsl:with-param name="color" select="$table.frame.border.color"/>
|
|
268
|
+
<xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
|
269
|
+
</xsl:call-template>
|
|
270
|
+
</xsl:when>
|
|
271
|
+
<xsl:when test="../@frame='sides' or (not(../@frame) and $default.table.frame='sides')">
|
|
272
|
+
<xsl:text>border-collapse: collapse;</xsl:text>
|
|
273
|
+
<xsl:call-template name="border">
|
|
274
|
+
<xsl:with-param name="side" select="'left'"/>
|
|
275
|
+
<xsl:with-param name="style" select="$table.frame.border.style"/>
|
|
276
|
+
<xsl:with-param name="color" select="$table.frame.border.color"/>
|
|
277
|
+
<xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
|
278
|
+
</xsl:call-template>
|
|
279
|
+
<xsl:call-template name="border">
|
|
280
|
+
<xsl:with-param name="side" select="'right'"/>
|
|
281
|
+
<xsl:with-param name="style" select="$table.frame.border.style"/>
|
|
282
|
+
<xsl:with-param name="color" select="$table.frame.border.color"/>
|
|
283
|
+
<xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
|
284
|
+
</xsl:call-template>
|
|
285
|
+
</xsl:when>
|
|
286
|
+
<xsl:when test="../@frame='none'">
|
|
287
|
+
<xsl:text>border: none;</xsl:text>
|
|
288
|
+
</xsl:when>
|
|
289
|
+
<xsl:otherwise>
|
|
290
|
+
<xsl:text>border-collapse: collapse;</xsl:text>
|
|
291
|
+
</xsl:otherwise>
|
|
292
|
+
</xsl:choose>
|
|
293
|
+
</xsl:variable>
|
|
294
|
+
|
|
295
|
+
<table>
|
|
296
|
+
<!-- HTML5: no table summary allowed -->
|
|
297
|
+
<xsl:if test="string-length($table.style) != 0">
|
|
298
|
+
<xsl:attribute name="style">
|
|
299
|
+
<xsl:value-of select="$table.style"/>
|
|
300
|
+
</xsl:attribute>
|
|
301
|
+
</xsl:if>
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
<xsl:copy-of select="$colgroup"/>
|
|
305
|
+
|
|
306
|
+
<xsl:apply-templates select="d:thead"/>
|
|
307
|
+
<xsl:apply-templates select="d:tfoot"/>
|
|
308
|
+
<xsl:apply-templates select="d:tbody"/>
|
|
309
|
+
|
|
310
|
+
<xsl:if test=".//d:footnote|../d:title//d:footnote">
|
|
311
|
+
<tbody class="footnotes">
|
|
312
|
+
<tr>
|
|
313
|
+
<td colspan="{@cols}">
|
|
314
|
+
<xsl:apply-templates select=".//d:footnote|../d:title//d:footnote" mode="table.footnote.mode"/>
|
|
315
|
+
</td>
|
|
316
|
+
</tr>
|
|
317
|
+
</tbody>
|
|
318
|
+
</xsl:if>
|
|
319
|
+
</table>
|
|
320
|
+
</xsl:template>
|
|
321
|
+
|
|
322
|
+
<!-- HTML5: convert col attributes to col CSS styles -->
|
|
323
|
+
<xsl:template name="colgroup.with.style">
|
|
324
|
+
<xsl:param name="colgroup"/>
|
|
325
|
+
|
|
326
|
+
<xsl:variable name="colgroup.nodeset" select="exsl:node-set($colgroup)"/>
|
|
327
|
+
<xsl:apply-templates select="$colgroup.nodeset" mode="convert.to.style"/>
|
|
328
|
+
</xsl:template>
|
|
329
|
+
|
|
330
|
+
<xsl:template match="d:colgroup" mode="convert.to.style">
|
|
331
|
+
<xsl:copy>
|
|
332
|
+
<xsl:copy-of select="@*"/>
|
|
333
|
+
<xsl:apply-templates mode="convert.to.style"/>
|
|
334
|
+
</xsl:copy>
|
|
335
|
+
</xsl:template>
|
|
336
|
+
|
|
337
|
+
<!-- HTML5: converts obsolete HTML attributes to CSS styles -->
|
|
338
|
+
<xsl:template match="*" mode="convert.to.style">
|
|
339
|
+
|
|
340
|
+
<xsl:variable name="element" select="local-name(.)"/>
|
|
341
|
+
|
|
342
|
+
<xsl:variable name="style.from.atts">
|
|
343
|
+
<xsl:for-each select="@*">
|
|
344
|
+
|
|
345
|
+
<xsl:choose>
|
|
346
|
+
<!-- width and height attributes are ok for img element -->
|
|
347
|
+
<xsl:when test="local-name() = 'width' and $element != 'img'">
|
|
348
|
+
<xsl:text>width: </xsl:text>
|
|
349
|
+
<xsl:value-of select="."/>
|
|
350
|
+
<xsl:text>; </xsl:text>
|
|
351
|
+
</xsl:when>
|
|
352
|
+
|
|
353
|
+
<xsl:when test="local-name() = 'height' and $element != 'img'">
|
|
354
|
+
<xsl:text>height </xsl:text>
|
|
355
|
+
<xsl:value-of select="."/>
|
|
356
|
+
<xsl:text>; </xsl:text>
|
|
357
|
+
</xsl:when>
|
|
358
|
+
|
|
359
|
+
<xsl:when test="local-name() = 'align'">
|
|
360
|
+
<xsl:text>text-align: </xsl:text>
|
|
361
|
+
<xsl:value-of select="."/>
|
|
362
|
+
<xsl:text>; </xsl:text>
|
|
363
|
+
</xsl:when>
|
|
364
|
+
|
|
365
|
+
<xsl:when test="local-name() = 'valign'">
|
|
366
|
+
<xsl:text>vertical-align: </xsl:text>
|
|
367
|
+
<xsl:value-of select="."/>
|
|
368
|
+
<xsl:text>; </xsl:text>
|
|
369
|
+
</xsl:when>
|
|
370
|
+
|
|
371
|
+
<xsl:when test="local-name() = 'border'">
|
|
372
|
+
<xsl:text>border: </xsl:text>
|
|
373
|
+
<xsl:value-of select="."/>
|
|
374
|
+
<xsl:text>; </xsl:text>
|
|
375
|
+
</xsl:when>
|
|
376
|
+
|
|
377
|
+
<xsl:when test="local-name() = 'cellspacing'">
|
|
378
|
+
<xsl:text>border-spacing: </xsl:text>
|
|
379
|
+
<xsl:value-of select="."/>
|
|
380
|
+
<xsl:text>; </xsl:text>
|
|
381
|
+
</xsl:when>
|
|
382
|
+
|
|
383
|
+
<xsl:when test="local-name() = 'cellpadding'">
|
|
384
|
+
<xsl:text>padding: </xsl:text>
|
|
385
|
+
<xsl:value-of select="."/>
|
|
386
|
+
<xsl:text>; </xsl:text>
|
|
387
|
+
</xsl:when>
|
|
388
|
+
</xsl:choose>
|
|
389
|
+
</xsl:for-each>
|
|
390
|
+
</xsl:variable>
|
|
391
|
+
|
|
392
|
+
<!-- merge existing styles with these new styles -->
|
|
393
|
+
<xsl:variable name="style">
|
|
394
|
+
<xsl:value-of select="concat($style.from.atts, @style)"/>
|
|
395
|
+
</xsl:variable>
|
|
396
|
+
|
|
397
|
+
<!-- HTML5: reserved for element name conversion if needed -->
|
|
398
|
+
<xsl:variable name="element.name">
|
|
399
|
+
<xsl:value-of select="local-name(.)"/>
|
|
400
|
+
</xsl:variable>
|
|
401
|
+
|
|
402
|
+
<xsl:element name="{$element.name}">
|
|
403
|
+
<xsl:if test="string-length($style) != 0">
|
|
404
|
+
<xsl:attribute name="style">
|
|
405
|
+
<xsl:value-of select="$style"/>
|
|
406
|
+
</xsl:attribute>
|
|
407
|
+
</xsl:if>
|
|
408
|
+
<!-- skip converted atts, and also skip disallowed summary attribute -->
|
|
409
|
+
<xsl:for-each select="@*">
|
|
410
|
+
<xsl:choose>
|
|
411
|
+
<xsl:when test="local-name(.) = 'width' and $element != 'img'"/>
|
|
412
|
+
<xsl:when test="local-name(.) = 'height' and $element != 'img'"/>
|
|
413
|
+
<xsl:when test="local-name(.) = 'summary'"/>
|
|
414
|
+
<xsl:when test="local-name(.) = 'border'"/>
|
|
415
|
+
<xsl:when test="local-name(.) = 'cellspacing'"/>
|
|
416
|
+
<xsl:when test="local-name(.) = 'cellpadding'"/>
|
|
417
|
+
<xsl:when test="local-name(.) = 'style'"/>
|
|
418
|
+
<xsl:when test="local-name(.) = 'align'"/>
|
|
419
|
+
<xsl:when test="local-name(.) = 'valign'"/>
|
|
420
|
+
<xsl:otherwise>
|
|
421
|
+
<xsl:copy-of select="."/>
|
|
422
|
+
</xsl:otherwise>
|
|
423
|
+
</xsl:choose>
|
|
424
|
+
</xsl:for-each>
|
|
425
|
+
<xsl:apply-templates mode="convert.to.style"/>
|
|
426
|
+
</xsl:element>
|
|
427
|
+
</xsl:template>
|
|
428
|
+
|
|
429
|
+
<!-- HTML5: convert some attributes to CSS style attribute -->
|
|
430
|
+
<xsl:template match="d:entry|d:entrytbl">
|
|
431
|
+
<xsl:param name="col">
|
|
432
|
+
<xsl:choose>
|
|
433
|
+
<xsl:when test="@revisionflag">
|
|
434
|
+
<xsl:number from="d:row"/>
|
|
435
|
+
</xsl:when>
|
|
436
|
+
<xsl:otherwise>1</xsl:otherwise>
|
|
437
|
+
</xsl:choose>
|
|
438
|
+
</xsl:param>
|
|
439
|
+
|
|
440
|
+
<xsl:param name="spans"/>
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
<!-- Process with stock template -->
|
|
444
|
+
<xsl:variable name="cell">
|
|
445
|
+
<xsl:call-template name="entry">
|
|
446
|
+
<xsl:with-param name="col" select="$col"/>
|
|
447
|
+
<xsl:with-param name="spans" select="$spans"/>
|
|
448
|
+
</xsl:call-template>
|
|
449
|
+
</xsl:variable>
|
|
450
|
+
|
|
451
|
+
<xsl:variable name="cell.nodes" select="exsl:node-set($cell)"/>
|
|
452
|
+
|
|
453
|
+
<xsl:apply-templates select="$cell.nodes" mode="convert.to.style"/>
|
|
454
|
+
|
|
455
|
+
</xsl:template>
|
|
456
|
+
|
|
457
|
+
<xsl:template match="d:mediaobject|d:inlinemediaobject">
|
|
458
|
+
<xsl:call-template name="convert.styles"/>
|
|
459
|
+
</xsl:template>
|
|
460
|
+
|
|
461
|
+
<xsl:template match="d:qandaset">
|
|
462
|
+
<xsl:call-template name="convert.styles"/>
|
|
463
|
+
</xsl:template>
|
|
464
|
+
|
|
465
|
+
<xsl:template match="d:calloutlist|d:revhistory|d:footnote|d:figure|d:co">
|
|
466
|
+
<xsl:call-template name="convert.styles"/>
|
|
467
|
+
</xsl:template>
|
|
468
|
+
|
|
469
|
+
<xsl:template match="d:revhistory" mode="titlepage.mode">
|
|
470
|
+
<xsl:call-template name="convert.styles"/>
|
|
471
|
+
</xsl:template>
|
|
472
|
+
|
|
473
|
+
<xsl:template match="d:variablelist">
|
|
474
|
+
<xsl:call-template name="convert.styles"/>
|
|
475
|
+
</xsl:template>
|
|
476
|
+
|
|
477
|
+
<xsl:template match="d:orderedlist[@inheritnum = 'inherit']">
|
|
478
|
+
<xsl:call-template name="convert.styles"/>
|
|
479
|
+
</xsl:template>
|
|
480
|
+
|
|
481
|
+
<xsl:template match="d:simplelist">
|
|
482
|
+
<xsl:call-template name="convert.styles"/>
|
|
483
|
+
</xsl:template>
|
|
484
|
+
|
|
485
|
+
<xsl:template match="d:blockquote">
|
|
486
|
+
<xsl:call-template name="convert.styles"/>
|
|
487
|
+
</xsl:template>
|
|
488
|
+
|
|
489
|
+
<xsl:template match="d:note|d:important|d:warning|d:caution|d:tip">
|
|
490
|
+
<xsl:call-template name="convert.styles"/>
|
|
491
|
+
</xsl:template>
|
|
492
|
+
|
|
493
|
+
<xsl:template match="d:funcprototype" mode="ansi-tabular">
|
|
494
|
+
<xsl:call-template name="convert.styles"/>
|
|
495
|
+
</xsl:template>
|
|
496
|
+
|
|
497
|
+
<xsl:template match="d:funcprototype" mode="kr-tabular">
|
|
498
|
+
<xsl:call-template name="convert.styles"/>
|
|
499
|
+
</xsl:template>
|
|
500
|
+
|
|
501
|
+
<xsl:template name="convert.styles">
|
|
502
|
+
<xsl:param name="content">
|
|
503
|
+
<xsl:apply-imports/>
|
|
504
|
+
</xsl:param>
|
|
505
|
+
<xsl:variable name="nodes" select="exsl:node-set($content)"/>
|
|
506
|
+
|
|
507
|
+
<xsl:apply-templates mode="convert.to.style" select="$nodes"/>
|
|
508
|
+
</xsl:template>
|
|
509
|
+
|
|
510
|
+
<!-- HTML5: link rel="home" is not permitted -->
|
|
511
|
+
<!-- Add support for attributes on <html> element -->
|
|
512
|
+
<xsl:template match="*" mode="process.root">
|
|
513
|
+
<xsl:variable name="doc" select="self::*"/>
|
|
514
|
+
|
|
515
|
+
<xsl:call-template name="user.preroot"/>
|
|
516
|
+
<xsl:call-template name="root.messages"/>
|
|
517
|
+
|
|
518
|
+
<html>
|
|
519
|
+
<xsl:call-template name="root.attributes"/>
|
|
520
|
+
<head>
|
|
521
|
+
<xsl:call-template name="system.head.content">
|
|
522
|
+
<xsl:with-param name="node" select="$doc"/>
|
|
523
|
+
</xsl:call-template>
|
|
524
|
+
<xsl:call-template name="head.content">
|
|
525
|
+
<xsl:with-param name="node" select="$doc"/>
|
|
526
|
+
</xsl:call-template>
|
|
527
|
+
<xsl:call-template name="user.head.content">
|
|
528
|
+
<xsl:with-param name="node" select="$doc"/>
|
|
529
|
+
</xsl:call-template>
|
|
530
|
+
</head>
|
|
531
|
+
<body>
|
|
532
|
+
<xsl:call-template name="body.attributes"/>
|
|
533
|
+
<xsl:call-template name="user.header.content">
|
|
534
|
+
<xsl:with-param name="node" select="$doc"/>
|
|
535
|
+
</xsl:call-template>
|
|
536
|
+
<xsl:apply-templates select="."/>
|
|
537
|
+
<xsl:call-template name="user.footer.content">
|
|
538
|
+
<xsl:with-param name="node" select="$doc"/>
|
|
539
|
+
</xsl:call-template>
|
|
540
|
+
</body>
|
|
541
|
+
</html>
|
|
542
|
+
<xsl:value-of select="$html.append"/>
|
|
543
|
+
|
|
544
|
+
<!-- Generate any css files only once, not once per chunk -->
|
|
545
|
+
<xsl:call-template name="generate.css.files"/>
|
|
546
|
+
</xsl:template>
|
|
547
|
+
|
|
548
|
+
<xsl:template name="root.attributes">
|
|
549
|
+
</xsl:template>
|
|
550
|
+
|
|
551
|
+
<!-- HTML5: uses <ul> instead of <dl> for TOC -->
|
|
552
|
+
<xsl:template match="d:question" mode="qandatoc.mode">
|
|
553
|
+
<xsl:variable name="firstch">
|
|
554
|
+
<!-- Use a titleabbrev or title if available -->
|
|
555
|
+
<xsl:choose>
|
|
556
|
+
<xsl:when test="../d:blockinfo/d:titleabbrev">
|
|
557
|
+
<xsl:apply-templates select="../d:blockinfo/d:titleabbrev[1]/node()"/>
|
|
558
|
+
</xsl:when>
|
|
559
|
+
<xsl:when test="../d:blockinfo/d:title">
|
|
560
|
+
<xsl:apply-templates select="../d:blockinfo/d:title[1]/node()"/>
|
|
561
|
+
</xsl:when>
|
|
562
|
+
<xsl:when test="../d:info/d:titleabbrev">
|
|
563
|
+
<xsl:apply-templates select="../d:info/d:titleabbrev[1]/node()"/>
|
|
564
|
+
</xsl:when>
|
|
565
|
+
<xsl:when test="../d:titleabbrev">
|
|
566
|
+
<xsl:apply-templates select="../d:titleabbrev[1]/node()"/>
|
|
567
|
+
</xsl:when>
|
|
568
|
+
<xsl:when test="../d:info/d:title">
|
|
569
|
+
<xsl:apply-templates select="../d:info/d:title[1]/node()"/>
|
|
570
|
+
</xsl:when>
|
|
571
|
+
<xsl:when test="../d:title">
|
|
572
|
+
<xsl:apply-templates select="../d:title[1]/node()"/>
|
|
573
|
+
</xsl:when>
|
|
574
|
+
<xsl:otherwise>
|
|
575
|
+
<xsl:apply-templates select="(*[local-name(.)!='label'])[1]/node()"/>
|
|
576
|
+
</xsl:otherwise>
|
|
577
|
+
</xsl:choose>
|
|
578
|
+
</xsl:variable>
|
|
579
|
+
<xsl:variable name="deflabel">
|
|
580
|
+
<xsl:choose>
|
|
581
|
+
<xsl:when test="ancestor-or-self::*[@defaultlabel]">
|
|
582
|
+
<xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]
|
|
583
|
+
/@defaultlabel"/>
|
|
584
|
+
</xsl:when>
|
|
585
|
+
<xsl:otherwise>
|
|
586
|
+
<xsl:value-of select="$qanda.defaultlabel"/>
|
|
587
|
+
</xsl:otherwise>
|
|
588
|
+
</xsl:choose>
|
|
589
|
+
</xsl:variable>
|
|
590
|
+
|
|
591
|
+
<li>
|
|
592
|
+
<a>
|
|
593
|
+
<xsl:attribute name="href">
|
|
594
|
+
<xsl:call-template name="href.target">
|
|
595
|
+
<xsl:with-param name="object" select=".."/>
|
|
596
|
+
</xsl:call-template>
|
|
597
|
+
</xsl:attribute>
|
|
598
|
+
<xsl:apply-templates select="." mode="label.markup"/>
|
|
599
|
+
<xsl:if test="contains($deflabel,'number') and not(d:label)">
|
|
600
|
+
<xsl:apply-templates select="." mode="intralabel.punctuation"/>
|
|
601
|
+
</xsl:if>
|
|
602
|
+
<xsl:text> </xsl:text>
|
|
603
|
+
<xsl:value-of select="$firstch"/>
|
|
604
|
+
</a>
|
|
605
|
+
<!-- * include nested qandaset/qandaentry in TOC if user wants it -->
|
|
606
|
+
|
|
607
|
+
<xsl:if test="not($qanda.nested.in.toc = 0)">
|
|
608
|
+
<xsl:apply-templates select="following-sibling::d:answer" mode="qandatoc.mode"/>
|
|
609
|
+
</xsl:if>
|
|
610
|
+
</li>
|
|
611
|
+
</xsl:template>
|
|
612
|
+
|
|
613
|
+
<xsl:template match="d:answer" mode="qandatoc.mode">
|
|
614
|
+
<xsl:if test="descendant::d:question">
|
|
615
|
+
<xsl:call-template name="process.qanda.toc"/>
|
|
616
|
+
</xsl:if>
|
|
617
|
+
</xsl:template>
|
|
618
|
+
|
|
619
|
+
<!-- html5 uses <ul> instead of <dl> for toc -->
|
|
620
|
+
<xsl:template name="process.qanda.toc">
|
|
621
|
+
<ul>
|
|
622
|
+
<xsl:apply-templates select="d:qandadiv" mode="qandatoc.mode"/>
|
|
623
|
+
<xsl:apply-templates select="d:qandaset|d:qandaentry" mode="qandatoc.mode"/>
|
|
624
|
+
</ul>
|
|
625
|
+
</xsl:template>
|
|
626
|
+
|
|
627
|
+
<xsl:template match="d:qandadiv" mode="qandatoc.mode">
|
|
628
|
+
<!--
|
|
629
|
+
<dt><xsl:apply-templates select="d:title" mode="qandatoc.mode"/></dt>
|
|
630
|
+
<dd><xsl:call-template name="process.qanda.toc"/></dd>
|
|
631
|
+
-->
|
|
632
|
+
<li>
|
|
633
|
+
<xsl:apply-templates select="d:title" mode="qandatoc.mode"/>
|
|
634
|
+
<xsl:call-template name="process.qanda.toc"/>
|
|
635
|
+
</li>
|
|
636
|
+
</xsl:template>
|
|
637
|
+
|
|
638
|
+
<xsl:template match="d:audiodata">
|
|
639
|
+
<xsl:variable name="filename">
|
|
640
|
+
<xsl:call-template name="mediaobject.filename">
|
|
641
|
+
<xsl:with-param name="object" select=".."/>
|
|
642
|
+
</xsl:call-template>
|
|
643
|
+
</xsl:variable>
|
|
644
|
+
|
|
645
|
+
<audio>
|
|
646
|
+
<xsl:call-template name="common.html.attributes"/>
|
|
647
|
+
|
|
648
|
+
<xsl:attribute name="src">
|
|
649
|
+
<xsl:value-of select="$filename"/>
|
|
650
|
+
</xsl:attribute>
|
|
651
|
+
|
|
652
|
+
<xsl:apply-templates select="@*"/>
|
|
653
|
+
<xsl:apply-templates select="../d:multimediaparam"/>
|
|
654
|
+
|
|
655
|
+
<!-- add any fallback content -->
|
|
656
|
+
<xsl:call-template name="audio.fallback"/>
|
|
657
|
+
</audio>
|
|
658
|
+
</xsl:template>
|
|
659
|
+
|
|
660
|
+
<!-- generate <video> element for html5 -->
|
|
661
|
+
<xsl:template match="d:videodata">
|
|
662
|
+
<xsl:variable name="filename">
|
|
663
|
+
<xsl:call-template name="mediaobject.filename">
|
|
664
|
+
<xsl:with-param name="object" select=".."/>
|
|
665
|
+
</xsl:call-template>
|
|
666
|
+
</xsl:variable>
|
|
667
|
+
|
|
668
|
+
<video>
|
|
669
|
+
<xsl:call-template name="common.html.attributes"/>
|
|
670
|
+
|
|
671
|
+
<xsl:attribute name="src">
|
|
672
|
+
<xsl:value-of select="$filename"/>
|
|
673
|
+
</xsl:attribute>
|
|
674
|
+
|
|
675
|
+
<xsl:call-template name="video.poster"/>
|
|
676
|
+
|
|
677
|
+
<xsl:apply-templates select="@*[local-name() != 'fileref']"/>
|
|
678
|
+
<xsl:apply-templates select="../d:multimediaparam"/>
|
|
679
|
+
|
|
680
|
+
<!-- add any fallback content -->
|
|
681
|
+
<xsl:call-template name="video.fallback"/>
|
|
682
|
+
</video>
|
|
683
|
+
</xsl:template>
|
|
684
|
+
|
|
685
|
+
<!-- use only an imageobject with @role = 'poster' -->
|
|
686
|
+
<xsl:template name="video.poster">
|
|
687
|
+
<xsl:variable name="imageobject" select="../../d:imageobject[@role = 'poster'][1]"/>
|
|
688
|
+
<xsl:if test="$imageobject">
|
|
689
|
+
<xsl:attribute name="poster">
|
|
690
|
+
<xsl:value-of select="$imageobject/d:imagedata/@fileref"/>
|
|
691
|
+
</xsl:attribute>
|
|
692
|
+
</xsl:if>
|
|
693
|
+
</xsl:template>
|
|
694
|
+
|
|
695
|
+
<xsl:template match="d:videodata/@fileref">
|
|
696
|
+
<!-- already handled by videodata template -->
|
|
697
|
+
</xsl:template>
|
|
698
|
+
|
|
699
|
+
<xsl:template match="d:audiodata/@fileref">
|
|
700
|
+
<!-- already handled by audiodata template -->
|
|
701
|
+
</xsl:template>
|
|
702
|
+
|
|
703
|
+
<xsl:template match="d:videodata/@contentwidth">
|
|
704
|
+
<xsl:attribute name="width">
|
|
705
|
+
<xsl:value-of select="."/>
|
|
706
|
+
</xsl:attribute>
|
|
707
|
+
</xsl:template>
|
|
708
|
+
|
|
709
|
+
<xsl:template match="d:videodata/@contentdepth">
|
|
710
|
+
<xsl:attribute name="height">
|
|
711
|
+
<xsl:value-of select="."/>
|
|
712
|
+
</xsl:attribute>
|
|
713
|
+
</xsl:template>
|
|
714
|
+
|
|
715
|
+
<xsl:template match="d:videodata/@depth">
|
|
716
|
+
<xsl:attribute name="height">
|
|
717
|
+
<xsl:value-of select="."/>
|
|
718
|
+
</xsl:attribute>
|
|
719
|
+
</xsl:template>
|
|
720
|
+
|
|
721
|
+
<!-- pass through these attributes -->
|
|
722
|
+
<xsl:template match="d:videodata/@autoplay |
|
|
723
|
+
d:videodata/@controls |
|
|
724
|
+
d:audiodata/@autoplay |
|
|
725
|
+
d:audiodata/@controls">
|
|
726
|
+
<xsl:copy-of select="."/>
|
|
727
|
+
</xsl:template>
|
|
728
|
+
|
|
729
|
+
<xsl:template match="d:videodata/@*" priority="-1">
|
|
730
|
+
<!-- Do nothing with the rest of the attributes -->
|
|
731
|
+
</xsl:template>
|
|
732
|
+
|
|
733
|
+
<xsl:template match="d:audiodata/@*" priority="-1">
|
|
734
|
+
<!-- Do nothing with the rest of the attributes -->
|
|
735
|
+
</xsl:template>
|
|
736
|
+
|
|
737
|
+
<xsl:template match="d:multimediaparam">
|
|
738
|
+
<xsl:call-template name="process.multimediaparam">
|
|
739
|
+
<xsl:with-param name="object" select=".."/>
|
|
740
|
+
<xsl:with-param name="param.name" select="@name"/>
|
|
741
|
+
<xsl:with-param name="param.value" select="@value"/>
|
|
742
|
+
</xsl:call-template>
|
|
743
|
+
</xsl:template>
|
|
744
|
+
|
|
745
|
+
<!-- Determines the best value of a media attribute from the
|
|
746
|
+
attributes and multimediaparam elements -->
|
|
747
|
+
<xsl:template name="process.multimediaparam">
|
|
748
|
+
<xsl:param name="object" select="NOTANELEMENT"/>
|
|
749
|
+
<xsl:param name="param.name"/>
|
|
750
|
+
<xsl:param name="param.value"/>
|
|
751
|
+
|
|
752
|
+
<xsl:choose>
|
|
753
|
+
<xsl:when test="$object/*/@*[local-name(.) = $param.name]">
|
|
754
|
+
<!-- explicit attribute with that name takes precedence -->
|
|
755
|
+
<xsl:attribute name="{$param.name}">
|
|
756
|
+
<xsl:value-of select="$object/*/@*[local-name(.) = $param.name]"/>
|
|
757
|
+
</xsl:attribute>
|
|
758
|
+
</xsl:when>
|
|
759
|
+
<xsl:otherwise>
|
|
760
|
+
<xsl:attribute name="{$param.name}">
|
|
761
|
+
<xsl:value-of select="$param.value"/>
|
|
762
|
+
</xsl:attribute>
|
|
763
|
+
</xsl:otherwise>
|
|
764
|
+
</xsl:choose>
|
|
765
|
+
</xsl:template>
|
|
766
|
+
|
|
767
|
+
<xsl:template name="video.fallback">
|
|
768
|
+
<xsl:param name="videodata" select="."/>
|
|
769
|
+
<xsl:variable name="textobject" select="$videodata/../../d:textobject"/>
|
|
770
|
+
|
|
771
|
+
<xsl:apply-templates select="$textobject" mode="fallback"/>
|
|
772
|
+
</xsl:template>
|
|
773
|
+
|
|
774
|
+
<xsl:template name="audio.fallback">
|
|
775
|
+
<xsl:param name="audiodata" select="."/>
|
|
776
|
+
<xsl:variable name="textobject" select="$audiodata/../../d:textobject"/>
|
|
777
|
+
|
|
778
|
+
<xsl:apply-templates select="$textobject" mode="fallback"/>
|
|
779
|
+
</xsl:template>
|
|
780
|
+
|
|
781
|
+
<xsl:template match="d:textobject" mode="fallback">
|
|
782
|
+
<div>
|
|
783
|
+
<xsl:apply-templates select="." mode="class.attribute"/>
|
|
784
|
+
<xsl:apply-templates/>
|
|
785
|
+
</div>
|
|
786
|
+
</xsl:template>
|
|
787
|
+
|
|
788
|
+
<!-- HTML5: no body attributes -->
|
|
789
|
+
<xsl:template name="body.attributes"/>
|
|
790
|
+
|
|
791
|
+
</xsl:stylesheet>
|