source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/xhtml/chunker.xsl@ 15c7d39

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 15c7d39 was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 17.5 KB
Line 
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:saxon="http://icl.com/saxon" xmlns:lxslt="http://xml.apache.org/xslt" xmlns:redirect="http://xml.apache.org/xalan/redirect" xmlns:exsl="http://exslt.org/common" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" xmlns="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="saxon lxslt redirect exsl doc" extension-element-prefixes="saxon redirect lxslt exsl">
5
6<!-- ********************************************************************
7 $Id: chunker.xsl 9656 2012-10-29 18:09:53Z bobstayton $
8 ********************************************************************
9
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://docbook.sf.net/release/xsl/current/ for
12 copyright and other information.
13
14 ******************************************************************** -->
15
16<!-- ==================================================================== -->
17
18<!-- This stylesheet works with XSLT implementations that support -->
19<!-- exsl:document, saxon:output, or Xalan's redirect:write -->
20<!-- Note: Only Saxon 6.4.2 or later is supported. -->
21
22<xsl:param name="chunker.output.method" select="'xml'"/>
23<xsl:param name="chunker.output.encoding" select="'UTF-8'"/>
24<xsl:param name="chunker.output.indent" select="'no'"/>
25<xsl:param name="chunker.output.omit-xml-declaration" select="'no'"/>
26<xsl:param name="chunker.output.standalone" select="'no'"/>
27<xsl:param name="chunker.output.doctype-public" select="'-//W3C//DTD XHTML 1.0 Transitional//EN'"/>
28<xsl:param name="chunker.output.doctype-system" select="'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'"/>
29<xsl:param name="chunker.output.media-type" select="''"/>
30<xsl:param name="chunker.output.cdata-section-elements" select="''"/>
31
32<!-- Make sure base.dir has a trailing slash now -->
33<xsl:param name="chunk.base.dir">
34 <xsl:choose>
35 <xsl:when test="string-length($base.dir) = 0"/>
36 <!-- make sure to add trailing slash if omitted by user -->
37 <xsl:when test="substring($base.dir, string-length($base.dir), 1) = '/'">
38 <xsl:value-of select="$base.dir"/>
39 </xsl:when>
40 <xsl:otherwise>
41 <xsl:value-of select="concat($base.dir, '/')"/>
42 </xsl:otherwise>
43 </xsl:choose>
44</xsl:param>
45
46<xsl:param name="saxon.character.representation" select="'entity;decimal'"/>
47
48<!-- ==================================================================== -->
49
50<xsl:template name="make-relative-filename">
51 <xsl:param name="base.dir" select="'./'"/>
52 <xsl:param name="base.name" select="''"/>
53
54 <xsl:choose>
55 <!-- put Saxon first to work around a bug in libxslt -->
56 <xsl:when test="element-available('saxon:output')">
57 <!-- Saxon doesn't make the chunks relative -->
58 <xsl:value-of select="concat($base.dir,$base.name)"/>
59 </xsl:when>
60 <xsl:when test="element-available('exsl:document')">
61 <!-- EXSL document does make the chunks relative, I think -->
62 <xsl:choose>
63 <xsl:when test="count(parent::*) = 0">
64 <xsl:value-of select="concat($base.dir,$base.name)"/>
65 </xsl:when>
66 <xsl:otherwise>
67 <xsl:value-of select="$base.name"/>
68 </xsl:otherwise>
69 </xsl:choose>
70 </xsl:when>
71 <xsl:when test="element-available('redirect:write')">
72 <!-- Xalan doesn't make the chunks relative -->
73 <xsl:value-of select="concat($base.dir,$base.name)"/>
74 </xsl:when>
75 <xsl:otherwise>
76 <xsl:message terminate="yes">
77 <xsl:text>Don't know how to chunk with </xsl:text>
78 <xsl:value-of select="system-property('xsl:vendor')"/>
79 </xsl:message>
80 </xsl:otherwise>
81 </xsl:choose>
82</xsl:template>
83
84<xsl:template name="write.chunk">
85 <xsl:param name="filename" select="''"/>
86 <xsl:param name="quiet" select="$chunk.quietly"/>
87 <xsl:param name="suppress-context-node-name" select="0"/>
88 <xsl:param name="message-prolog"/>
89 <xsl:param name="message-epilog"/>
90
91 <xsl:param name="method" select="$chunker.output.method"/>
92 <xsl:param name="encoding" select="$chunker.output.encoding"/>
93 <xsl:param name="indent" select="$chunker.output.indent"/>
94 <xsl:param name="omit-xml-declaration" select="$chunker.output.omit-xml-declaration"/>
95 <xsl:param name="standalone" select="$chunker.output.standalone"/>
96 <xsl:param name="doctype-public" select="$chunker.output.doctype-public"/>
97 <xsl:param name="doctype-system" select="$chunker.output.doctype-system"/>
98 <xsl:param name="media-type" select="$chunker.output.media-type"/>
99 <xsl:param name="cdata-section-elements" select="$chunker.output.cdata-section-elements"/>
100
101 <xsl:param name="content"/>
102
103 <xsl:if test="$quiet = 0">
104 <xsl:message>
105 <xsl:if test="not($message-prolog = '')">
106 <xsl:value-of select="$message-prolog"/>
107 </xsl:if>
108 <xsl:text>Writing </xsl:text>
109 <xsl:value-of select="$filename"/>
110 <xsl:if test="name(.) != '' and $suppress-context-node-name = 0">
111 <xsl:text> for </xsl:text>
112 <xsl:value-of select="name(.)"/>
113 <xsl:if test="@id or @xml:id">
114 <xsl:text>(</xsl:text>
115 <xsl:value-of select="(@id|@xml:id)[1]"/>
116 <xsl:text>)</xsl:text>
117 </xsl:if>
118 </xsl:if>
119 <xsl:if test="not($message-epilog = '')">
120 <xsl:value-of select="$message-epilog"/>
121 </xsl:if>
122 </xsl:message>
123 </xsl:if>
124
125 <xsl:choose>
126 <xsl:when test="element-available('exsl:document')">
127 <xsl:choose>
128 <!-- Handle the permutations ... -->
129 <xsl:when test="$media-type != ''">
130 <xsl:choose>
131 <xsl:when test="$doctype-public != '' and $doctype-system != ''">
132 <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" doctype-public="{$doctype-public}" doctype-system="{$doctype-system}" standalone="{$standalone}">
133 <xsl:copy-of select="$content"/>
134 </exsl:document>
135 </xsl:when>
136 <xsl:when test="$doctype-public != '' and $doctype-system = ''">
137 <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" doctype-public="{$doctype-public}" standalone="{$standalone}">
138 <xsl:copy-of select="$content"/>
139 </exsl:document>
140 </xsl:when>
141 <xsl:when test="$doctype-public = '' and $doctype-system != ''">
142 <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" doctype-system="{$doctype-system}" standalone="{$standalone}">
143 <xsl:copy-of select="$content"/>
144 </exsl:document>
145 </xsl:when>
146 <xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
147 <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" standalone="{$standalone}">
148 <xsl:copy-of select="$content"/>
149 </exsl:document>
150 </xsl:otherwise>
151 </xsl:choose>
152 </xsl:when>
153 <xsl:otherwise>
154 <xsl:choose>
155 <xsl:when test="$doctype-public != '' and $doctype-system != ''">
156 <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" doctype-public="{$doctype-public}" doctype-system="{$doctype-system}" standalone="{$standalone}">
157 <xsl:copy-of select="$content"/>
158 </exsl:document>
159 </xsl:when>
160 <xsl:when test="$doctype-public != '' and $doctype-system = ''">
161 <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" doctype-public="{$doctype-public}" standalone="{$standalone}">
162 <xsl:copy-of select="$content"/>
163 </exsl:document>
164 </xsl:when>
165 <xsl:when test="$doctype-public = '' and $doctype-system != ''">
166 <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" doctype-system="{$doctype-system}" standalone="{$standalone}">
167 <xsl:copy-of select="$content"/>
168 </exsl:document>
169 </xsl:when>
170 <xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
171 <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" standalone="{$standalone}">
172 <xsl:copy-of select="$content"/>
173 </exsl:document>
174 </xsl:otherwise>
175 </xsl:choose>
176 </xsl:otherwise>
177 </xsl:choose>
178 </xsl:when>
179
180 <xsl:when test="element-available('saxon:output')">
181 <xsl:choose>
182 <!-- Handle the permutations ... -->
183 <xsl:when test="$media-type != ''">
184 <xsl:choose>
185 <xsl:when test="$doctype-public != '' and $doctype-system != ''">
186 <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" doctype-public="{$doctype-public}" doctype-system="{$doctype-system}" standalone="{$standalone}">
187 <xsl:copy-of select="$content"/>
188 </saxon:output>
189 </xsl:when>
190 <xsl:when test="$doctype-public != '' and $doctype-system = ''">
191 <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" doctype-public="{$doctype-public}" standalone="{$standalone}">
192 <xsl:copy-of select="$content"/>
193 </saxon:output>
194 </xsl:when>
195 <xsl:when test="$doctype-public = '' and $doctype-system != ''">
196 <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" doctype-system="{$doctype-system}" standalone="{$standalone}">
197 <xsl:copy-of select="$content"/>
198 </saxon:output>
199 </xsl:when>
200 <xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
201 <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" media-type="{$media-type}" standalone="{$standalone}">
202 <xsl:copy-of select="$content"/>
203 </saxon:output>
204 </xsl:otherwise>
205 </xsl:choose>
206 </xsl:when>
207 <xsl:otherwise>
208 <xsl:choose>
209 <xsl:when test="$doctype-public != '' and $doctype-system != ''">
210 <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" doctype-public="{$doctype-public}" doctype-system="{$doctype-system}" standalone="{$standalone}">
211 <xsl:copy-of select="$content"/>
212 </saxon:output>
213 </xsl:when>
214 <xsl:when test="$doctype-public != '' and $doctype-system = ''">
215 <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" doctype-public="{$doctype-public}" standalone="{$standalone}">
216 <xsl:copy-of select="$content"/>
217 </saxon:output>
218 </xsl:when>
219 <xsl:when test="$doctype-public = '' and $doctype-system != ''">
220 <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" doctype-system="{$doctype-system}" standalone="{$standalone}">
221 <xsl:copy-of select="$content"/>
222 </saxon:output>
223 </xsl:when>
224 <xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
225 <saxon:output saxon:character-representation="{$saxon.character.representation}" href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" standalone="{$standalone}">
226 <xsl:copy-of select="$content"/>
227 </saxon:output>
228 </xsl:otherwise>
229 </xsl:choose>
230 </xsl:otherwise>
231 </xsl:choose>
232 </xsl:when>
233
234 <xsl:when test="element-available('redirect:write')">
235 <!-- Xalan uses redirect -->
236 <redirect:write file="{$filename}">
237 <xsl:copy-of select="$content"/>
238 </redirect:write>
239 </xsl:when>
240
241 <xsl:otherwise>
242 <!-- it doesn't matter since we won't be making chunks... -->
243 <xsl:message terminate="yes">
244 <xsl:text>Can't make chunks with </xsl:text>
245 <xsl:value-of select="system-property('xsl:vendor')"/>
246 <xsl:text>'s processor.</xsl:text>
247 </xsl:message>
248 </xsl:otherwise>
249 </xsl:choose>
250</xsl:template>
251
252<xsl:template name="write.chunk.with.doctype">
253 <xsl:param name="filename" select="''"/>
254 <xsl:param name="quiet" select="$chunk.quietly"/>
255
256 <xsl:param name="method" select="$chunker.output.method"/>
257 <xsl:param name="encoding" select="$chunker.output.encoding"/>
258 <xsl:param name="indent" select="$chunker.output.indent"/>
259 <xsl:param name="omit-xml-declaration" select="$chunker.output.omit-xml-declaration"/>
260 <xsl:param name="standalone" select="$chunker.output.standalone"/>
261 <xsl:param name="doctype-public" select="$chunker.output.doctype-public"/>
262 <xsl:param name="doctype-system" select="$chunker.output.doctype-system"/>
263 <xsl:param name="media-type" select="$chunker.output.media-type"/>
264 <xsl:param name="cdata-section-elements" select="$chunker.output.cdata-section-elements"/>
265
266 <xsl:param name="content"/>
267
268 <xsl:call-template name="write.chunk">
269 <xsl:with-param name="filename" select="$filename"/>
270 <xsl:with-param name="quiet" select="$quiet"/>
271 <xsl:with-param name="method" select="$method"/>
272 <xsl:with-param name="encoding" select="$encoding"/>
273 <xsl:with-param name="indent" select="$indent"/>
274 <xsl:with-param name="omit-xml-declaration" select="$omit-xml-declaration"/>
275 <xsl:with-param name="standalone" select="$standalone"/>
276 <xsl:with-param name="doctype-public" select="$doctype-public"/>
277 <xsl:with-param name="doctype-system" select="$doctype-system"/>
278 <xsl:with-param name="media-type" select="$media-type"/>
279 <xsl:with-param name="cdata-section-elements" select="$cdata-section-elements"/>
280 <xsl:with-param name="content" select="$content"/>
281 </xsl:call-template>
282</xsl:template>
283
284<xsl:template name="write.text.chunk">
285 <xsl:param name="filename" select="''"/>
286 <xsl:param name="quiet" select="$chunk.quietly"/>
287 <xsl:param name="suppress-context-node-name" select="0"/>
288 <xsl:param name="message-prolog"/>
289 <xsl:param name="message-epilog"/>
290 <xsl:param name="method" select="'text'"/>
291 <xsl:param name="encoding" select="$chunker.output.encoding"/>
292 <xsl:param name="media-type" select="$chunker.output.media-type"/>
293 <xsl:param name="content"/>
294
295 <xsl:call-template name="write.chunk">
296 <xsl:with-param name="filename" select="$filename"/>
297 <xsl:with-param name="quiet" select="$quiet"/>
298 <xsl:with-param name="suppress-context-node-name" select="$suppress-context-node-name"/>
299 <xsl:with-param name="message-prolog" select="$message-prolog"/>
300 <xsl:with-param name="message-epilog" select="$message-epilog"/>
301 <xsl:with-param name="method" select="$method"/>
302 <xsl:with-param name="encoding" select="$encoding"/>
303 <xsl:with-param name="indent" select="'no'"/>
304 <xsl:with-param name="omit-xml-declaration" select="'yes'"/>
305 <xsl:with-param name="standalone" select="'no'"/>
306 <xsl:with-param name="doctype-public"/>
307 <xsl:with-param name="doctype-system"/>
308 <xsl:with-param name="media-type" select="$media-type"/>
309 <xsl:with-param name="cdata-section-elements"/>
310 <xsl:with-param name="content" select="$content"/>
311 </xsl:call-template>
312</xsl:template>
313
314
315</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.