docbook_xsl_wrapper 0.1.2 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/CHANGELOG +41 -0
  4. data/README.md +9 -17
  5. data/bin/docbook_xsl_wrapper +9 -14
  6. data/docbook_xsl_wrapper.gemspec +8 -7
  7. data/lib/docbook_xsl_wrapper.rb +24 -1
  8. data/lib/docbook_xsl_wrapper/epub.rb +124 -122
  9. data/lib/docbook_xsl_wrapper/options.rb +1 -1
  10. data/lib/docbook_xsl_wrapper/validate.rb +22 -0
  11. data/lib/docbook_xsl_wrapper/version.rb +1 -1
  12. data/schema/docbookxi.rng +18654 -0
  13. data/spec/docbook_xsl_wrapper/validate_spec.rb +64 -0
  14. data/xsl/AUTHORS +4 -0
  15. data/xsl/COPYING +48 -0
  16. data/xsl/REVISION +1 -0
  17. data/xsl/VERSION.xsl +115 -0
  18. data/xsl/common/addns.xsl +124 -0
  19. data/xsl/common/af.xml +1272 -0
  20. data/xsl/common/am.xml +1272 -0
  21. data/xsl/common/ar.xml +1272 -0
  22. data/xsl/common/as.xml +703 -0
  23. data/xsl/common/ast.xml +703 -0
  24. data/xsl/common/autoidx-kimber.xsl +45 -0
  25. data/xsl/common/autoidx-kosek.xsl +155 -0
  26. data/xsl/common/az.xml +715 -0
  27. data/xsl/common/bg.xml +767 -0
  28. data/xsl/common/bn.xml +1272 -0
  29. data/xsl/common/bn_in.xml +703 -0
  30. data/xsl/common/bs.xml +705 -0
  31. data/xsl/common/ca.xml +703 -0
  32. data/xsl/common/charmap.xsl +222 -0
  33. data/xsl/common/common.xsl +2129 -0
  34. data/xsl/common/cs.xml +743 -0
  35. data/xsl/common/cy.xml +1288 -0
  36. data/xsl/common/da.xml +707 -0
  37. data/xsl/common/de.xml +709 -0
  38. data/xsl/common/el.xml +772 -0
  39. data/xsl/common/en.xml +1272 -0
  40. data/xsl/common/entities.ent +67 -0
  41. data/xsl/common/eo.xml +1272 -0
  42. data/xsl/common/es.xml +719 -0
  43. data/xsl/common/et.xml +1272 -0
  44. data/xsl/common/eu.xml +1272 -0
  45. data/xsl/common/fa.xml +703 -0
  46. data/xsl/common/fi.xml +713 -0
  47. data/xsl/common/fr.xml +733 -0
  48. data/xsl/common/ga.xml +1272 -0
  49. data/xsl/common/gentext.xsl +855 -0
  50. data/xsl/common/gl.xml +1272 -0
  51. data/xsl/common/gu.xml +703 -0
  52. data/xsl/common/he.xml +1272 -0
  53. data/xsl/common/hi.xml +703 -0
  54. data/xsl/common/hr.xml +705 -0
  55. data/xsl/common/hu.xml +721 -0
  56. data/xsl/common/id.xml +1272 -0
  57. data/xsl/common/insertfile.xsl +113 -0
  58. data/xsl/common/is.xml +715 -0
  59. data/xsl/common/it.xml +1272 -0
  60. data/xsl/common/ja.xml +703 -0
  61. data/xsl/common/ka.xml +743 -0
  62. data/xsl/common/kn.xml +1272 -0
  63. data/xsl/common/ko.xml +1272 -0
  64. data/xsl/common/ky.xml +775 -0
  65. data/xsl/common/l10n.dtd +64 -0
  66. data/xsl/common/l10n.xml +78 -0
  67. data/xsl/common/l10n.xsl +598 -0
  68. data/xsl/common/la.xml +1272 -0
  69. data/xsl/common/labels.xsl +933 -0
  70. data/xsl/common/lt.xml +721 -0
  71. data/xsl/common/lv.xml +1272 -0
  72. data/xsl/common/ml.xml +703 -0
  73. data/xsl/common/mn.xml +773 -0
  74. data/xsl/common/mr.xml +703 -0
  75. data/xsl/common/nb.xml +1272 -0
  76. data/xsl/common/nds.xml +709 -0
  77. data/xsl/common/nl.xml +703 -0
  78. data/xsl/common/nn.xml +1272 -0
  79. data/xsl/common/olink.xsl +1284 -0
  80. data/xsl/common/or.xml +1272 -0
  81. data/xsl/common/pa.xml +703 -0
  82. data/xsl/common/pi.xml +168 -0
  83. data/xsl/common/pi.xsl +347 -0
  84. data/xsl/common/pl.xml +721 -0
  85. data/xsl/common/pt.xml +1272 -0
  86. data/xsl/common/pt_br.xml +1272 -0
  87. data/xsl/common/refentry.xsl +1353 -0
  88. data/xsl/common/ro.xml +1272 -0
  89. data/xsl/common/ru.xml +769 -0
  90. data/xsl/common/sk.xml +1272 -0
  91. data/xsl/common/sl.xml +1272 -0
  92. data/xsl/common/sq.xml +1272 -0
  93. data/xsl/common/sr.xml +763 -0
  94. data/xsl/common/sr_Latn.xml +722 -0
  95. data/xsl/common/subtitles.xsl +181 -0
  96. data/xsl/common/sv.xml +707 -0
  97. data/xsl/common/ta.xml +703 -0
  98. data/xsl/common/table.xsl +515 -0
  99. data/xsl/common/targetdatabase.dtd +49 -0
  100. data/xsl/common/targets.xsl +338 -0
  101. data/xsl/common/te.xml +703 -0
  102. data/xsl/common/th.xml +1272 -0
  103. data/xsl/common/titles.xsl +850 -0
  104. data/xsl/common/tl.xml +1272 -0
  105. data/xsl/common/tr.xml +709 -0
  106. data/xsl/common/uk.xml +769 -0
  107. data/xsl/common/ur.xml +705 -0
  108. data/xsl/common/utility.xsl +291 -0
  109. data/xsl/common/vi.xml +1272 -0
  110. data/xsl/common/xh.xml +1272 -0
  111. data/xsl/common/zh.xml +703 -0
  112. data/xsl/common/zh_cn.xml +703 -0
  113. data/xsl/common/zh_tw.xml +703 -0
  114. data/xsl/epub/docbook.xsl +1769 -0
  115. data/xsl/epub3/chunk.xsl +30 -0
  116. data/xsl/epub3/docbook-epub.css.xml +142 -0
  117. data/xsl/epub3/docbook.xsl +20 -0
  118. data/xsl/epub3/epub3-chunk-mods.xsl +52 -0
  119. data/xsl/epub3/epub3-element-mods.xsl +2533 -0
  120. data/xsl/epub3/titlepage.templates.xml +712 -0
  121. data/xsl/epub3/titlepage.templates.xsl +3842 -0
  122. data/xsl/lib/lib.xsl +533 -0
  123. data/xsl/xhtml/admon.xsl +142 -0
  124. data/xsl/xhtml/annotations.xsl +160 -0
  125. data/xsl/xhtml/autoidx.xsl +831 -0
  126. data/xsl/xhtml/autotoc.xsl +706 -0
  127. data/xsl/xhtml/biblio-iso690.xsl +1302 -0
  128. data/xsl/xhtml/biblio.xsl +1371 -0
  129. data/xsl/xhtml/block.xsl +584 -0
  130. data/xsl/xhtml/callout.xsl +210 -0
  131. data/xsl/xhtml/chunk-code.xsl +675 -0
  132. data/xsl/xhtml/chunk-common.xsl +1627 -0
  133. data/xsl/xhtml/chunker.xsl +317 -0
  134. data/xsl/xhtml/component.xsl +440 -0
  135. data/xsl/xhtml/division.xsl +214 -0
  136. data/xsl/xhtml/ebnf.xsl +331 -0
  137. data/xsl/xhtml/footnote.xsl +346 -0
  138. data/xsl/xhtml/formal.xsl +496 -0
  139. data/xsl/xhtml/glossary.xsl +602 -0
  140. data/xsl/xhtml/graphics.xsl +1537 -0
  141. data/xsl/xhtml/html-rtf.xsl +321 -0
  142. data/xsl/xhtml/html.xsl +690 -0
  143. data/xsl/xhtml/htmltbl.xsl +102 -0
  144. data/xsl/xhtml/index.xsl +264 -0
  145. data/xsl/xhtml/info.xsl +48 -0
  146. data/xsl/xhtml/inline.xsl +1508 -0
  147. data/xsl/xhtml/its.xsl +109 -0
  148. data/xsl/xhtml/keywords.xsl +38 -0
  149. data/xsl/xhtml/lists.xsl +1227 -0
  150. data/xsl/xhtml/math.xsl +286 -0
  151. data/xsl/xhtml/param.xsl +449 -0
  152. data/xsl/xhtml/pi.xsl +1237 -0
  153. data/xsl/xhtml/qandaset.xsl +440 -0
  154. data/xsl/xhtml/refentry.xsl +307 -0
  155. data/xsl/xhtml/sections.xsl +564 -0
  156. data/xsl/xhtml/synop.xsl +1623 -0
  157. data/xsl/xhtml/table.xsl +1179 -0
  158. data/xsl/xhtml/task.xsl +76 -0
  159. data/xsl/xhtml/titlepage.templates.xsl +4005 -0
  160. data/xsl/xhtml/titlepage.xsl +1108 -0
  161. data/xsl/xhtml/toc.xsl +334 -0
  162. data/xsl/xhtml/verbatim.xsl +389 -0
  163. data/xsl/xhtml/xref.xsl +1268 -0
  164. data/xsl/xhtml5/docbook.xsl +22 -0
  165. data/xsl/xhtml5/html5-chunk-mods.xsl +112 -0
  166. data/xsl/xhtml5/html5-element-mods.xsl +791 -0
  167. data/xsl/xhtml5/xhtml-docbook.xsl +531 -0
  168. metadata +207 -27
  169. data/.rvmrc +0 -48
  170. data/xslt/obfuscate.xsl +0 -12
@@ -0,0 +1,210 @@
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="http://www.w3.org/1999/xhtml" exclude-result-prefixes="sverb xverb lxslt d" version="1.0">
6
+
7
+ <!-- ********************************************************************
8
+ $Id: callout.xsl 9305 2012-04-27 21:50:53Z bobstayton $
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
+ <lxslt:component prefix="xverb" functions="insertCallouts"/>
18
+
19
+ <xsl:template match="d:programlistingco|d:screenco">
20
+ <xsl:variable name="verbatim" select="d:programlisting|d:screen"/>
21
+
22
+ <xsl:choose>
23
+ <xsl:when test="$use.extensions != '0' and $callouts.extension != '0'">
24
+ <xsl:variable name="rtf">
25
+ <xsl:apply-templates select="$verbatim">
26
+ <xsl:with-param name="suppress-numbers" select="'1'"/>
27
+ </xsl:apply-templates>
28
+ </xsl:variable>
29
+
30
+ <xsl:variable name="rtf-with-callouts">
31
+ <xsl:choose>
32
+ <xsl:when test="function-available('sverb:insertCallouts')">
33
+ <xsl:copy-of select="sverb:insertCallouts(d:areaspec,$rtf)"/>
34
+ </xsl:when>
35
+ <xsl:when test="function-available('xverb:insertCallouts')">
36
+ <xsl:copy-of select="xverb:insertCallouts(d:areaspec,$rtf)"/>
37
+ </xsl:when>
38
+ <xsl:otherwise>
39
+ <xsl:message terminate="yes">
40
+ <xsl:text>No insertCallouts function is available.</xsl:text>
41
+ </xsl:message>
42
+ </xsl:otherwise>
43
+ </xsl:choose>
44
+ </xsl:variable>
45
+
46
+ <xsl:choose>
47
+ <xsl:when test="$verbatim/@linenumbering = 'numbered' and $linenumbering.extension != '0'">
48
+ <div>
49
+ <xsl:call-template name="common.html.attributes"/>
50
+ <xsl:call-template name="id.attribute"/>
51
+ <xsl:call-template name="number.rtf.lines">
52
+ <xsl:with-param name="rtf" select="$rtf-with-callouts"/>
53
+ <xsl:with-param name="pi.context" select="d:programlisting|d:screen"/>
54
+ </xsl:call-template>
55
+ <xsl:apply-templates select="d:calloutlist"/>
56
+ </div>
57
+ </xsl:when>
58
+ <xsl:otherwise>
59
+ <div>
60
+ <xsl:call-template name="common.html.attributes"/>
61
+ <xsl:call-template name="id.attribute"/>
62
+ <xsl:copy-of select="$rtf-with-callouts"/>
63
+ <xsl:apply-templates select="d:calloutlist"/>
64
+ </div>
65
+ </xsl:otherwise>
66
+ </xsl:choose>
67
+ </xsl:when>
68
+ <xsl:otherwise>
69
+ <div>
70
+ <xsl:apply-templates select="." mode="common.html.attributes"/>
71
+ <xsl:call-template name="id.attribute"/>
72
+ <xsl:apply-templates/>
73
+ </div>
74
+ </xsl:otherwise>
75
+ </xsl:choose>
76
+ </xsl:template>
77
+
78
+ <xsl:template match="d:areaspec|d:areaset|d:area">
79
+ </xsl:template>
80
+
81
+ <xsl:template match="d:areaset" mode="conumber">
82
+ <xsl:number count="d:area|d:areaset" format="1"/>
83
+ </xsl:template>
84
+
85
+ <xsl:template match="d:area" mode="conumber">
86
+ <xsl:number count="d:area|d:areaset" format="1"/>
87
+ </xsl:template>
88
+
89
+ <xsl:template match="d:co" name="co">
90
+ <!-- Support a single linkend in HTML -->
91
+ <xsl:variable name="targets" select="key('id', @linkends)"/>
92
+ <xsl:variable name="target" select="$targets[1]"/>
93
+ <xsl:choose>
94
+ <xsl:when test="$target">
95
+ <a>
96
+ <xsl:apply-templates select="." mode="common.html.attributes"/>
97
+ <xsl:choose>
98
+ <xsl:when test="$generate.id.attributes = 0">
99
+ <!-- force an id attribute here -->
100
+ <xsl:if test="@id or @xml:id">
101
+ <xsl:attribute name="id">
102
+ <xsl:value-of select="(@id|@xml:id)[1]"/>
103
+ </xsl:attribute>
104
+ </xsl:if>
105
+ </xsl:when>
106
+ <xsl:otherwise>
107
+ <xsl:call-template name="id.attribute"/>
108
+ </xsl:otherwise>
109
+ </xsl:choose>
110
+ <xsl:attribute name="href">
111
+ <xsl:call-template name="href.target">
112
+ <xsl:with-param name="object" select="$target"/>
113
+ </xsl:call-template>
114
+ </xsl:attribute>
115
+ <xsl:apply-templates select="." mode="callout-bug"/>
116
+ </a>
117
+ </xsl:when>
118
+ <xsl:otherwise>
119
+ <xsl:if test="$generate.id.attributes != 0">
120
+ <xsl:if test="@id or @xml:id">
121
+ <span>
122
+ <xsl:attribute name="id">
123
+ <xsl:value-of select="(@id|@xml:id)[1]"/>
124
+ </xsl:attribute>
125
+ </span>
126
+ </xsl:if>
127
+ </xsl:if>
128
+ <xsl:call-template name="anchor"/>
129
+ <xsl:apply-templates select="." mode="callout-bug"/>
130
+ </xsl:otherwise>
131
+ </xsl:choose>
132
+ </xsl:template>
133
+
134
+ <xsl:template match="d:coref">
135
+ <!-- tricky; this relies on the fact that we can process the "co" that's -->
136
+ <!-- "over there" as if it were "right here" -->
137
+
138
+ <xsl:variable name="co" select="key('id', @linkend)"/>
139
+ <xsl:choose>
140
+ <xsl:when test="not($co)">
141
+ <xsl:message>
142
+ <xsl:text>Error: coref link is broken: </xsl:text>
143
+ <xsl:value-of select="@linkend"/>
144
+ </xsl:message>
145
+ </xsl:when>
146
+ <xsl:when test="local-name($co) != 'co'">
147
+ <xsl:message>
148
+ <xsl:text>Error: coref doesn't point to a co: </xsl:text>
149
+ <xsl:value-of select="@linkend"/>
150
+ </xsl:message>
151
+ </xsl:when>
152
+ <xsl:otherwise>
153
+ <xsl:apply-templates select="$co"/>
154
+ </xsl:otherwise>
155
+ </xsl:choose>
156
+ </xsl:template>
157
+
158
+ <xsl:template match="d:co" mode="callout-bug">
159
+ <xsl:call-template name="callout-bug">
160
+ <xsl:with-param name="conum">
161
+ <xsl:number count="d:co" level="any" from="d:programlisting|d:screen|d:literallayout|d:synopsis" format="1"/>
162
+ </xsl:with-param>
163
+ </xsl:call-template>
164
+ </xsl:template>
165
+
166
+ <xsl:template name="callout-bug">
167
+ <xsl:param name="conum" select="1"/>
168
+
169
+ <xsl:choose>
170
+ <xsl:when test="$callout.graphics != 0 and $conum &lt;= $callout.graphics.number.limit">
171
+ <!-- Added span to make valid in XHTML 1 -->
172
+ <span><img src="{$callout.graphics.path}{$conum}{$callout.graphics.extension}" alt="{$conum}" border="0"/></span>
173
+ </xsl:when>
174
+ <xsl:when test="$callout.unicode != 0 and $conum &lt;= $callout.unicode.number.limit">
175
+ <xsl:choose>
176
+ <xsl:when test="$callout.unicode.start.character = 10102">
177
+ <xsl:choose>
178
+ <xsl:when test="$conum = 1">&#10102;</xsl:when>
179
+ <xsl:when test="$conum = 2">&#10103;</xsl:when>
180
+ <xsl:when test="$conum = 3">&#10104;</xsl:when>
181
+ <xsl:when test="$conum = 4">&#10105;</xsl:when>
182
+ <xsl:when test="$conum = 5">&#10106;</xsl:when>
183
+ <xsl:when test="$conum = 6">&#10107;</xsl:when>
184
+ <xsl:when test="$conum = 7">&#10108;</xsl:when>
185
+ <xsl:when test="$conum = 8">&#10109;</xsl:when>
186
+ <xsl:when test="$conum = 9">&#10110;</xsl:when>
187
+ <xsl:when test="$conum = 10">&#10111;</xsl:when>
188
+ </xsl:choose>
189
+ </xsl:when>
190
+ <xsl:otherwise>
191
+ <xsl:message>
192
+ <xsl:text>Don't know how to generate Unicode callouts </xsl:text>
193
+ <xsl:text>when $callout.unicode.start.character is </xsl:text>
194
+ <xsl:value-of select="$callout.unicode.start.character"/>
195
+ </xsl:message>
196
+ <xsl:text>(</xsl:text>
197
+ <xsl:value-of select="$conum"/>
198
+ <xsl:text>)</xsl:text>
199
+ </xsl:otherwise>
200
+ </xsl:choose>
201
+ </xsl:when>
202
+ <xsl:otherwise>
203
+ <xsl:text>(</xsl:text>
204
+ <xsl:value-of select="$conum"/>
205
+ <xsl:text>)</xsl:text>
206
+ </xsl:otherwise>
207
+ </xsl:choose>
208
+ </xsl:template>
209
+
210
+ </xsl:stylesheet>
@@ -0,0 +1,675 @@
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:exsl="http://exslt.org/common" xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="exsl cf d" version="1.0">
6
+
7
+ <!-- ********************************************************************
8
+ $Id: chunk-code.xsl 9866 2014-01-29 02:55:52Z bobstayton $
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
+ <!-- ==================================================================== -->
18
+
19
+
20
+ <xsl:template match="*" mode="chunk-filename">
21
+ <!-- returns the filename of a chunk -->
22
+ <xsl:variable name="ischunk">
23
+ <xsl:call-template name="chunk"/>
24
+ </xsl:variable>
25
+
26
+ <xsl:variable name="fn">
27
+ <xsl:apply-templates select="." mode="recursive-chunk-filename"/>
28
+ </xsl:variable>
29
+
30
+ <!--
31
+ <xsl:message>
32
+ <xsl:value-of select="$ischunk"/>
33
+ <xsl:text> (</xsl:text>
34
+ <xsl:value-of select="local-name(.)"/>
35
+ <xsl:text>) </xsl:text>
36
+ <xsl:value-of select="$fn"/>
37
+ <xsl:text>, </xsl:text>
38
+ <xsl:call-template name="dbhtml-dir"/>
39
+ </xsl:message>
40
+ -->
41
+
42
+ <!-- 2003-11-25 by ndw:
43
+ The following test used to read test="$ischunk != 0 and $fn != ''"
44
+ I've removed the ischunk part of the test so that href.to.uri and
45
+ href.from.uri will be fully qualified even if the source or target
46
+ isn't a chunk. I *think* that if $fn != '' then it's appropriate
47
+ to put the directory on the front, even if the element isn't a
48
+ chunk. I could be wrong. -->
49
+
50
+ <xsl:if test="$fn != ''">
51
+ <xsl:call-template name="dbhtml-dir"/>
52
+ </xsl:if>
53
+
54
+ <xsl:value-of select="$chunked.filename.prefix"/>
55
+
56
+ <xsl:value-of select="$fn"/>
57
+ <!-- You can't add the html.ext here because dbhtml filename= may already -->
58
+ <!-- have added it. It really does have to be handled in the recursive template -->
59
+ </xsl:template>
60
+
61
+ <xsl:template match="*" mode="recursive-chunk-filename">
62
+ <xsl:param name="recursive" select="false()"/>
63
+
64
+ <!-- returns the filename of a chunk -->
65
+ <xsl:variable name="ischunk">
66
+ <xsl:call-template name="chunk"/>
67
+ </xsl:variable>
68
+
69
+ <xsl:variable name="dbhtml-filename">
70
+ <xsl:call-template name="pi.dbhtml_filename"/>
71
+ </xsl:variable>
72
+
73
+ <xsl:variable name="filename">
74
+ <xsl:choose>
75
+ <xsl:when test="$dbhtml-filename != ''">
76
+ <xsl:value-of select="$dbhtml-filename"/>
77
+ </xsl:when>
78
+ <!-- if this is the root element, use the root.filename -->
79
+ <xsl:when test="not(parent::*) and $root.filename != ''">
80
+ <xsl:value-of select="$root.filename"/>
81
+ <xsl:value-of select="$html.ext"/>
82
+ </xsl:when>
83
+ <!-- Special case -->
84
+ <xsl:when test="self::d:legalnotice and not($generate.legalnotice.link = 0)">
85
+ <xsl:choose>
86
+ <xsl:when test="(@id or @xml:id) and not($use.id.as.filename = 0)">
87
+ <!-- * if this legalnotice has an ID, then go ahead and use -->
88
+ <!-- * just the value of that ID as the basename for the file -->
89
+ <!-- * (that is, without prepending an "ln-" too it) -->
90
+ <xsl:value-of select="(@id|@xml:id)[1]"/>
91
+ <xsl:value-of select="$html.ext"/>
92
+ </xsl:when>
93
+ <xsl:otherwise>
94
+ <!-- * otherwise, if this legalnotice does not have an ID, -->
95
+ <!-- * then we generate an ID... -->
96
+ <xsl:variable name="id">
97
+ <xsl:call-template name="object.id"/>
98
+ </xsl:variable>
99
+ <!-- * ...and then we take that generated ID, prepend an -->
100
+ <!-- * "ln-" to it, and use that as the basename for the file -->
101
+ <xsl:value-of select="concat('ln-',$id,$html.ext)"/>
102
+ </xsl:otherwise>
103
+ </xsl:choose>
104
+ </xsl:when>
105
+ <!-- if there's no dbhtml filename, and if we're to use IDs as -->
106
+ <!-- filenames, then use the ID to generate the filename. -->
107
+ <xsl:when test="(@id or @xml:id) and $use.id.as.filename != 0">
108
+ <xsl:value-of select="(@id|@xml:id)[1]"/>
109
+ <xsl:value-of select="$html.ext"/>
110
+ </xsl:when>
111
+ <xsl:otherwise/>
112
+ </xsl:choose>
113
+ </xsl:variable>
114
+
115
+ <xsl:choose>
116
+ <xsl:when test="$ischunk='0'">
117
+ <!-- if called on something that isn't a chunk, walk up... -->
118
+ <xsl:choose>
119
+ <xsl:when test="count(parent::*)&gt;0">
120
+ <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
121
+ <xsl:with-param name="recursive" select="$recursive"/>
122
+ </xsl:apply-templates>
123
+ </xsl:when>
124
+ <!-- unless there is no up, in which case return "" -->
125
+ <xsl:otherwise/>
126
+ </xsl:choose>
127
+ </xsl:when>
128
+
129
+ <xsl:when test="not($recursive) and $filename != ''">
130
+ <!-- if this chunk has an explicit name, use it -->
131
+ <xsl:value-of select="$filename"/>
132
+ </xsl:when>
133
+
134
+ <xsl:when test="self::d:set">
135
+ <xsl:value-of select="$root.filename"/>
136
+ <xsl:if test="not($recursive)">
137
+ <xsl:value-of select="$html.ext"/>
138
+ </xsl:if>
139
+ </xsl:when>
140
+
141
+ <xsl:when test="self::d:book">
142
+ <xsl:text>bk</xsl:text>
143
+ <xsl:number level="any" format="01"/>
144
+ <xsl:if test="not($recursive)">
145
+ <xsl:value-of select="$html.ext"/>
146
+ </xsl:if>
147
+ </xsl:when>
148
+
149
+ <xsl:when test="self::d:article">
150
+ <xsl:if test="/d:set">
151
+ <!-- in a set, make sure we inherit the right book info... -->
152
+ <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
153
+ <xsl:with-param name="recursive" select="true()"/>
154
+ </xsl:apply-templates>
155
+ </xsl:if>
156
+
157
+ <xsl:text>ar</xsl:text>
158
+ <xsl:number level="any" format="01" from="d:book"/>
159
+ <xsl:if test="not($recursive)">
160
+ <xsl:value-of select="$html.ext"/>
161
+ </xsl:if>
162
+ </xsl:when>
163
+
164
+ <xsl:when test="self::d:preface">
165
+ <xsl:if test="/d:set">
166
+ <!-- in a set, make sure we inherit the right book info... -->
167
+ <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
168
+ <xsl:with-param name="recursive" select="true()"/>
169
+ </xsl:apply-templates>
170
+ </xsl:if>
171
+
172
+ <xsl:text>pr</xsl:text>
173
+ <xsl:number level="any" format="01" from="d:book"/>
174
+ <xsl:if test="not($recursive)">
175
+ <xsl:value-of select="$html.ext"/>
176
+ </xsl:if>
177
+ </xsl:when>
178
+
179
+ <xsl:when test="self::d:chapter">
180
+ <xsl:if test="/d:set">
181
+ <!-- in a set, make sure we inherit the right book info... -->
182
+ <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
183
+ <xsl:with-param name="recursive" select="true()"/>
184
+ </xsl:apply-templates>
185
+ </xsl:if>
186
+
187
+ <xsl:text>ch</xsl:text>
188
+ <xsl:number level="any" format="01" from="d:book"/>
189
+ <xsl:if test="not($recursive)">
190
+ <xsl:value-of select="$html.ext"/>
191
+ </xsl:if>
192
+ </xsl:when>
193
+
194
+ <xsl:when test="self::d:appendix">
195
+ <xsl:if test="/d:set">
196
+ <!-- in a set, make sure we inherit the right book info... -->
197
+ <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
198
+ <xsl:with-param name="recursive" select="true()"/>
199
+ </xsl:apply-templates>
200
+ </xsl:if>
201
+
202
+ <xsl:text>ap</xsl:text>
203
+ <xsl:number level="any" format="a" from="d:book"/>
204
+ <xsl:if test="not($recursive)">
205
+ <xsl:value-of select="$html.ext"/>
206
+ </xsl:if>
207
+ </xsl:when>
208
+
209
+ <xsl:when test="self::d:part">
210
+ <xsl:choose>
211
+ <xsl:when test="/d:set">
212
+ <!-- in a set, make sure we inherit the right book info... -->
213
+ <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
214
+ <xsl:with-param name="recursive" select="true()"/>
215
+ </xsl:apply-templates>
216
+ </xsl:when>
217
+ <xsl:otherwise>
218
+ </xsl:otherwise>
219
+ </xsl:choose>
220
+
221
+ <xsl:text>pt</xsl:text>
222
+ <xsl:number level="any" format="01" from="d:book"/>
223
+ <xsl:if test="not($recursive)">
224
+ <xsl:value-of select="$html.ext"/>
225
+ </xsl:if>
226
+ </xsl:when>
227
+
228
+ <xsl:when test="self::d:reference">
229
+ <xsl:choose>
230
+ <xsl:when test="/d:set">
231
+ <!-- in a set, make sure we inherit the right book info... -->
232
+ <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
233
+ <xsl:with-param name="recursive" select="true()"/>
234
+ </xsl:apply-templates>
235
+ </xsl:when>
236
+ <xsl:otherwise>
237
+ </xsl:otherwise>
238
+ </xsl:choose>
239
+
240
+ <xsl:text>rn</xsl:text>
241
+ <xsl:number level="any" format="01" from="d:book"/>
242
+ <xsl:if test="not($recursive)">
243
+ <xsl:value-of select="$html.ext"/>
244
+ </xsl:if>
245
+ </xsl:when>
246
+
247
+ <xsl:when test="self::d:refentry">
248
+ <xsl:choose>
249
+ <xsl:when test="parent::d:reference">
250
+ <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
251
+ <xsl:with-param name="recursive" select="true()"/>
252
+ </xsl:apply-templates>
253
+ </xsl:when>
254
+ <xsl:otherwise>
255
+ <xsl:if test="/d:set">
256
+ <!-- in a set, make sure we inherit the right book info... -->
257
+ <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
258
+ <xsl:with-param name="recursive" select="true()"/>
259
+ </xsl:apply-templates>
260
+ </xsl:if>
261
+ </xsl:otherwise>
262
+ </xsl:choose>
263
+
264
+ <xsl:text>re</xsl:text>
265
+ <xsl:number level="any" format="01" from="d:book"/>
266
+ <xsl:if test="not($recursive)">
267
+ <xsl:value-of select="$html.ext"/>
268
+ </xsl:if>
269
+ </xsl:when>
270
+
271
+ <xsl:when test="self::d:colophon">
272
+ <xsl:choose>
273
+ <xsl:when test="/d:set">
274
+ <!-- in a set, make sure we inherit the right book info... -->
275
+ <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
276
+ <xsl:with-param name="recursive" select="true()"/>
277
+ </xsl:apply-templates>
278
+ </xsl:when>
279
+ <xsl:otherwise>
280
+ </xsl:otherwise>
281
+ </xsl:choose>
282
+
283
+ <xsl:text>co</xsl:text>
284
+ <xsl:number level="any" format="01" from="d:book"/>
285
+ <xsl:if test="not($recursive)">
286
+ <xsl:value-of select="$html.ext"/>
287
+ </xsl:if>
288
+ </xsl:when>
289
+
290
+ <xsl:when test="self::d:sect1 or self::d:sect2 or self::d:sect3 or self::d:sect4 or self::d:sect5 or self::d:section">
291
+ <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
292
+ <xsl:with-param name="recursive" select="true()"/>
293
+ </xsl:apply-templates>
294
+ <xsl:text>s</xsl:text>
295
+ <xsl:number format="01"/>
296
+ <xsl:if test="not($recursive)">
297
+ <xsl:value-of select="$html.ext"/>
298
+ </xsl:if>
299
+ </xsl:when>
300
+
301
+ <xsl:when test="self::d:bibliography">
302
+ <xsl:choose>
303
+ <xsl:when test="/d:set">
304
+ <!-- in a set, make sure we inherit the right book info... -->
305
+ <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
306
+ <xsl:with-param name="recursive" select="true()"/>
307
+ </xsl:apply-templates>
308
+ </xsl:when>
309
+ <xsl:otherwise>
310
+ </xsl:otherwise>
311
+ </xsl:choose>
312
+
313
+ <xsl:text>bi</xsl:text>
314
+ <xsl:number level="any" format="01" from="d:book"/>
315
+ <xsl:if test="not($recursive)">
316
+ <xsl:value-of select="$html.ext"/>
317
+ </xsl:if>
318
+ </xsl:when>
319
+
320
+ <xsl:when test="self::d:glossary">
321
+ <xsl:choose>
322
+ <xsl:when test="/d:set">
323
+ <!-- in a set, make sure we inherit the right book info... -->
324
+ <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
325
+ <xsl:with-param name="recursive" select="true()"/>
326
+ </xsl:apply-templates>
327
+ </xsl:when>
328
+ <xsl:otherwise>
329
+ </xsl:otherwise>
330
+ </xsl:choose>
331
+
332
+ <xsl:text>go</xsl:text>
333
+ <xsl:number level="any" format="01" from="d:book"/>
334
+ <xsl:if test="not($recursive)">
335
+ <xsl:value-of select="$html.ext"/>
336
+ </xsl:if>
337
+ </xsl:when>
338
+
339
+ <xsl:when test="self::d:index">
340
+ <xsl:choose>
341
+ <xsl:when test="/d:set">
342
+ <!-- in a set, make sure we inherit the right book info... -->
343
+ <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
344
+ <xsl:with-param name="recursive" select="true()"/>
345
+ </xsl:apply-templates>
346
+ </xsl:when>
347
+ <xsl:otherwise>
348
+ </xsl:otherwise>
349
+ </xsl:choose>
350
+
351
+ <xsl:text>ix</xsl:text>
352
+ <xsl:number level="any" format="01" from="d:book"/>
353
+ <xsl:if test="not($recursive)">
354
+ <xsl:value-of select="$html.ext"/>
355
+ </xsl:if>
356
+ </xsl:when>
357
+
358
+ <xsl:when test="self::d:setindex">
359
+ <xsl:text>si</xsl:text>
360
+ <xsl:number level="any" format="01" from="d:set"/>
361
+ <xsl:if test="not($recursive)">
362
+ <xsl:value-of select="$html.ext"/>
363
+ </xsl:if>
364
+ </xsl:when>
365
+
366
+ <xsl:when test="self::d:topic">
367
+ <xsl:choose>
368
+ <xsl:when test="/d:set">
369
+ <!-- in a set, make sure we inherit the right book info... -->
370
+ <xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
371
+ <xsl:with-param name="recursive" select="true()"/>
372
+ </xsl:apply-templates>
373
+ </xsl:when>
374
+ <xsl:otherwise>
375
+ </xsl:otherwise>
376
+ </xsl:choose>
377
+
378
+ <xsl:text>to</xsl:text>
379
+ <xsl:number level="any" format="01" from="d:book"/>
380
+ <xsl:if test="not($recursive)">
381
+ <xsl:value-of select="$html.ext"/>
382
+ </xsl:if>
383
+ </xsl:when>
384
+
385
+ <xsl:otherwise>
386
+ <xsl:text>chunk-filename-error-</xsl:text>
387
+ <xsl:value-of select="name(.)"/>
388
+ <xsl:number level="any" format="01" from="d:set"/>
389
+ <xsl:if test="not($recursive)">
390
+ <xsl:value-of select="$html.ext"/>
391
+ </xsl:if>
392
+ </xsl:otherwise>
393
+ </xsl:choose>
394
+ </xsl:template>
395
+
396
+ <!-- ==================================================================== -->
397
+
398
+
399
+
400
+ <xsl:template match="processing-instruction('dbhtml')">
401
+ <!-- nop -->
402
+ </xsl:template>
403
+
404
+ <!-- ==================================================================== -->
405
+
406
+
407
+ <xsl:template match="*" mode="find.chunks">
408
+ <xsl:variable name="chunk">
409
+ <xsl:call-template name="chunk"/>
410
+ </xsl:variable>
411
+
412
+ <xsl:choose>
413
+ <xsl:when test="$chunk != 0">
414
+ <cf:div id="{generate-id()}">
415
+ <xsl:apply-templates select="." mode="class.attribute"/>
416
+ <xsl:apply-templates select="*" mode="find.chunks"/>
417
+ </cf:div>
418
+ </xsl:when>
419
+ <xsl:otherwise>
420
+ <xsl:apply-templates select="*" mode="find.chunks"/>
421
+ </xsl:otherwise>
422
+ </xsl:choose>
423
+ </xsl:template>
424
+
425
+ <!-- Leave legalnotice chunk out of the list for Next and Prev -->
426
+ <xsl:template match="d:legalnotice" mode="find.chunks"/>
427
+
428
+ <xsl:template match="/">
429
+ <!-- * Get a title for current doc so that we let the user -->
430
+ <!-- * know what document we are processing at this point. -->
431
+ <xsl:variable name="doc.title">
432
+ <xsl:call-template name="get.doc.title"/>
433
+ </xsl:variable>
434
+ <xsl:choose>
435
+ <xsl:when test="$exsl.node.set.available != 0 and namespace-uri(/*) != 'http://docbook.org/ns/docbook'">
436
+ <xsl:call-template name="log.message">
437
+ <xsl:with-param name="level">Note</xsl:with-param>
438
+ <xsl:with-param name="source" select="$doc.title"/>
439
+ <xsl:with-param name="context-desc">
440
+ <xsl:text>namesp. add</xsl:text>
441
+ </xsl:with-param>
442
+ <xsl:with-param name="message">
443
+ <xsl:text>added namespace before processing</xsl:text>
444
+ </xsl:with-param>
445
+ </xsl:call-template>
446
+
447
+ <xsl:apply-templates select="exsl:node-set($with.namespace)"/>
448
+ </xsl:when>
449
+ <!-- Can't process unless namespace fixed with exsl node-set()-->
450
+ <xsl:when test="namespace-uri(/*) != 'http://docbook.org/ns/docbook'">
451
+ <xsl:message terminate="yes">
452
+ <xsl:text>Unable to add the namespace from DB4 document,</xsl:text>
453
+ <xsl:text> cannot proceed.</xsl:text>
454
+ </xsl:message>
455
+ </xsl:when>
456
+ <xsl:otherwise>
457
+ <xsl:choose>
458
+ <xsl:when test="$rootid != ''">
459
+ <xsl:choose>
460
+ <xsl:when test="count(key('id',$rootid)) = 0">
461
+ <xsl:message terminate="yes">
462
+ <xsl:text>ID '</xsl:text>
463
+ <xsl:value-of select="$rootid"/>
464
+ <xsl:text>' not found in document.</xsl:text>
465
+ </xsl:message>
466
+ </xsl:when>
467
+ <xsl:otherwise>
468
+ <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
469
+ <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
470
+ </xsl:if>
471
+ <xsl:if test="$collect.xref.targets != 'only'">
472
+ <xsl:apply-templates select="key('id',$rootid)" mode="process.root"/>
473
+ <xsl:if test="$tex.math.in.alt != ''">
474
+ <xsl:apply-templates select="key('id',$rootid)" mode="collect.tex.math"/>
475
+ </xsl:if>
476
+ <xsl:if test="$generate.manifest != 0">
477
+ <xsl:call-template name="generate.manifest">
478
+ <xsl:with-param name="node" select="key('id',$rootid)"/>
479
+ </xsl:call-template>
480
+ </xsl:if>
481
+ </xsl:if>
482
+ </xsl:otherwise>
483
+ </xsl:choose>
484
+ </xsl:when>
485
+ <xsl:otherwise>
486
+ <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
487
+ <xsl:apply-templates select="/" mode="collect.targets"/>
488
+ </xsl:if>
489
+ <xsl:if test="$collect.xref.targets != 'only'">
490
+ <xsl:apply-templates select="/" mode="process.root"/>
491
+ <xsl:if test="$tex.math.in.alt != ''">
492
+ <xsl:apply-templates select="/" mode="collect.tex.math"/>
493
+ </xsl:if>
494
+ <xsl:if test="$generate.manifest != 0">
495
+ <xsl:call-template name="generate.manifest">
496
+ <xsl:with-param name="node" select="/"/>
497
+ </xsl:call-template>
498
+ </xsl:if>
499
+ </xsl:if>
500
+ </xsl:otherwise>
501
+ </xsl:choose>
502
+ </xsl:otherwise>
503
+ </xsl:choose>
504
+ </xsl:template>
505
+
506
+ <xsl:template match="*" mode="process.root">
507
+ <xsl:apply-templates select="."/>
508
+ <xsl:call-template name="generate.css.files"/>
509
+ </xsl:template>
510
+
511
+ <!-- ====================================================================== -->
512
+
513
+ <xsl:template match="d:set|d:book|d:part|d:preface|d:chapter|d:appendix |d:article |d:topic |d:reference|d:refentry |d:book/d:glossary|d:article/d:glossary|d:part/d:glossary |d:book/d:bibliography|d:article/d:bibliography|d:part/d:bibliography |d:colophon">
514
+ <xsl:choose>
515
+ <xsl:when test="$onechunk != 0 and parent::*">
516
+ <xsl:apply-imports/>
517
+ </xsl:when>
518
+ <xsl:otherwise>
519
+ <xsl:call-template name="process-chunk-element"/>
520
+ </xsl:otherwise>
521
+ </xsl:choose>
522
+ </xsl:template>
523
+
524
+ <xsl:template match="d:sect1|d:sect2|d:sect3|d:sect4|d:sect5|d:section">
525
+ <xsl:variable name="ischunk">
526
+ <xsl:call-template name="chunk"/>
527
+ </xsl:variable>
528
+
529
+ <xsl:choose>
530
+ <xsl:when test="not(parent::*)">
531
+ <xsl:call-template name="process-chunk-element"/>
532
+ </xsl:when>
533
+ <xsl:when test="$ischunk = 0">
534
+ <xsl:apply-imports/>
535
+ </xsl:when>
536
+ <xsl:otherwise>
537
+ <xsl:call-template name="process-chunk-element"/>
538
+ </xsl:otherwise>
539
+ </xsl:choose>
540
+ </xsl:template>
541
+
542
+ <xsl:template match="d:setindex |d:book/d:index |d:article/d:index |d:part/d:index">
543
+ <!-- some implementations use completely empty index tags to indicate -->
544
+ <!-- where an automatically generated index should be inserted. so -->
545
+ <!-- if the index is completely empty, skip it. -->
546
+ <xsl:if test="count(*)&gt;0 or $generate.index != '0'">
547
+ <xsl:call-template name="process-chunk-element"/>
548
+ </xsl:if>
549
+ </xsl:template>
550
+
551
+ <!-- Resolve xml:base attributes -->
552
+ <xsl:template match="@fileref">
553
+ <!-- need a check for absolute urls -->
554
+ <xsl:choose>
555
+ <xsl:when test="contains(., ':')">
556
+ <!-- it has a uri scheme so it is an absolute uri -->
557
+ <xsl:value-of select="."/>
558
+ </xsl:when>
559
+ <xsl:when test="$keep.relative.image.uris != 0">
560
+ <!-- leave it alone -->
561
+ <xsl:value-of select="."/>
562
+ </xsl:when>
563
+ <xsl:otherwise>
564
+ <!-- its a relative uri -->
565
+ <xsl:call-template name="relative-uri">
566
+ <xsl:with-param name="destdir">
567
+ <xsl:call-template name="dbhtml-dir">
568
+ <xsl:with-param name="context" select=".."/>
569
+ </xsl:call-template>
570
+ </xsl:with-param>
571
+ </xsl:call-template>
572
+ </xsl:otherwise>
573
+ </xsl:choose>
574
+ </xsl:template>
575
+
576
+ <!-- ==================================================================== -->
577
+ <xsl:template match="d:set|d:book|d:part|d:preface|d:chapter|d:appendix |d:article |d:topic |d:reference|d:refentry |d:sect1|d:sect2|d:sect3|d:sect4|d:sect5 |d:section |d:book/d:glossary|d:article/d:glossary|d:part/d:glossary |d:book/d:bibliography|d:article/d:bibliography|d:part/d:bibliography |d:colophon" mode="enumerate-files">
578
+ <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
579
+ <xsl:if test="$ischunk='1'">
580
+ <xsl:call-template name="make-relative-filename">
581
+ <xsl:with-param name="base.dir">
582
+ <xsl:if test="$manifest.in.base.dir = 0">
583
+ <xsl:value-of select="$chunk.base.dir"/>
584
+ </xsl:if>
585
+ </xsl:with-param>
586
+ <xsl:with-param name="base.name">
587
+ <xsl:apply-templates mode="chunk-filename" select="."/>
588
+ </xsl:with-param>
589
+ </xsl:call-template>
590
+ <xsl:text>
591
+ </xsl:text>
592
+ </xsl:if>
593
+ <xsl:apply-templates select="*" mode="enumerate-files"/>
594
+ </xsl:template>
595
+
596
+ <xsl:template match="d:book/d:index|d:article/d:index|d:part/d:index" mode="enumerate-files">
597
+ <xsl:if test="$htmlhelp.output != 1">
598
+ <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
599
+ <xsl:if test="$ischunk='1'">
600
+ <xsl:call-template name="make-relative-filename">
601
+ <xsl:with-param name="base.dir">
602
+ <xsl:if test="$manifest.in.base.dir = 0">
603
+ <xsl:value-of select="$chunk.base.dir"/>
604
+ </xsl:if>
605
+ </xsl:with-param>
606
+ <xsl:with-param name="base.name">
607
+ <xsl:apply-templates mode="chunk-filename" select="."/>
608
+ </xsl:with-param>
609
+ </xsl:call-template>
610
+ <xsl:text>
611
+ </xsl:text>
612
+ </xsl:if>
613
+ <xsl:apply-templates select="*" mode="enumerate-files"/>
614
+ </xsl:if>
615
+ </xsl:template>
616
+
617
+ <xsl:template match="d:legalnotice" mode="enumerate-files">
618
+ <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
619
+ <xsl:if test="$generate.legalnotice.link != 0">
620
+ <xsl:call-template name="make-relative-filename">
621
+ <xsl:with-param name="base.dir">
622
+ <xsl:if test="$manifest.in.base.dir = 0">
623
+ <xsl:value-of select="$chunk.base.dir"/>
624
+ </xsl:if>
625
+ </xsl:with-param>
626
+ <xsl:with-param name="base.name">
627
+ <xsl:apply-templates mode="chunk-filename" select="."/>
628
+ </xsl:with-param>
629
+ </xsl:call-template>
630
+ <xsl:text>
631
+ </xsl:text>
632
+ </xsl:if>
633
+ </xsl:template>
634
+
635
+ <xsl:template match="d:revhistory" mode="enumerate-files">
636
+ <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
637
+ <xsl:if test="$generate.revhistory.link != 0">
638
+ <xsl:call-template name="make-relative-filename">
639
+ <xsl:with-param name="base.dir">
640
+ <xsl:if test="$manifest.in.base.dir = 0">
641
+ <xsl:value-of select="$chunk.base.dir"/>
642
+ </xsl:if>
643
+ </xsl:with-param>
644
+ <xsl:with-param name="base.name">
645
+ <xsl:call-template name="ln.or.rh.filename">
646
+ <xsl:with-param name="is.ln" select="false()"/>
647
+ </xsl:call-template>
648
+ </xsl:with-param>
649
+ </xsl:call-template>
650
+ <xsl:text>
651
+ </xsl:text>
652
+ </xsl:if>
653
+ </xsl:template>
654
+
655
+ <xsl:template match="d:mediaobject[d:imageobject] | d:inlinemediaobject[d:imageobject]" mode="enumerate-files">
656
+ <xsl:variable name="longdesc.uri">
657
+ <xsl:call-template name="longdesc.uri">
658
+ <xsl:with-param name="mediaobject" select="."/>
659
+ </xsl:call-template>
660
+ </xsl:variable>
661
+ <xsl:variable name="mediaobject" select="."/>
662
+
663
+ <xsl:if test="$html.longdesc != 0 and $mediaobject/d:textobject[not(d:phrase)]">
664
+ <xsl:call-template name="longdesc.uri">
665
+ <xsl:with-param name="mediaobject" select="$mediaobject"/>
666
+ </xsl:call-template>
667
+ <xsl:text>
668
+ </xsl:text>
669
+ </xsl:if>
670
+ </xsl:template>
671
+
672
+ <xsl:template match="text()" mode="enumerate-files">
673
+ </xsl:template>
674
+
675
+ </xsl:stylesheet>