2 <axsl:stylesheet xmlns:axsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:dbk="http://docbook.org/ns/docbook"
4 xmlns:rnd="http://docbook.org/ns/docbook/roundtrip"
6 <!--====================================-->
8 <!--= DO NOT EDIT THIS STYLESHEET =-->
10 <!--= This stylesheet is generated =-->
11 <!--= by makeSections.xsl and a =-->
12 <!--= mapping specification. =-->
14 <!--====================================-->
15 <axsl:output indent="yes"/>
16 <axsl:strip-space elements="*"/>
17 <axsl:preserve-space elements="dbk:para dbk:emphasis"/>
18 <axsl:template match="dbk:article">
20 <axsl:for-each select="@*">
23 <axsl:variable name="books" select="dbk:para[@rnd:style = "d:book" or @rnd:style = "book-title"]"/>
24 <axsl:variable name="toplevel-components" select="dbk:para[@rnd:style = "d:article" or @rnd:style = "article-title" or @rnd:style = "d:appendix" or @rnd:style = "appendix-title" or @rnd:style = "d:chapter" or @rnd:style = "chapter-title" or @rnd:style = "d:preface" or @rnd:style = "preface-title"]"/>
26 <axsl:when test="$books">
27 <axsl:apply-templates select="$books[1]/preceding-sibling::*"/>
28 <axsl:apply-templates select="$books[1]" mode="book">
29 <axsl:with-param name="books" select="$books[position() != 1]"/>
30 </axsl:apply-templates>
32 <axsl:when test="$toplevel-components">
33 <axsl:apply-templates select="$toplevel-components[1]/preceding-sibling::*"/>
34 <axsl:apply-templates select="$toplevel-components[1]" mode="toplevel-component">
35 <axsl:with-param name="toplevel-components" select="$toplevel-components[position() != 1]"/>
36 </axsl:apply-templates>
39 <axsl:apply-templates/>
44 <axsl:template match="dbk:para" mode="book">
45 <axsl:param name="books" select="/.."/>
47 <axsl:when test="$books and (@rnd:style = "d:book" or @rnd:style = "book-title")">
48 <axsl:call-template name="make-book">
49 <axsl:with-param name="books" select="$books"/>
50 <axsl:with-param name="book-components" select="$books[1]/preceding-sibling::dbk:para[@rnd:style = "d:part" or @rnd:style = "part-title" or @rnd:style = "d:article" or @rnd:style = "article-title" or @rnd:style = "d:appendix" or @rnd:style = "appendix-title" or @rnd:style = "d:chapter" or @rnd:style = "chapter-title" or @rnd:style = "d:preface" or @rnd:style = "preface-title"]"/>
54 <axsl:call-template name="make-book">
55 <axsl:with-param name="books" select="$books"/>
56 <axsl:with-param name="book-components" select="following-sibling::dbk:para[@rnd:style = "d:part" or @rnd:style = "part-title" or @rnd:style = "d:article" or @rnd:style = "article-title" or @rnd:style = "d:appendix" or @rnd:style = "appendix-title" or @rnd:style = "d:chapter" or @rnd:style = "chapter-title" or @rnd:style = "d:preface" or @rnd:style = "preface-title"]"/>
61 <axsl:template name="make-book">
62 <axsl:param name="books" select="/.."/>
63 <axsl:param name="book-components" select="/.."/>
64 <!-- mode toplevel-templates -->
65 <book xmlns="http://docbook.org/ns/docbook">
66 <axsl:call-template name="copy"/>
67 <axsl:apply-templates select="following-sibling::*[1]" mode="book-component">
68 <axsl:with-param name="nextbook" select="$books[1]"/>
69 <axsl:with-param name="book-components" select="$book-components"/>
70 </axsl:apply-templates>
72 <axsl:apply-templates select="$books[1]" mode="book">
73 <axsl:with-param name="books" select="$books[position() != 1]"/>
74 </axsl:apply-templates>
76 <axsl:template match="dbk:para" mode="toplevel-component">
77 <axsl:param name="toplevel-components" select="/.."/>
79 <axsl:when test="$toplevel-components and (@rnd:style = "d:article" or @rnd:style = "article-title" or @rnd:style = "d:appendix" or @rnd:style = "appendix-title" or @rnd:style = "d:chapter" or @rnd:style = "chapter-title" or @rnd:style = "d:preface" or @rnd:style = "preface-title")">
80 <axsl:call-template name="make-toplevel-component">
81 <axsl:with-param name="toplevel-components" select="$toplevel-components"/>
82 <axsl:with-param name="sect1s" select="$toplevel-components[1]/preceding-sibling::dbk:para[@rnd:style = "d:sect1" or @rnd:style = "sect1-title"]"/>
86 <axsl:call-template name="make-toplevel-component">
87 <axsl:with-param name="toplevel-components" select="$toplevel-components"/>
88 <axsl:with-param name="sect1s" select="following-sibling::dbk:para[@rnd:style = "d:sect1" or @rnd:style = "sect1-title"]"/>
93 <axsl:template name="make-toplevel-component">
94 <axsl:param name="toplevel-components" select="/.."/>
95 <axsl:param name="sect1s" select="/.."/>
96 <!-- mode toplevel-templates: group:level - do not create element -->
97 <axsl:call-template name="copy"/>
98 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect1">
99 <axsl:with-param name="nexttoplevel-component" select="$toplevel-components[1]"/>
100 <axsl:with-param name="sect1s" select="$sect1s"/>
101 </axsl:apply-templates>
102 <axsl:apply-templates select="$toplevel-components[1]" mode="toplevel-component">
103 <axsl:with-param name="toplevel-components" select="$toplevel-components[position() != 1]"/>
104 </axsl:apply-templates>
106 <axsl:template match="dbk:para" mode="book-component">
107 <axsl:param name="nextbook" select="/.."/>
108 <axsl:param select="/.." name="book-components"/>
110 <axsl:when test="generate-id() = generate-id($nextbook)"/>
111 <axsl:when test="@rnd:style = "d:part" or @rnd:style = "part-title" or @rnd:style = "d:article" or @rnd:style = "article-title" or @rnd:style = "d:appendix" or @rnd:style = "appendix-title" or @rnd:style = "d:chapter" or @rnd:style = "chapter-title" or @rnd:style = "d:preface" or @rnd:style = "preface-title"">
112 <axsl:variable name="nextbook-component" select="following-sibling::dbk:para[@rnd:style = "d:part" or @rnd:style = "part-title" or @rnd:style = "d:article" or @rnd:style = "article-title" or @rnd:style = "d:appendix" or @rnd:style = "appendix-title" or @rnd:style = "d:chapter" or @rnd:style = "chapter-title" or @rnd:style = "d:preface" or @rnd:style = "preface-title"][1]"/>
114 <axsl:when test="$nextbook-component">
115 <axsl:variable name="sect1s" select="$nextbook-component/preceding-sibling::dbk:para[@rnd:style = "d:sect1" or @rnd:style = "sect1-title"]"/>
116 <!-- mode sections 1 -->
117 <book-component xmlns="http://docbook.org/ns/docbook">
118 <axsl:call-template name="copy"/>
119 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect1">
120 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
121 <axsl:with-param name="nextbook" select="$nextbook"/>
122 <axsl:with-param name="sect1s" select="$sect1s"/>
123 <axsl:with-param name="book-components" select="$book-components"/>
124 </axsl:apply-templates>
126 <axsl:if test="count($book-components|$nextbook-component) = count($book-components)">
127 <axsl:apply-templates select="$nextbook-component" mode="book-component">
128 <axsl:with-param name="nextbook" select="$nextbook"/>
129 <axsl:with-param name="book-components" select="$book-components"/>
130 </axsl:apply-templates>
134 <axsl:variable name="sect1s" select="following-sibling::dbk:para[@rnd:style = "d:sect1" or @rnd:style = "sect1-title"]"/>
135 <!-- mode sections 2 -->
136 <book-component xmlns="http://docbook.org/ns/docbook">
137 <axsl:call-template name="copy"/>
138 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect1">
139 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
140 <axsl:with-param name="nextbook" select="$nextbook"/>
141 <axsl:with-param name="sect1s" select="$sect1s"/>
142 <axsl:with-param name="book-components" select="$book-components"/>
143 </axsl:apply-templates>
145 <axsl:if test="count($book-components|$nextbook-component) = count($book-components)">
146 <axsl:apply-templates select="$nextbook-component" mode="book-component">
147 <axsl:with-param name="nextbook" select="$nextbook"/>
148 <axsl:with-param name="book-components" select="$book-components"/>
149 </axsl:apply-templates>
155 <axsl:call-template name="copy"/>
156 <axsl:apply-templates select="following-sibling::*[1]" mode="book-component">
157 <axsl:with-param name="nextbook" select="$nextbook"/>
158 <axsl:with-param name="book-components" select="$book-components"/>
159 </axsl:apply-templates>
163 <axsl:template match="dbk:para" mode="book-sect1">
164 <axsl:param name="nextbook-component" select="/.."/>
165 <axsl:param name="nextbook" select="/.."/>
166 <axsl:param select="/.." name="sect1s"/>
167 <axsl:param select="/.." name="book-components"/>
169 <axsl:when test="generate-id() = generate-id($nextbook-component)"/>
170 <axsl:when test="generate-id() = generate-id($nextbook)"/>
171 <axsl:when test="@rnd:style = "d:sect1" or @rnd:style = "sect1-title"">
172 <axsl:variable name="nextsect1" select="following-sibling::dbk:para[@rnd:style = "d:sect1" or @rnd:style = "sect1-title"][1]"/>
174 <axsl:when test="$nextsect1">
175 <axsl:variable name="sect2s" select="$nextsect1/preceding-sibling::dbk:para[@rnd:style = "d:sect2" or @rnd:style = "sect2-title"]"/>
176 <!-- mode sections 1 -->
177 <sect1 xmlns="http://docbook.org/ns/docbook">
178 <axsl:call-template name="copy"/>
179 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect2">
180 <axsl:with-param name="nextsect1" select="$nextsect1"/>
181 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
182 <axsl:with-param name="nextbook" select="$nextbook"/>
183 <axsl:with-param name="sect2s" select="$sect2s"/>
184 <axsl:with-param name="sect1s" select="$sect1s"/>
185 <axsl:with-param name="book-components" select="$book-components"/>
186 </axsl:apply-templates>
188 <axsl:if test="$nextsect1 and (not($book-components) or count($sect1s|$nextsect1) = count($sect1s))">
189 <axsl:apply-templates select="$nextsect1" mode="book-sect1">
190 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
191 <axsl:with-param name="nextbook" select="$nextbook"/>
192 <axsl:with-param name="sect1s" select="$sect1s"/>
193 <axsl:with-param name="book-components" select="$book-components"/>
194 </axsl:apply-templates>
198 <axsl:variable name="sect2s" select="following-sibling::dbk:para[@rnd:style = "d:sect2" or @rnd:style = "sect2-title"]"/>
199 <!-- mode sections 2 -->
200 <sect1 xmlns="http://docbook.org/ns/docbook">
201 <axsl:call-template name="copy"/>
202 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect2">
203 <axsl:with-param name="nextsect1" select="$nextsect1"/>
204 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
205 <axsl:with-param name="nextbook" select="$nextbook"/>
206 <axsl:with-param name="sect2s" select="$sect2s"/>
207 <axsl:with-param name="sect1s" select="$sect1s"/>
208 <axsl:with-param name="book-components" select="$book-components"/>
209 </axsl:apply-templates>
211 <axsl:if test="$nextsect1 and (not($book-components) or count($sect1s|$nextsect1) = count($sect1s))">
212 <axsl:apply-templates select="$nextsect1" mode="book-sect1">
213 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
214 <axsl:with-param name="nextbook" select="$nextbook"/>
215 <axsl:with-param name="sect1s" select="$sect1s"/>
216 <axsl:with-param name="book-components" select="$book-components"/>
217 </axsl:apply-templates>
223 <axsl:call-template name="copy"/>
224 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect1">
225 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
226 <axsl:with-param name="nextbook" select="$nextbook"/>
227 <axsl:with-param name="sect1s" select="$sect1s"/>
228 <axsl:with-param name="book-components" select="$book-components"/>
229 </axsl:apply-templates>
233 <axsl:template match="dbk:para" mode="book-sect2">
234 <axsl:param name="nextsect1" select="/.."/>
235 <axsl:param name="nextbook-component" select="/.."/>
236 <axsl:param name="nextbook" select="/.."/>
237 <axsl:param select="/.." name="sect2s"/>
238 <axsl:param select="/.." name="sect1s"/>
239 <axsl:param select="/.." name="book-components"/>
241 <axsl:when test="generate-id() = generate-id($nextsect1)"/>
242 <axsl:when test="generate-id() = generate-id($nextbook-component)"/>
243 <axsl:when test="generate-id() = generate-id($nextbook)"/>
244 <axsl:when test="@rnd:style = "d:sect2" or @rnd:style = "sect2-title"">
245 <axsl:variable name="nextsect2" select="following-sibling::dbk:para[@rnd:style = "d:sect2" or @rnd:style = "sect2-title"][1]"/>
247 <axsl:when test="$nextsect2">
248 <axsl:variable name="sect3s" select="$nextsect2/preceding-sibling::dbk:para[@rnd:style = "d:sect3" or @rnd:style = "sect3-title"]"/>
249 <!-- mode sections 1 -->
250 <sect2 xmlns="http://docbook.org/ns/docbook">
251 <axsl:call-template name="copy"/>
252 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect3">
253 <axsl:with-param name="nextsect2" select="$nextsect2"/>
254 <axsl:with-param name="nextsect1" select="$nextsect1"/>
255 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
256 <axsl:with-param name="nextbook" select="$nextbook"/>
257 <axsl:with-param name="sect3s" select="$sect3s"/>
258 <axsl:with-param name="sect2s" select="$sect2s"/>
259 <axsl:with-param name="sect1s" select="$sect1s"/>
260 <axsl:with-param name="book-components" select="$book-components"/>
261 </axsl:apply-templates>
263 <axsl:if test="$nextsect2 and (not($sect1s) or count($sect2s|$nextsect2) = count($sect2s))">
264 <axsl:apply-templates select="$nextsect2" mode="book-sect2">
265 <axsl:with-param name="nextsect1" select="$nextsect1"/>
266 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
267 <axsl:with-param name="nextbook" select="$nextbook"/>
268 <axsl:with-param name="sect2s" select="$sect2s"/>
269 <axsl:with-param name="sect1s" select="$sect1s"/>
270 <axsl:with-param name="book-components" select="$book-components"/>
271 </axsl:apply-templates>
275 <axsl:variable name="sect3s" select="following-sibling::dbk:para[@rnd:style = "d:sect3" or @rnd:style = "sect3-title"]"/>
276 <!-- mode sections 2 -->
277 <sect2 xmlns="http://docbook.org/ns/docbook">
278 <axsl:call-template name="copy"/>
279 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect3">
280 <axsl:with-param name="nextsect2" select="$nextsect2"/>
281 <axsl:with-param name="nextsect1" select="$nextsect1"/>
282 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
283 <axsl:with-param name="nextbook" select="$nextbook"/>
284 <axsl:with-param name="sect3s" select="$sect3s"/>
285 <axsl:with-param name="sect2s" select="$sect2s"/>
286 <axsl:with-param name="sect1s" select="$sect1s"/>
287 <axsl:with-param name="book-components" select="$book-components"/>
288 </axsl:apply-templates>
290 <axsl:if test="$nextsect2 and (not($sect1s) or count($sect2s|$nextsect2) = count($sect2s))">
291 <axsl:apply-templates select="$nextsect2" mode="book-sect2">
292 <axsl:with-param name="nextsect1" select="$nextsect1"/>
293 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
294 <axsl:with-param name="nextbook" select="$nextbook"/>
295 <axsl:with-param name="sect2s" select="$sect2s"/>
296 <axsl:with-param name="sect1s" select="$sect1s"/>
297 <axsl:with-param name="book-components" select="$book-components"/>
298 </axsl:apply-templates>
304 <axsl:call-template name="copy"/>
305 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect2">
306 <axsl:with-param name="nextsect1" select="$nextsect1"/>
307 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
308 <axsl:with-param name="nextbook" select="$nextbook"/>
309 <axsl:with-param name="sect2s" select="$sect2s"/>
310 <axsl:with-param name="sect1s" select="$sect1s"/>
311 <axsl:with-param name="book-components" select="$book-components"/>
312 </axsl:apply-templates>
316 <axsl:template match="dbk:para" mode="book-sect3">
317 <axsl:param name="nextsect2" select="/.."/>
318 <axsl:param name="nextsect1" select="/.."/>
319 <axsl:param name="nextbook-component" select="/.."/>
320 <axsl:param name="nextbook" select="/.."/>
321 <axsl:param select="/.." name="sect3s"/>
322 <axsl:param select="/.." name="sect2s"/>
323 <axsl:param select="/.." name="sect1s"/>
324 <axsl:param select="/.." name="book-components"/>
326 <axsl:when test="generate-id() = generate-id($nextsect2)"/>
327 <axsl:when test="generate-id() = generate-id($nextsect1)"/>
328 <axsl:when test="generate-id() = generate-id($nextbook-component)"/>
329 <axsl:when test="generate-id() = generate-id($nextbook)"/>
330 <axsl:when test="@rnd:style = "d:sect3" or @rnd:style = "sect3-title"">
331 <axsl:variable name="nextsect3" select="following-sibling::dbk:para[@rnd:style = "d:sect3" or @rnd:style = "sect3-title"][1]"/>
333 <axsl:when test="$nextsect3">
334 <axsl:variable name="sect4s" select="$nextsect3/preceding-sibling::dbk:para[@rnd:style = "d:sect4" or @rnd:style = "sect4-title"]"/>
335 <!-- mode sections 1 -->
336 <sect3 xmlns="http://docbook.org/ns/docbook">
337 <axsl:call-template name="copy"/>
338 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect4">
339 <axsl:with-param name="nextsect3" select="$nextsect3"/>
340 <axsl:with-param name="nextsect2" select="$nextsect2"/>
341 <axsl:with-param name="nextsect1" select="$nextsect1"/>
342 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
343 <axsl:with-param name="nextbook" select="$nextbook"/>
344 <axsl:with-param name="sect4s" select="$sect4s"/>
345 <axsl:with-param name="sect3s" select="$sect3s"/>
346 <axsl:with-param name="sect2s" select="$sect2s"/>
347 <axsl:with-param name="sect1s" select="$sect1s"/>
348 <axsl:with-param name="book-components" select="$book-components"/>
349 </axsl:apply-templates>
351 <axsl:if test="$nextsect3 and (not($sect2s) or count($sect3s|$nextsect3) = count($sect3s))">
352 <axsl:apply-templates select="$nextsect3" mode="book-sect3">
353 <axsl:with-param name="nextsect2" select="$nextsect2"/>
354 <axsl:with-param name="nextsect1" select="$nextsect1"/>
355 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
356 <axsl:with-param name="nextbook" select="$nextbook"/>
357 <axsl:with-param name="sect3s" select="$sect3s"/>
358 <axsl:with-param name="sect2s" select="$sect2s"/>
359 <axsl:with-param name="sect1s" select="$sect1s"/>
360 <axsl:with-param name="book-components" select="$book-components"/>
361 </axsl:apply-templates>
365 <axsl:variable name="sect4s" select="following-sibling::dbk:para[@rnd:style = "d:sect4" or @rnd:style = "sect4-title"]"/>
366 <!-- mode sections 2 -->
367 <sect3 xmlns="http://docbook.org/ns/docbook">
368 <axsl:call-template name="copy"/>
369 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect4">
370 <axsl:with-param name="nextsect3" select="$nextsect3"/>
371 <axsl:with-param name="nextsect2" select="$nextsect2"/>
372 <axsl:with-param name="nextsect1" select="$nextsect1"/>
373 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
374 <axsl:with-param name="nextbook" select="$nextbook"/>
375 <axsl:with-param name="sect4s" select="$sect4s"/>
376 <axsl:with-param name="sect3s" select="$sect3s"/>
377 <axsl:with-param name="sect2s" select="$sect2s"/>
378 <axsl:with-param name="sect1s" select="$sect1s"/>
379 <axsl:with-param name="book-components" select="$book-components"/>
380 </axsl:apply-templates>
382 <axsl:if test="$nextsect3 and (not($sect2s) or count($sect3s|$nextsect3) = count($sect3s))">
383 <axsl:apply-templates select="$nextsect3" mode="book-sect3">
384 <axsl:with-param name="nextsect2" select="$nextsect2"/>
385 <axsl:with-param name="nextsect1" select="$nextsect1"/>
386 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
387 <axsl:with-param name="nextbook" select="$nextbook"/>
388 <axsl:with-param name="sect3s" select="$sect3s"/>
389 <axsl:with-param name="sect2s" select="$sect2s"/>
390 <axsl:with-param name="sect1s" select="$sect1s"/>
391 <axsl:with-param name="book-components" select="$book-components"/>
392 </axsl:apply-templates>
398 <axsl:call-template name="copy"/>
399 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect3">
400 <axsl:with-param name="nextsect2" select="$nextsect2"/>
401 <axsl:with-param name="nextsect1" select="$nextsect1"/>
402 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
403 <axsl:with-param name="nextbook" select="$nextbook"/>
404 <axsl:with-param name="sect3s" select="$sect3s"/>
405 <axsl:with-param name="sect2s" select="$sect2s"/>
406 <axsl:with-param name="sect1s" select="$sect1s"/>
407 <axsl:with-param name="book-components" select="$book-components"/>
408 </axsl:apply-templates>
412 <axsl:template match="dbk:para" mode="book-sect4">
413 <axsl:param name="nextsect3" select="/.."/>
414 <axsl:param name="nextsect2" select="/.."/>
415 <axsl:param name="nextsect1" select="/.."/>
416 <axsl:param name="nextbook-component" select="/.."/>
417 <axsl:param name="nextbook" select="/.."/>
418 <axsl:param select="/.." name="sect4s"/>
419 <axsl:param select="/.." name="sect3s"/>
420 <axsl:param select="/.." name="sect2s"/>
421 <axsl:param select="/.." name="sect1s"/>
422 <axsl:param select="/.." name="book-components"/>
424 <axsl:when test="generate-id() = generate-id($nextsect3)"/>
425 <axsl:when test="generate-id() = generate-id($nextsect2)"/>
426 <axsl:when test="generate-id() = generate-id($nextsect1)"/>
427 <axsl:when test="generate-id() = generate-id($nextbook-component)"/>
428 <axsl:when test="generate-id() = generate-id($nextbook)"/>
429 <axsl:when test="@rnd:style = "d:sect4" or @rnd:style = "sect4-title"">
430 <axsl:variable name="nextsect4" select="following-sibling::dbk:para[@rnd:style = "d:sect4" or @rnd:style = "sect4-title"][1]"/>
432 <axsl:when test="$nextsect4">
433 <axsl:variable name="sect5s" select="$nextsect4/preceding-sibling::dbk:para[@rnd:style = "d:sect5" or @rnd:style = "sect5-title"]"/>
434 <!-- mode sections 1 -->
435 <sect4 xmlns="http://docbook.org/ns/docbook">
436 <axsl:call-template name="copy"/>
437 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect5">
438 <axsl:with-param name="nextsect4" select="$nextsect4"/>
439 <axsl:with-param name="nextsect3" select="$nextsect3"/>
440 <axsl:with-param name="nextsect2" select="$nextsect2"/>
441 <axsl:with-param name="nextsect1" select="$nextsect1"/>
442 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
443 <axsl:with-param name="nextbook" select="$nextbook"/>
444 <axsl:with-param name="sect5s" select="$sect5s"/>
445 <axsl:with-param name="sect4s" select="$sect4s"/>
446 <axsl:with-param name="sect3s" select="$sect3s"/>
447 <axsl:with-param name="sect2s" select="$sect2s"/>
448 <axsl:with-param name="sect1s" select="$sect1s"/>
449 <axsl:with-param name="book-components" select="$book-components"/>
450 </axsl:apply-templates>
452 <axsl:if test="$nextsect4 and (not($sect3s) or count($sect4s|$nextsect4) = count($sect4s))">
453 <axsl:apply-templates select="$nextsect4" mode="book-sect4">
454 <axsl:with-param name="nextsect3" select="$nextsect3"/>
455 <axsl:with-param name="nextsect2" select="$nextsect2"/>
456 <axsl:with-param name="nextsect1" select="$nextsect1"/>
457 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
458 <axsl:with-param name="nextbook" select="$nextbook"/>
459 <axsl:with-param name="sect4s" select="$sect4s"/>
460 <axsl:with-param name="sect3s" select="$sect3s"/>
461 <axsl:with-param name="sect2s" select="$sect2s"/>
462 <axsl:with-param name="sect1s" select="$sect1s"/>
463 <axsl:with-param name="book-components" select="$book-components"/>
464 </axsl:apply-templates>
468 <axsl:variable name="sect5s" select="following-sibling::dbk:para[@rnd:style = "d:sect5" or @rnd:style = "sect5-title"]"/>
469 <!-- mode sections 2 -->
470 <sect4 xmlns="http://docbook.org/ns/docbook">
471 <axsl:call-template name="copy"/>
472 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect5">
473 <axsl:with-param name="nextsect4" select="$nextsect4"/>
474 <axsl:with-param name="nextsect3" select="$nextsect3"/>
475 <axsl:with-param name="nextsect2" select="$nextsect2"/>
476 <axsl:with-param name="nextsect1" select="$nextsect1"/>
477 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
478 <axsl:with-param name="nextbook" select="$nextbook"/>
479 <axsl:with-param name="sect5s" select="$sect5s"/>
480 <axsl:with-param name="sect4s" select="$sect4s"/>
481 <axsl:with-param name="sect3s" select="$sect3s"/>
482 <axsl:with-param name="sect2s" select="$sect2s"/>
483 <axsl:with-param name="sect1s" select="$sect1s"/>
484 <axsl:with-param name="book-components" select="$book-components"/>
485 </axsl:apply-templates>
487 <axsl:if test="$nextsect4 and (not($sect3s) or count($sect4s|$nextsect4) = count($sect4s))">
488 <axsl:apply-templates select="$nextsect4" mode="book-sect4">
489 <axsl:with-param name="nextsect3" select="$nextsect3"/>
490 <axsl:with-param name="nextsect2" select="$nextsect2"/>
491 <axsl:with-param name="nextsect1" select="$nextsect1"/>
492 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
493 <axsl:with-param name="nextbook" select="$nextbook"/>
494 <axsl:with-param name="sect4s" select="$sect4s"/>
495 <axsl:with-param name="sect3s" select="$sect3s"/>
496 <axsl:with-param name="sect2s" select="$sect2s"/>
497 <axsl:with-param name="sect1s" select="$sect1s"/>
498 <axsl:with-param name="book-components" select="$book-components"/>
499 </axsl:apply-templates>
505 <axsl:call-template name="copy"/>
506 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect4">
507 <axsl:with-param name="nextsect3" select="$nextsect3"/>
508 <axsl:with-param name="nextsect2" select="$nextsect2"/>
509 <axsl:with-param name="nextsect1" select="$nextsect1"/>
510 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
511 <axsl:with-param name="nextbook" select="$nextbook"/>
512 <axsl:with-param name="sect4s" select="$sect4s"/>
513 <axsl:with-param name="sect3s" select="$sect3s"/>
514 <axsl:with-param name="sect2s" select="$sect2s"/>
515 <axsl:with-param name="sect1s" select="$sect1s"/>
516 <axsl:with-param name="book-components" select="$book-components"/>
517 </axsl:apply-templates>
521 <axsl:template match="dbk:para" mode="book-sect5">
522 <axsl:param name="nextsect4" select="/.."/>
523 <axsl:param name="nextsect3" select="/.."/>
524 <axsl:param name="nextsect2" select="/.."/>
525 <axsl:param name="nextsect1" select="/.."/>
526 <axsl:param name="nextbook-component" select="/.."/>
527 <axsl:param name="nextbook" select="/.."/>
528 <axsl:param select="/.." name="sect5s"/>
529 <axsl:param select="/.." name="sect4s"/>
530 <axsl:param select="/.." name="sect3s"/>
531 <axsl:param select="/.." name="sect2s"/>
532 <axsl:param select="/.." name="sect1s"/>
533 <axsl:param select="/.." name="book-components"/>
535 <axsl:when test="generate-id() = generate-id($nextsect4)"/>
536 <axsl:when test="generate-id() = generate-id($nextsect3)"/>
537 <axsl:when test="generate-id() = generate-id($nextsect2)"/>
538 <axsl:when test="generate-id() = generate-id($nextsect1)"/>
539 <axsl:when test="generate-id() = generate-id($nextbook-component)"/>
540 <axsl:when test="generate-id() = generate-id($nextbook)"/>
541 <axsl:when test="@rnd:style = "d:sect5" or @rnd:style = "sect5-title"">
542 <axsl:variable name="nextsect5" select="following-sibling::dbk:para[@rnd:style = "d:sect5" or @rnd:style = "sect5-title"][1]"/>
543 <!-- mode sections 3 -->
544 <sect5 xmlns="http://docbook.org/ns/docbook">
545 <axsl:call-template name="copy"/>
546 <axsl:apply-templates select="following-sibling::*[1]" mode="book-terminal">
547 <axsl:with-param name="nextsect5" select="$nextsect5"/>
548 <axsl:with-param name="nextsect4" select="$nextsect4"/>
549 <axsl:with-param name="nextsect3" select="$nextsect3"/>
550 <axsl:with-param name="nextsect2" select="$nextsect2"/>
551 <axsl:with-param name="nextsect1" select="$nextsect1"/>
552 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
553 <axsl:with-param name="nextbook" select="$nextbook"/>
554 <axsl:with-param name="sect5s" select="$sect5s"/>
555 <axsl:with-param name="sect4s" select="$sect4s"/>
556 <axsl:with-param name="sect3s" select="$sect3s"/>
557 <axsl:with-param name="sect2s" select="$sect2s"/>
558 <axsl:with-param name="sect1s" select="$sect1s"/>
559 <axsl:with-param name="book-components" select="$book-components"/>
560 </axsl:apply-templates>
562 <axsl:if test="$nextsect5 and (not($sect4s) or count($sect5s|$nextsect5) = count($sect5s))">
563 <axsl:apply-templates select="$nextsect5" mode="book-sect5">
564 <axsl:with-param name="nextsect4" select="$nextsect4"/>
565 <axsl:with-param name="nextsect3" select="$nextsect3"/>
566 <axsl:with-param name="nextsect2" select="$nextsect2"/>
567 <axsl:with-param name="nextsect1" select="$nextsect1"/>
568 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
569 <axsl:with-param name="nextbook" select="$nextbook"/>
570 <axsl:with-param name="sect5s" select="$sect5s"/>
571 <axsl:with-param name="sect4s" select="$sect4s"/>
572 <axsl:with-param name="sect3s" select="$sect3s"/>
573 <axsl:with-param name="sect2s" select="$sect2s"/>
574 <axsl:with-param name="sect1s" select="$sect1s"/>
575 <axsl:with-param name="book-components" select="$book-components"/>
576 </axsl:apply-templates>
580 <axsl:call-template name="copy"/>
581 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect5">
582 <axsl:with-param name="nextsect4" select="$nextsect4"/>
583 <axsl:with-param name="nextsect3" select="$nextsect3"/>
584 <axsl:with-param name="nextsect2" select="$nextsect2"/>
585 <axsl:with-param name="nextsect1" select="$nextsect1"/>
586 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
587 <axsl:with-param name="nextbook" select="$nextbook"/>
588 <axsl:with-param name="sect5s" select="$sect5s"/>
589 <axsl:with-param name="sect4s" select="$sect4s"/>
590 <axsl:with-param name="sect3s" select="$sect3s"/>
591 <axsl:with-param name="sect2s" select="$sect2s"/>
592 <axsl:with-param name="sect1s" select="$sect1s"/>
593 <axsl:with-param name="book-components" select="$book-components"/>
594 </axsl:apply-templates>
598 <axsl:template match="dbk:para" mode="toplevel-sect1">
599 <axsl:param name="nexttoplevel-component" select="/.."/>
600 <axsl:param select="/.." name="sect1s"/>
602 <axsl:when test="generate-id() = generate-id($nexttoplevel-component)"/>
603 <axsl:when test="@rnd:style = "d:sect1" or @rnd:style = "sect1-title"">
604 <axsl:variable name="nextsect1" select="following-sibling::dbk:para[@rnd:style = "d:sect1" or @rnd:style = "sect1-title"][1]"/>
606 <axsl:when test="$nextsect1">
607 <axsl:variable name="sect2s" select="$nextsect1/preceding-sibling::dbk:para[@rnd:style = "d:sect2" or @rnd:style = "sect2-title"]"/>
608 <!-- mode sections 1 -->
609 <sect1 xmlns="http://docbook.org/ns/docbook">
610 <axsl:call-template name="copy"/>
611 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect2">
612 <axsl:with-param name="nextsect1" select="$nextsect1"/>
613 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
614 <axsl:with-param name="sect2s" select="$sect2s"/>
615 <axsl:with-param name="sect1s" select="$sect1s"/>
616 </axsl:apply-templates>
618 <axsl:if test="count($sect1s|$nextsect1) = count($sect1s)">
619 <axsl:apply-templates select="$nextsect1" mode="toplevel-sect1">
620 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
621 <axsl:with-param name="sect1s" select="$sect1s"/>
622 </axsl:apply-templates>
626 <axsl:variable name="sect2s" select="following-sibling::dbk:para[@rnd:style = "d:sect2" or @rnd:style = "sect2-title"]"/>
627 <!-- mode sections 2 -->
628 <sect1 xmlns="http://docbook.org/ns/docbook">
629 <axsl:call-template name="copy"/>
630 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect2">
631 <axsl:with-param name="nextsect1" select="$nextsect1"/>
632 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
633 <axsl:with-param name="sect2s" select="$sect2s"/>
634 <axsl:with-param name="sect1s" select="$sect1s"/>
635 </axsl:apply-templates>
637 <axsl:if test="count($sect1s|$nextsect1) = count($sect1s)">
638 <axsl:apply-templates select="$nextsect1" mode="toplevel-sect1">
639 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
640 <axsl:with-param name="sect1s" select="$sect1s"/>
641 </axsl:apply-templates>
647 <axsl:call-template name="copy"/>
648 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect1">
649 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
650 <axsl:with-param name="sect1s" select="$sect1s"/>
651 </axsl:apply-templates>
655 <axsl:template match="dbk:para" mode="toplevel-sect2">
656 <axsl:param name="nextsect1" select="/.."/>
657 <axsl:param name="nexttoplevel-component" select="/.."/>
658 <axsl:param select="/.." name="sect2s"/>
659 <axsl:param select="/.." name="sect1s"/>
661 <axsl:when test="generate-id() = generate-id($nextsect1)"/>
662 <axsl:when test="generate-id() = generate-id($nexttoplevel-component)"/>
663 <axsl:when test="@rnd:style = "d:sect2" or @rnd:style = "sect2-title"">
664 <axsl:variable name="nextsect2" select="following-sibling::dbk:para[@rnd:style = "d:sect2" or @rnd:style = "sect2-title"][1]"/>
666 <axsl:when test="$nextsect2">
667 <axsl:variable name="sect3s" select="$nextsect2/preceding-sibling::dbk:para[@rnd:style = "d:sect3" or @rnd:style = "sect3-title"]"/>
668 <!-- mode sections 1 -->
669 <sect2 xmlns="http://docbook.org/ns/docbook">
670 <axsl:call-template name="copy"/>
671 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect3">
672 <axsl:with-param name="nextsect2" select="$nextsect2"/>
673 <axsl:with-param name="nextsect1" select="$nextsect1"/>
674 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
675 <axsl:with-param name="sect3s" select="$sect3s"/>
676 <axsl:with-param name="sect2s" select="$sect2s"/>
677 <axsl:with-param name="sect1s" select="$sect1s"/>
678 </axsl:apply-templates>
680 <axsl:if test="$nextsect2 and (not($sect1s) or count($sect2s|$nextsect2) = count($sect2s))">
681 <axsl:apply-templates select="$nextsect2" mode="toplevel-sect2">
682 <axsl:with-param name="nextsect1" select="$nextsect1"/>
683 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
684 <axsl:with-param name="sect2s" select="$sect2s"/>
685 <axsl:with-param name="sect1s" select="$sect1s"/>
686 </axsl:apply-templates>
690 <axsl:variable name="sect3s" select="following-sibling::dbk:para[@rnd:style = "d:sect3" or @rnd:style = "sect3-title"]"/>
691 <!-- mode sections 2 -->
692 <sect2 xmlns="http://docbook.org/ns/docbook">
693 <axsl:call-template name="copy"/>
694 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect3">
695 <axsl:with-param name="nextsect2" select="$nextsect2"/>
696 <axsl:with-param name="nextsect1" select="$nextsect1"/>
697 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
698 <axsl:with-param name="sect3s" select="$sect3s"/>
699 <axsl:with-param name="sect2s" select="$sect2s"/>
700 <axsl:with-param name="sect1s" select="$sect1s"/>
701 </axsl:apply-templates>
703 <axsl:if test="$nextsect2 and (not($sect1s) or count($sect2s|$nextsect2) = count($sect2s))">
704 <axsl:apply-templates select="$nextsect2" mode="toplevel-sect2">
705 <axsl:with-param name="nextsect1" select="$nextsect1"/>
706 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
707 <axsl:with-param name="sect2s" select="$sect2s"/>
708 <axsl:with-param name="sect1s" select="$sect1s"/>
709 </axsl:apply-templates>
715 <axsl:call-template name="copy"/>
716 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect2">
717 <axsl:with-param name="nextsect1" select="$nextsect1"/>
718 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
719 <axsl:with-param name="sect2s" select="$sect2s"/>
720 <axsl:with-param name="sect1s" select="$sect1s"/>
721 </axsl:apply-templates>
725 <axsl:template match="dbk:para" mode="toplevel-sect3">
726 <axsl:param name="nextsect2" select="/.."/>
727 <axsl:param name="nextsect1" select="/.."/>
728 <axsl:param name="nexttoplevel-component" select="/.."/>
729 <axsl:param select="/.." name="sect3s"/>
730 <axsl:param select="/.." name="sect2s"/>
731 <axsl:param select="/.." name="sect1s"/>
733 <axsl:when test="generate-id() = generate-id($nextsect2)"/>
734 <axsl:when test="generate-id() = generate-id($nextsect1)"/>
735 <axsl:when test="generate-id() = generate-id($nexttoplevel-component)"/>
736 <axsl:when test="@rnd:style = "d:sect3" or @rnd:style = "sect3-title"">
737 <axsl:variable name="nextsect3" select="following-sibling::dbk:para[@rnd:style = "d:sect3" or @rnd:style = "sect3-title"][1]"/>
739 <axsl:when test="$nextsect3">
740 <axsl:variable name="sect4s" select="$nextsect3/preceding-sibling::dbk:para[@rnd:style = "d:sect4" or @rnd:style = "sect4-title"]"/>
741 <!-- mode sections 1 -->
742 <sect3 xmlns="http://docbook.org/ns/docbook">
743 <axsl:call-template name="copy"/>
744 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect4">
745 <axsl:with-param name="nextsect3" select="$nextsect3"/>
746 <axsl:with-param name="nextsect2" select="$nextsect2"/>
747 <axsl:with-param name="nextsect1" select="$nextsect1"/>
748 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
749 <axsl:with-param name="sect4s" select="$sect4s"/>
750 <axsl:with-param name="sect3s" select="$sect3s"/>
751 <axsl:with-param name="sect2s" select="$sect2s"/>
752 <axsl:with-param name="sect1s" select="$sect1s"/>
753 </axsl:apply-templates>
755 <axsl:if test="$nextsect3 and (not($sect2s) or count($sect3s|$nextsect3) = count($sect3s))">
756 <axsl:apply-templates select="$nextsect3" mode="toplevel-sect3">
757 <axsl:with-param name="nextsect2" select="$nextsect2"/>
758 <axsl:with-param name="nextsect1" select="$nextsect1"/>
759 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
760 <axsl:with-param name="sect3s" select="$sect3s"/>
761 <axsl:with-param name="sect2s" select="$sect2s"/>
762 <axsl:with-param name="sect1s" select="$sect1s"/>
763 </axsl:apply-templates>
767 <axsl:variable name="sect4s" select="following-sibling::dbk:para[@rnd:style = "d:sect4" or @rnd:style = "sect4-title"]"/>
768 <!-- mode sections 2 -->
769 <sect3 xmlns="http://docbook.org/ns/docbook">
770 <axsl:call-template name="copy"/>
771 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect4">
772 <axsl:with-param name="nextsect3" select="$nextsect3"/>
773 <axsl:with-param name="nextsect2" select="$nextsect2"/>
774 <axsl:with-param name="nextsect1" select="$nextsect1"/>
775 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
776 <axsl:with-param name="sect4s" select="$sect4s"/>
777 <axsl:with-param name="sect3s" select="$sect3s"/>
778 <axsl:with-param name="sect2s" select="$sect2s"/>
779 <axsl:with-param name="sect1s" select="$sect1s"/>
780 </axsl:apply-templates>
782 <axsl:if test="$nextsect3 and (not($sect2s) or count($sect3s|$nextsect3) = count($sect3s))">
783 <axsl:apply-templates select="$nextsect3" mode="toplevel-sect3">
784 <axsl:with-param name="nextsect2" select="$nextsect2"/>
785 <axsl:with-param name="nextsect1" select="$nextsect1"/>
786 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
787 <axsl:with-param name="sect3s" select="$sect3s"/>
788 <axsl:with-param name="sect2s" select="$sect2s"/>
789 <axsl:with-param name="sect1s" select="$sect1s"/>
790 </axsl:apply-templates>
796 <axsl:call-template name="copy"/>
797 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect3">
798 <axsl:with-param name="nextsect2" select="$nextsect2"/>
799 <axsl:with-param name="nextsect1" select="$nextsect1"/>
800 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
801 <axsl:with-param name="sect3s" select="$sect3s"/>
802 <axsl:with-param name="sect2s" select="$sect2s"/>
803 <axsl:with-param name="sect1s" select="$sect1s"/>
804 </axsl:apply-templates>
808 <axsl:template match="dbk:para" mode="toplevel-sect4">
809 <axsl:param name="nextsect3" select="/.."/>
810 <axsl:param name="nextsect2" select="/.."/>
811 <axsl:param name="nextsect1" select="/.."/>
812 <axsl:param name="nexttoplevel-component" select="/.."/>
813 <axsl:param select="/.." name="sect4s"/>
814 <axsl:param select="/.." name="sect3s"/>
815 <axsl:param select="/.." name="sect2s"/>
816 <axsl:param select="/.." name="sect1s"/>
818 <axsl:when test="generate-id() = generate-id($nextsect3)"/>
819 <axsl:when test="generate-id() = generate-id($nextsect2)"/>
820 <axsl:when test="generate-id() = generate-id($nextsect1)"/>
821 <axsl:when test="generate-id() = generate-id($nexttoplevel-component)"/>
822 <axsl:when test="@rnd:style = "d:sect4" or @rnd:style = "sect4-title"">
823 <axsl:variable name="nextsect4" select="following-sibling::dbk:para[@rnd:style = "d:sect4" or @rnd:style = "sect4-title"][1]"/>
825 <axsl:when test="$nextsect4">
826 <axsl:variable name="sect5s" select="$nextsect4/preceding-sibling::dbk:para[@rnd:style = "d:sect5" or @rnd:style = "sect5-title"]"/>
827 <!-- mode sections 1 -->
828 <sect4 xmlns="http://docbook.org/ns/docbook">
829 <axsl:call-template name="copy"/>
830 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect5">
831 <axsl:with-param name="nextsect4" select="$nextsect4"/>
832 <axsl:with-param name="nextsect3" select="$nextsect3"/>
833 <axsl:with-param name="nextsect2" select="$nextsect2"/>
834 <axsl:with-param name="nextsect1" select="$nextsect1"/>
835 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
836 <axsl:with-param name="sect5s" select="$sect5s"/>
837 <axsl:with-param name="sect4s" select="$sect4s"/>
838 <axsl:with-param name="sect3s" select="$sect3s"/>
839 <axsl:with-param name="sect2s" select="$sect2s"/>
840 <axsl:with-param name="sect1s" select="$sect1s"/>
841 </axsl:apply-templates>
843 <axsl:if test="$nextsect4 and (not($sect3s) or count($sect4s|$nextsect4) = count($sect4s))">
844 <axsl:apply-templates select="$nextsect4" mode="toplevel-sect4">
845 <axsl:with-param name="nextsect3" select="$nextsect3"/>
846 <axsl:with-param name="nextsect2" select="$nextsect2"/>
847 <axsl:with-param name="nextsect1" select="$nextsect1"/>
848 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
849 <axsl:with-param name="sect4s" select="$sect4s"/>
850 <axsl:with-param name="sect3s" select="$sect3s"/>
851 <axsl:with-param name="sect2s" select="$sect2s"/>
852 <axsl:with-param name="sect1s" select="$sect1s"/>
853 </axsl:apply-templates>
857 <axsl:variable name="sect5s" select="following-sibling::dbk:para[@rnd:style = "d:sect5" or @rnd:style = "sect5-title"]"/>
858 <!-- mode sections 2 -->
859 <sect4 xmlns="http://docbook.org/ns/docbook">
860 <axsl:call-template name="copy"/>
861 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect5">
862 <axsl:with-param name="nextsect4" select="$nextsect4"/>
863 <axsl:with-param name="nextsect3" select="$nextsect3"/>
864 <axsl:with-param name="nextsect2" select="$nextsect2"/>
865 <axsl:with-param name="nextsect1" select="$nextsect1"/>
866 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
867 <axsl:with-param name="sect5s" select="$sect5s"/>
868 <axsl:with-param name="sect4s" select="$sect4s"/>
869 <axsl:with-param name="sect3s" select="$sect3s"/>
870 <axsl:with-param name="sect2s" select="$sect2s"/>
871 <axsl:with-param name="sect1s" select="$sect1s"/>
872 </axsl:apply-templates>
874 <axsl:if test="$nextsect4 and (not($sect3s) or count($sect4s|$nextsect4) = count($sect4s))">
875 <axsl:apply-templates select="$nextsect4" mode="toplevel-sect4">
876 <axsl:with-param name="nextsect3" select="$nextsect3"/>
877 <axsl:with-param name="nextsect2" select="$nextsect2"/>
878 <axsl:with-param name="nextsect1" select="$nextsect1"/>
879 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
880 <axsl:with-param name="sect4s" select="$sect4s"/>
881 <axsl:with-param name="sect3s" select="$sect3s"/>
882 <axsl:with-param name="sect2s" select="$sect2s"/>
883 <axsl:with-param name="sect1s" select="$sect1s"/>
884 </axsl:apply-templates>
890 <axsl:call-template name="copy"/>
891 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect4">
892 <axsl:with-param name="nextsect3" select="$nextsect3"/>
893 <axsl:with-param name="nextsect2" select="$nextsect2"/>
894 <axsl:with-param name="nextsect1" select="$nextsect1"/>
895 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
896 <axsl:with-param name="sect4s" select="$sect4s"/>
897 <axsl:with-param name="sect3s" select="$sect3s"/>
898 <axsl:with-param name="sect2s" select="$sect2s"/>
899 <axsl:with-param name="sect1s" select="$sect1s"/>
900 </axsl:apply-templates>
904 <axsl:template match="dbk:para" mode="toplevel-sect5">
905 <axsl:param name="nextsect4" select="/.."/>
906 <axsl:param name="nextsect3" select="/.."/>
907 <axsl:param name="nextsect2" select="/.."/>
908 <axsl:param name="nextsect1" select="/.."/>
909 <axsl:param name="nexttoplevel-component" select="/.."/>
910 <axsl:param select="/.." name="sect5s"/>
911 <axsl:param select="/.." name="sect4s"/>
912 <axsl:param select="/.." name="sect3s"/>
913 <axsl:param select="/.." name="sect2s"/>
914 <axsl:param select="/.." name="sect1s"/>
916 <axsl:when test="generate-id() = generate-id($nextsect4)"/>
917 <axsl:when test="generate-id() = generate-id($nextsect3)"/>
918 <axsl:when test="generate-id() = generate-id($nextsect2)"/>
919 <axsl:when test="generate-id() = generate-id($nextsect1)"/>
920 <axsl:when test="generate-id() = generate-id($nexttoplevel-component)"/>
921 <axsl:when test="@rnd:style = "d:sect5" or @rnd:style = "sect5-title"">
922 <axsl:variable name="nextsect5" select="following-sibling::dbk:para[@rnd:style = "d:sect5" or @rnd:style = "sect5-title"][1]"/>
923 <!-- mode sections 3 -->
924 <sect5 xmlns="http://docbook.org/ns/docbook">
925 <axsl:call-template name="copy"/>
926 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-terminal">
927 <axsl:with-param name="nextsect5" select="$nextsect5"/>
928 <axsl:with-param name="nextsect4" select="$nextsect4"/>
929 <axsl:with-param name="nextsect3" select="$nextsect3"/>
930 <axsl:with-param name="nextsect2" select="$nextsect2"/>
931 <axsl:with-param name="nextsect1" select="$nextsect1"/>
932 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
933 <axsl:with-param name="sect5s" select="$sect5s"/>
934 <axsl:with-param name="sect4s" select="$sect4s"/>
935 <axsl:with-param name="sect3s" select="$sect3s"/>
936 <axsl:with-param name="sect2s" select="$sect2s"/>
937 <axsl:with-param name="sect1s" select="$sect1s"/>
938 </axsl:apply-templates>
940 <axsl:if test="$nextsect5 and (not($sect4s) or count($sect5s|$nextsect5) = count($sect5s))">
941 <axsl:apply-templates select="$nextsect5" mode="toplevel-sect5">
942 <axsl:with-param name="nextsect4" select="$nextsect4"/>
943 <axsl:with-param name="nextsect3" select="$nextsect3"/>
944 <axsl:with-param name="nextsect2" select="$nextsect2"/>
945 <axsl:with-param name="nextsect1" select="$nextsect1"/>
946 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
947 <axsl:with-param name="sect5s" select="$sect5s"/>
948 <axsl:with-param name="sect4s" select="$sect4s"/>
949 <axsl:with-param name="sect3s" select="$sect3s"/>
950 <axsl:with-param name="sect2s" select="$sect2s"/>
951 <axsl:with-param name="sect1s" select="$sect1s"/>
952 </axsl:apply-templates>
956 <axsl:call-template name="copy"/>
957 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect5">
958 <axsl:with-param name="nextsect4" select="$nextsect4"/>
959 <axsl:with-param name="nextsect3" select="$nextsect3"/>
960 <axsl:with-param name="nextsect2" select="$nextsect2"/>
961 <axsl:with-param name="nextsect1" select="$nextsect1"/>
962 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
963 <axsl:with-param name="sect5s" select="$sect5s"/>
964 <axsl:with-param name="sect4s" select="$sect4s"/>
965 <axsl:with-param name="sect3s" select="$sect3s"/>
966 <axsl:with-param name="sect2s" select="$sect2s"/>
967 <axsl:with-param name="sect1s" select="$sect1s"/>
968 </axsl:apply-templates>
972 <axsl:template match="dbk:para" mode="book-terminal">
973 <axsl:param name="nextsect5" select="/.."/>
974 <axsl:param name="nextsect4" select="/.."/>
975 <axsl:param name="nextsect3" select="/.."/>
976 <axsl:param name="nextsect2" select="/.."/>
977 <axsl:param name="nextsect1" select="/.."/>
978 <axsl:param name="nextbook-component" select="/.."/>
979 <axsl:param name="nextbook" select="/.."/>
980 <axsl:param select="/.." name="sect5s"/>
981 <axsl:param select="/.." name="sect4s"/>
982 <axsl:param select="/.." name="sect3s"/>
983 <axsl:param select="/.." name="sect2s"/>
984 <axsl:param select="/.." name="sect1s"/>
985 <axsl:param select="/.." name="book-components"/>
987 <axsl:when test="generate-id() = generate-id($nextsect5)"/>
988 <axsl:when test="generate-id() = generate-id($nextsect4)"/>
989 <axsl:when test="generate-id() = generate-id($nextsect3)"/>
990 <axsl:when test="generate-id() = generate-id($nextsect2)"/>
991 <axsl:when test="generate-id() = generate-id($nextsect1)"/>
992 <axsl:when test="generate-id() = generate-id($nextbook-component)"/>
993 <axsl:when test="generate-id() = generate-id($nextbook)"/>
995 <axsl:call-template name="copy"/>
996 <axsl:apply-templates select="following-sibling::*[1]" mode="book-terminal">
997 <axsl:with-param name="nextsect5" select="$nextsect5"/>
998 <axsl:with-param name="nextsect4" select="$nextsect4"/>
999 <axsl:with-param name="nextsect3" select="$nextsect3"/>
1000 <axsl:with-param name="nextsect2" select="$nextsect2"/>
1001 <axsl:with-param name="nextsect1" select="$nextsect1"/>
1002 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
1003 <axsl:with-param name="nextbook" select="$nextbook"/>
1004 <axsl:with-param name="sect5s" select="$sect5s"/>
1005 <axsl:with-param name="sect4s" select="$sect4s"/>
1006 <axsl:with-param name="sect3s" select="$sect3s"/>
1007 <axsl:with-param name="sect2s" select="$sect2s"/>
1008 <axsl:with-param name="sect1s" select="$sect1s"/>
1009 <axsl:with-param name="book-components" select="$book-components"/>
1010 </axsl:apply-templates>
1014 <axsl:template match="dbk:para" mode="toplevel-terminal">
1015 <axsl:param name="nextsect5" select="/.."/>
1016 <axsl:param name="nextsect4" select="/.."/>
1017 <axsl:param name="nextsect3" select="/.."/>
1018 <axsl:param name="nextsect2" select="/.."/>
1019 <axsl:param name="nextsect1" select="/.."/>
1020 <axsl:param name="nexttoplevel-component" select="/.."/>
1021 <axsl:param select="/.." name="sect5s"/>
1022 <axsl:param select="/.." name="sect4s"/>
1023 <axsl:param select="/.." name="sect3s"/>
1024 <axsl:param select="/.." name="sect2s"/>
1025 <axsl:param select="/.." name="sect1s"/>
1027 <axsl:when test="generate-id() = generate-id($nextsect5)"/>
1028 <axsl:when test="generate-id() = generate-id($nextsect4)"/>
1029 <axsl:when test="generate-id() = generate-id($nextsect3)"/>
1030 <axsl:when test="generate-id() = generate-id($nextsect2)"/>
1031 <axsl:when test="generate-id() = generate-id($nextsect1)"/>
1032 <axsl:when test="generate-id() = generate-id($nexttoplevel-component)"/>
1034 <axsl:call-template name="copy"/>
1035 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-terminal">
1036 <axsl:with-param name="nextsect5" select="$nextsect5"/>
1037 <axsl:with-param name="nextsect4" select="$nextsect4"/>
1038 <axsl:with-param name="nextsect3" select="$nextsect3"/>
1039 <axsl:with-param name="nextsect2" select="$nextsect2"/>
1040 <axsl:with-param name="nextsect1" select="$nextsect1"/>
1041 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
1042 <axsl:with-param name="sect5s" select="$sect5s"/>
1043 <axsl:with-param name="sect4s" select="$sect4s"/>
1044 <axsl:with-param name="sect3s" select="$sect3s"/>
1045 <axsl:with-param name="sect2s" select="$sect2s"/>
1046 <axsl:with-param name="sect1s" select="$sect1s"/>
1047 </axsl:apply-templates>
1051 <axsl:template match="*">
1052 <axsl:call-template name="copy"/>
1054 <axsl:template match="*" mode="book">
1055 <axsl:call-template name="copy"/>
1056 <axsl:apply-templates select="following-sibling::*[1]" mode="book"/>
1058 <axsl:template match="*" mode="book-component">
1059 <axsl:param name="nextbook" select="/.."/>
1060 <axsl:param select="/.." name="book-components"/>
1061 <axsl:call-template name="copy"/>
1062 <axsl:apply-templates select="following-sibling::*[1]" mode="book-component">
1063 <axsl:with-param name="nextbook" select="$nextbook"/>
1064 <axsl:with-param name="book-components" select="$book-components"/>
1065 </axsl:apply-templates>
1067 <axsl:template match="*" mode="book-sect1">
1068 <axsl:param name="nextbook-component" select="/.."/>
1069 <axsl:param name="nextbook" select="/.."/>
1070 <axsl:param select="/.." name="sect1s"/>
1071 <axsl:param select="/.." name="book-components"/>
1072 <axsl:call-template name="copy"/>
1073 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect1">
1074 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
1075 <axsl:with-param name="nextbook" select="$nextbook"/>
1076 <axsl:with-param name="sect1s" select="$sect1s"/>
1077 <axsl:with-param name="book-components" select="$book-components"/>
1078 </axsl:apply-templates>
1080 <axsl:template match="*" mode="book-sect2">
1081 <axsl:param name="nextsect1" select="/.."/>
1082 <axsl:param name="nextbook-component" select="/.."/>
1083 <axsl:param name="nextbook" select="/.."/>
1084 <axsl:param select="/.." name="sect2s"/>
1085 <axsl:param select="/.." name="sect1s"/>
1086 <axsl:param select="/.." name="book-components"/>
1087 <axsl:call-template name="copy"/>
1088 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect2">
1089 <axsl:with-param name="nextsect1" select="$nextsect1"/>
1090 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
1091 <axsl:with-param name="nextbook" select="$nextbook"/>
1092 <axsl:with-param name="sect2s" select="$sect2s"/>
1093 <axsl:with-param name="sect1s" select="$sect1s"/>
1094 <axsl:with-param name="book-components" select="$book-components"/>
1095 </axsl:apply-templates>
1097 <axsl:template match="*" mode="book-sect3">
1098 <axsl:param name="nextsect2" select="/.."/>
1099 <axsl:param name="nextsect1" select="/.."/>
1100 <axsl:param name="nextbook-component" select="/.."/>
1101 <axsl:param name="nextbook" select="/.."/>
1102 <axsl:param select="/.." name="sect3s"/>
1103 <axsl:param select="/.." name="sect2s"/>
1104 <axsl:param select="/.." name="sect1s"/>
1105 <axsl:param select="/.." name="book-components"/>
1106 <axsl:call-template name="copy"/>
1107 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect3">
1108 <axsl:with-param name="nextsect2" select="$nextsect2"/>
1109 <axsl:with-param name="nextsect1" select="$nextsect1"/>
1110 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
1111 <axsl:with-param name="nextbook" select="$nextbook"/>
1112 <axsl:with-param name="sect3s" select="$sect3s"/>
1113 <axsl:with-param name="sect2s" select="$sect2s"/>
1114 <axsl:with-param name="sect1s" select="$sect1s"/>
1115 <axsl:with-param name="book-components" select="$book-components"/>
1116 </axsl:apply-templates>
1118 <axsl:template match="*" mode="book-sect4">
1119 <axsl:param name="nextsect3" select="/.."/>
1120 <axsl:param name="nextsect2" select="/.."/>
1121 <axsl:param name="nextsect1" select="/.."/>
1122 <axsl:param name="nextbook-component" select="/.."/>
1123 <axsl:param name="nextbook" select="/.."/>
1124 <axsl:param select="/.." name="sect4s"/>
1125 <axsl:param select="/.." name="sect3s"/>
1126 <axsl:param select="/.." name="sect2s"/>
1127 <axsl:param select="/.." name="sect1s"/>
1128 <axsl:param select="/.." name="book-components"/>
1129 <axsl:call-template name="copy"/>
1130 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect4">
1131 <axsl:with-param name="nextsect3" select="$nextsect3"/>
1132 <axsl:with-param name="nextsect2" select="$nextsect2"/>
1133 <axsl:with-param name="nextsect1" select="$nextsect1"/>
1134 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
1135 <axsl:with-param name="nextbook" select="$nextbook"/>
1136 <axsl:with-param name="sect4s" select="$sect4s"/>
1137 <axsl:with-param name="sect3s" select="$sect3s"/>
1138 <axsl:with-param name="sect2s" select="$sect2s"/>
1139 <axsl:with-param name="sect1s" select="$sect1s"/>
1140 <axsl:with-param name="book-components" select="$book-components"/>
1141 </axsl:apply-templates>
1143 <axsl:template match="*" mode="book-sect5">
1144 <axsl:param name="nextsect4" select="/.."/>
1145 <axsl:param name="nextsect3" select="/.."/>
1146 <axsl:param name="nextsect2" select="/.."/>
1147 <axsl:param name="nextsect1" select="/.."/>
1148 <axsl:param name="nextbook-component" select="/.."/>
1149 <axsl:param name="nextbook" select="/.."/>
1150 <axsl:param select="/.." name="sect5s"/>
1151 <axsl:param select="/.." name="sect4s"/>
1152 <axsl:param select="/.." name="sect3s"/>
1153 <axsl:param select="/.." name="sect2s"/>
1154 <axsl:param select="/.." name="sect1s"/>
1155 <axsl:param select="/.." name="book-components"/>
1156 <axsl:call-template name="copy"/>
1157 <axsl:apply-templates select="following-sibling::*[1]" mode="book-sect5">
1158 <axsl:with-param name="nextsect4" select="$nextsect4"/>
1159 <axsl:with-param name="nextsect3" select="$nextsect3"/>
1160 <axsl:with-param name="nextsect2" select="$nextsect2"/>
1161 <axsl:with-param name="nextsect1" select="$nextsect1"/>
1162 <axsl:with-param name="nextbook-component" select="$nextbook-component"/>
1163 <axsl:with-param name="nextbook" select="$nextbook"/>
1164 <axsl:with-param name="sect5s" select="$sect5s"/>
1165 <axsl:with-param name="sect4s" select="$sect4s"/>
1166 <axsl:with-param name="sect3s" select="$sect3s"/>
1167 <axsl:with-param name="sect2s" select="$sect2s"/>
1168 <axsl:with-param name="sect1s" select="$sect1s"/>
1169 <axsl:with-param name="book-components" select="$book-components"/>
1170 </axsl:apply-templates>
1172 <axsl:template match="*" mode="toplevel-component">
1173 <axsl:call-template name="copy"/>
1174 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-component"/>
1176 <axsl:template match="*" mode="toplevel-sect1">
1177 <axsl:param name="nexttoplevel-component" select="/.."/>
1178 <axsl:param select="/.." name="sect1s"/>
1179 <axsl:call-template name="copy"/>
1180 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect1">
1181 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
1182 <axsl:with-param name="sect1s" select="$sect1s"/>
1183 </axsl:apply-templates>
1185 <axsl:template match="*" mode="toplevel-sect2">
1186 <axsl:param name="nextsect1" select="/.."/>
1187 <axsl:param name="nexttoplevel-component" select="/.."/>
1188 <axsl:param select="/.." name="sect2s"/>
1189 <axsl:param select="/.." name="sect1s"/>
1190 <axsl:call-template name="copy"/>
1191 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect2">
1192 <axsl:with-param name="nextsect1" select="$nextsect1"/>
1193 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
1194 <axsl:with-param name="sect2s" select="$sect2s"/>
1195 <axsl:with-param name="sect1s" select="$sect1s"/>
1196 </axsl:apply-templates>
1198 <axsl:template match="*" mode="toplevel-sect3">
1199 <axsl:param name="nextsect2" select="/.."/>
1200 <axsl:param name="nextsect1" select="/.."/>
1201 <axsl:param name="nexttoplevel-component" select="/.."/>
1202 <axsl:param select="/.." name="sect3s"/>
1203 <axsl:param select="/.." name="sect2s"/>
1204 <axsl:param select="/.." name="sect1s"/>
1205 <axsl:call-template name="copy"/>
1206 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect3">
1207 <axsl:with-param name="nextsect2" select="$nextsect2"/>
1208 <axsl:with-param name="nextsect1" select="$nextsect1"/>
1209 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
1210 <axsl:with-param name="sect3s" select="$sect3s"/>
1211 <axsl:with-param name="sect2s" select="$sect2s"/>
1212 <axsl:with-param name="sect1s" select="$sect1s"/>
1213 </axsl:apply-templates>
1215 <axsl:template match="*" mode="toplevel-sect4">
1216 <axsl:param name="nextsect3" select="/.."/>
1217 <axsl:param name="nextsect2" select="/.."/>
1218 <axsl:param name="nextsect1" select="/.."/>
1219 <axsl:param name="nexttoplevel-component" select="/.."/>
1220 <axsl:param select="/.." name="sect4s"/>
1221 <axsl:param select="/.." name="sect3s"/>
1222 <axsl:param select="/.." name="sect2s"/>
1223 <axsl:param select="/.." name="sect1s"/>
1224 <axsl:call-template name="copy"/>
1225 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect4">
1226 <axsl:with-param name="nextsect3" select="$nextsect3"/>
1227 <axsl:with-param name="nextsect2" select="$nextsect2"/>
1228 <axsl:with-param name="nextsect1" select="$nextsect1"/>
1229 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
1230 <axsl:with-param name="sect4s" select="$sect4s"/>
1231 <axsl:with-param name="sect3s" select="$sect3s"/>
1232 <axsl:with-param name="sect2s" select="$sect2s"/>
1233 <axsl:with-param name="sect1s" select="$sect1s"/>
1234 </axsl:apply-templates>
1236 <axsl:template match="*" mode="toplevel-sect5">
1237 <axsl:param name="nextsect4" select="/.."/>
1238 <axsl:param name="nextsect3" select="/.."/>
1239 <axsl:param name="nextsect2" select="/.."/>
1240 <axsl:param name="nextsect1" select="/.."/>
1241 <axsl:param name="nexttoplevel-component" select="/.."/>
1242 <axsl:param select="/.." name="sect5s"/>
1243 <axsl:param select="/.." name="sect4s"/>
1244 <axsl:param select="/.." name="sect3s"/>
1245 <axsl:param select="/.." name="sect2s"/>
1246 <axsl:param select="/.." name="sect1s"/>
1247 <axsl:call-template name="copy"/>
1248 <axsl:apply-templates select="following-sibling::*[1]" mode="toplevel-sect5">
1249 <axsl:with-param name="nextsect4" select="$nextsect4"/>
1250 <axsl:with-param name="nextsect3" select="$nextsect3"/>
1251 <axsl:with-param name="nextsect2" select="$nextsect2"/>
1252 <axsl:with-param name="nextsect1" select="$nextsect1"/>
1253 <axsl:with-param name="nexttoplevel-component" select="$nexttoplevel-component"/>
1254 <axsl:with-param name="sect5s" select="$sect5s"/>
1255 <axsl:with-param name="sect4s" select="$sect4s"/>
1256 <axsl:with-param name="sect3s" select="$sect3s"/>
1257 <axsl:with-param name="sect2s" select="$sect2s"/>
1258 <axsl:with-param name="sect1s" select="$sect1s"/>
1259 </axsl:apply-templates>
1261 <axsl:template name="copy">
1263 <axsl:for-each select="@*">
1266 <axsl:apply-templates/>