1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets. Do not edit this file.-->
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:xalanredirect="org.apache.xalan.xslt.extensions.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.1" exclude-result-prefixes="doc" extension-element-prefixes="saxon xalanredirect lxslt exsl">
6 <!-- ********************************************************************
8 ********************************************************************
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
12 and other information.
14 ******************************************************************** -->
16 <!-- ==================================================================== -->
18 <!-- This stylesheet works with XSLT implementations that support -->
19 <!-- exsl:document, saxon:output, or xalanredirect:write -->
20 <!-- Note: Only Saxon 6.4.2 or later is supported. -->
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="''"/>
32 <xsl:param name="saxon.character.representation" select="'entity;decimal'"/>
34 <!-- ==================================================================== -->
36 <xsl:template name="make-relative-filename">
37 <xsl:param name="base.dir" select="'./'"/>
38 <xsl:param name="base.name" select="''"/>
41 <!-- put Saxon first to work around a bug in libxslt -->
42 <xsl:when test="element-available('saxon:output')">
43 <!-- Saxon doesn't make the chunks relative -->
44 <xsl:value-of select="concat($base.dir,$base.name)"/>
46 <xsl:when test="element-available('exsl:document')">
47 <!-- EXSL document does make the chunks relative, I think -->
49 <xsl:when test="count(parent::*) = 0">
50 <xsl:value-of select="concat($base.dir,$base.name)"/>
53 <xsl:value-of select="$base.name"/>
57 <xsl:when test="element-available('xalanredirect:write')">
58 <!-- Xalan doesn't make the chunks relative -->
59 <xsl:value-of select="concat($base.dir,$base.name)"/>
62 <xsl:message terminate="yes">
63 <xsl:text>Don't know how to chunk with </xsl:text>
64 <xsl:value-of select="system-property('xsl:vendor')"/>
70 <xsl:template name="write.chunk">
71 <xsl:param name="filename" select="''"/>
72 <xsl:param name="quiet" select="0"/>
74 <xsl:param name="method" select="$chunker.output.method"/>
75 <xsl:param name="encoding" select="$chunker.output.encoding"/>
76 <xsl:param name="indent" select="$chunker.output.indent"/>
77 <xsl:param name="omit-xml-declaration" select="$chunker.output.omit-xml-declaration"/>
78 <xsl:param name="standalone" select="$chunker.output.standalone"/>
79 <xsl:param name="doctype-public" select="$chunker.output.doctype-public"/>
80 <xsl:param name="doctype-system" select="$chunker.output.doctype-system"/>
81 <xsl:param name="media-type" select="$chunker.output.media-type"/>
82 <xsl:param name="cdata-section-elements" select="$chunker.output.cdata-section-elements"/>
84 <xsl:param name="content"/>
86 <xsl:if test="$quiet = 0">
88 <xsl:text>Writing </xsl:text>
89 <xsl:value-of select="$filename"/>
90 <xsl:if test="name(.) != ''">
91 <xsl:text> for </xsl:text>
92 <xsl:value-of select="name(.)"/>
94 <xsl:text>(</xsl:text>
95 <xsl:value-of select="@id"/>
96 <xsl:text>)</xsl:text>
103 <xsl:when test="element-available('exsl:document')">
105 <!-- Handle the permutations ... -->
106 <xsl:when test="$media-type != ''">
108 <xsl:when test="$doctype-public != '' and $doctype-system != ''">
109 <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}">
110 <xsl:copy-of select="$content"/>
113 <xsl:when test="$doctype-public != '' and $doctype-system = ''">
114 <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}">
115 <xsl:copy-of select="$content"/>
118 <xsl:when test="$doctype-public = '' and $doctype-system != ''">
119 <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}">
120 <xsl:copy-of select="$content"/>
123 <xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
124 <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}">
125 <xsl:copy-of select="$content"/>
132 <xsl:when test="$doctype-public != '' and $doctype-system != ''">
133 <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}">
134 <xsl:copy-of select="$content"/>
137 <xsl:when test="$doctype-public != '' and $doctype-system = ''">
138 <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}">
139 <xsl:copy-of select="$content"/>
142 <xsl:when test="$doctype-public = '' and $doctype-system != ''">
143 <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}">
144 <xsl:copy-of select="$content"/>
147 <xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
148 <exsl:document href="{$filename}" method="{$method}" encoding="{$encoding}" indent="{$indent}" omit-xml-declaration="{$omit-xml-declaration}" cdata-section-elements="{$cdata-section-elements}" standalone="{$standalone}">
149 <xsl:copy-of select="$content"/>
157 <xsl:when test="element-available('saxon:output')">
159 <!-- Handle the permutations ... -->
160 <xsl:when test="$media-type != ''">
162 <xsl:when test="$doctype-public != '' and $doctype-system != ''">
163 <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}">
164 <xsl:copy-of select="$content"/>
167 <xsl:when test="$doctype-public != '' and $doctype-system = ''">
168 <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}">
169 <xsl:copy-of select="$content"/>
172 <xsl:when test="$doctype-public = '' and $doctype-system != ''">
173 <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}">
174 <xsl:copy-of select="$content"/>
177 <xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
178 <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}">
179 <xsl:copy-of select="$content"/>
186 <xsl:when test="$doctype-public != '' and $doctype-system != ''">
187 <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}">
188 <xsl:copy-of select="$content"/>
191 <xsl:when test="$doctype-public != '' and $doctype-system = ''">
192 <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}">
193 <xsl:copy-of select="$content"/>
196 <xsl:when test="$doctype-public = '' and $doctype-system != ''">
197 <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}">
198 <xsl:copy-of select="$content"/>
201 <xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
202 <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}">
203 <xsl:copy-of select="$content"/>
211 <xsl:when test="element-available('xalanredirect:write')">
212 <!-- Xalan uses xalanredirect -->
213 <xalanredirect:write file="{$filename}">
214 <xsl:copy-of select="$content"/>
215 </xalanredirect:write>
219 <!-- it doesn't matter since we won't be making chunks... -->
220 <xsl:message terminate="yes">
221 <xsl:text>Can't make chunks with </xsl:text>
222 <xsl:value-of select="system-property('xsl:vendor')"/>
223 <xsl:text>'s processor.</xsl:text>
229 <xsl:template name="write.chunk.with.doctype">
230 <xsl:param name="filename" select="''"/>
231 <xsl:param name="quiet" select="0"/>
233 <xsl:param name="method" select="$chunker.output.method"/>
234 <xsl:param name="encoding" select="$chunker.output.encoding"/>
235 <xsl:param name="indent" select="$chunker.output.indent"/>
236 <xsl:param name="omit-xml-declaration" select="$chunker.output.omit-xml-declaration"/>
237 <xsl:param name="standalone" select="$chunker.output.standalone"/>
238 <xsl:param name="doctype-public" select="$chunker.output.doctype-public"/>
239 <xsl:param name="doctype-system" select="$chunker.output.doctype-system"/>
240 <xsl:param name="media-type" select="$chunker.output.media-type"/>
241 <xsl:param name="cdata-section-elements" select="$chunker.output.cdata-section-elements"/>
243 <xsl:param name="content"/>
245 <xsl:call-template name="write.chunk">
246 <xsl:with-param name="filename" select="$filename"/>
247 <xsl:with-param name="quiet" select="$quiet"/>
248 <xsl:with-param name="method" select="$method"/>
249 <xsl:with-param name="encoding" select="$encoding"/>
250 <xsl:with-param name="indent" select="$indent"/>
251 <xsl:with-param name="omit-xml-declaration" select="$omit-xml-declaration"/>
252 <xsl:with-param name="standalone" select="$standalone"/>
253 <xsl:with-param name="doctype-public" select="$doctype-public"/>
254 <xsl:with-param name="doctype-system" select="$doctype-system"/>
255 <xsl:with-param name="media-type" select="$media-type"/>
256 <xsl:with-param name="cdata-section-elements" select="$cdata-section-elements"/>
257 <xsl:with-param name="content" select="$content"/>
261 <xsl:template name="write.text.chunk">
262 <xsl:param name="filename" select="''"/>
263 <xsl:param name="quiet" select="0"/>
264 <xsl:param name="method" select="'text'"/>
265 <xsl:param name="encoding" select="$chunker.output.encoding"/>
266 <xsl:param name="media-type" select="$chunker.output.media-type"/>
267 <xsl:param name="content"/>
269 <xsl:call-template name="write.chunk">
270 <xsl:with-param name="filename" select="$filename"/>
271 <xsl:with-param name="quiet" select="$quiet"/>
272 <xsl:with-param name="method" select="$method"/>
273 <xsl:with-param name="encoding" select="$encoding"/>
274 <xsl:with-param name="indent" select="'no'"/>
275 <xsl:with-param name="omit-xml-declaration" select="'no'"/>
276 <xsl:with-param name="standalone" select="'no'"/>
277 <xsl:with-param name="doctype-public"/>
278 <xsl:with-param name="doctype-system"/>
279 <xsl:with-param name="media-type" select="$media-type"/>
280 <xsl:with-param name="cdata-section-elements"/>
281 <xsl:with-param name="content" select="$content"/>