Imported Upstream version 1.77.1
[platform/upstream/docbook-xsl.git] / html / titlepage.templates.xsl
1 <?xml version="1.0"?>
2
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" version="1.0" exclude-result-prefixes="exsl">
4
5 <!-- This stylesheet was created by template/titlepage.xsl-->
6
7 <xsl:template name="article.titlepage.recto">
8   <xsl:choose>
9     <xsl:when test="articleinfo/title">
10       <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/title"/>
11     </xsl:when>
12     <xsl:when test="artheader/title">
13       <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/title"/>
14     </xsl:when>
15     <xsl:when test="info/title">
16       <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/title"/>
17     </xsl:when>
18     <xsl:when test="title">
19       <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="title"/>
20     </xsl:when>
21   </xsl:choose>
22
23   <xsl:choose>
24     <xsl:when test="articleinfo/subtitle">
25       <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/subtitle"/>
26     </xsl:when>
27     <xsl:when test="artheader/subtitle">
28       <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/subtitle"/>
29     </xsl:when>
30     <xsl:when test="info/subtitle">
31       <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/subtitle"/>
32     </xsl:when>
33     <xsl:when test="subtitle">
34       <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="subtitle"/>
35     </xsl:when>
36   </xsl:choose>
37
38   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/corpauthor"/>
39   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/corpauthor"/>
40   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/corpauthor"/>
41   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/authorgroup"/>
42   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/authorgroup"/>
43   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/authorgroup"/>
44   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/author"/>
45   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/author"/>
46   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/author"/>
47   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/othercredit"/>
48   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/othercredit"/>
49   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/othercredit"/>
50   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/releaseinfo"/>
51   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/releaseinfo"/>
52   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/releaseinfo"/>
53   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/copyright"/>
54   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/copyright"/>
55   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/copyright"/>
56   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/legalnotice"/>
57   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/legalnotice"/>
58   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/legalnotice"/>
59   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/pubdate"/>
60   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/pubdate"/>
61   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/pubdate"/>
62   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revision"/>
63   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/revision"/>
64   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/revision"/>
65   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revhistory"/>
66   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/revhistory"/>
67   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/revhistory"/>
68   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/abstract"/>
69   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/abstract"/>
70   <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/abstract"/>
71 </xsl:template>
72
73 <xsl:template name="article.titlepage.verso">
74 </xsl:template>
75
76 <xsl:template name="article.titlepage.separator"><hr/>
77 </xsl:template>
78
79 <xsl:template name="article.titlepage.before.recto">
80 </xsl:template>
81
82 <xsl:template name="article.titlepage.before.verso">
83 </xsl:template>
84
85 <xsl:template name="article.titlepage">
86   <div class="titlepage">
87     <xsl:variable name="recto.content">
88       <xsl:call-template name="article.titlepage.before.recto"/>
89       <xsl:call-template name="article.titlepage.recto"/>
90     </xsl:variable>
91     <xsl:variable name="recto.elements.count">
92       <xsl:choose>
93         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
94         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
95           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
96         <xsl:otherwise>1</xsl:otherwise>
97       </xsl:choose>
98     </xsl:variable>
99     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
100       <div><xsl:copy-of select="$recto.content"/></div>
101     </xsl:if>
102     <xsl:variable name="verso.content">
103       <xsl:call-template name="article.titlepage.before.verso"/>
104       <xsl:call-template name="article.titlepage.verso"/>
105     </xsl:variable>
106     <xsl:variable name="verso.elements.count">
107       <xsl:choose>
108         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
109         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
110           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
111         <xsl:otherwise>1</xsl:otherwise>
112       </xsl:choose>
113     </xsl:variable>
114     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
115       <div><xsl:copy-of select="$verso.content"/></div>
116     </xsl:if>
117     <xsl:call-template name="article.titlepage.separator"/>
118   </div>
119 </xsl:template>
120
121 <xsl:template match="*" mode="article.titlepage.recto.mode">
122   <!-- if an element isn't found in this mode, -->
123   <!-- try the generic titlepage.mode -->
124   <xsl:apply-templates select="." mode="titlepage.mode"/>
125 </xsl:template>
126
127 <xsl:template match="*" mode="article.titlepage.verso.mode">
128   <!-- if an element isn't found in this mode, -->
129   <!-- try the generic titlepage.mode -->
130   <xsl:apply-templates select="." mode="titlepage.mode"/>
131 </xsl:template>
132
133 <xsl:template match="title" mode="article.titlepage.recto.auto.mode">
134 <div xsl:use-attribute-sets="article.titlepage.recto.style">
135 <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
136 </div>
137 </xsl:template>
138
139 <xsl:template match="subtitle" mode="article.titlepage.recto.auto.mode">
140 <div xsl:use-attribute-sets="article.titlepage.recto.style">
141 <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
142 </div>
143 </xsl:template>
144
145 <xsl:template match="corpauthor" mode="article.titlepage.recto.auto.mode">
146 <div xsl:use-attribute-sets="article.titlepage.recto.style">
147 <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
148 </div>
149 </xsl:template>
150
151 <xsl:template match="authorgroup" mode="article.titlepage.recto.auto.mode">
152 <div xsl:use-attribute-sets="article.titlepage.recto.style">
153 <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
154 </div>
155 </xsl:template>
156
157 <xsl:template match="author" mode="article.titlepage.recto.auto.mode">
158 <div xsl:use-attribute-sets="article.titlepage.recto.style">
159 <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
160 </div>
161 </xsl:template>
162
163 <xsl:template match="othercredit" mode="article.titlepage.recto.auto.mode">
164 <div xsl:use-attribute-sets="article.titlepage.recto.style">
165 <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
166 </div>
167 </xsl:template>
168
169 <xsl:template match="releaseinfo" mode="article.titlepage.recto.auto.mode">
170 <div xsl:use-attribute-sets="article.titlepage.recto.style">
171 <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
172 </div>
173 </xsl:template>
174
175 <xsl:template match="copyright" mode="article.titlepage.recto.auto.mode">
176 <div xsl:use-attribute-sets="article.titlepage.recto.style">
177 <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
178 </div>
179 </xsl:template>
180
181 <xsl:template match="legalnotice" mode="article.titlepage.recto.auto.mode">
182 <div xsl:use-attribute-sets="article.titlepage.recto.style">
183 <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
184 </div>
185 </xsl:template>
186
187 <xsl:template match="pubdate" mode="article.titlepage.recto.auto.mode">
188 <div xsl:use-attribute-sets="article.titlepage.recto.style">
189 <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
190 </div>
191 </xsl:template>
192
193 <xsl:template match="revision" mode="article.titlepage.recto.auto.mode">
194 <div xsl:use-attribute-sets="article.titlepage.recto.style">
195 <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
196 </div>
197 </xsl:template>
198
199 <xsl:template match="revhistory" mode="article.titlepage.recto.auto.mode">
200 <div xsl:use-attribute-sets="article.titlepage.recto.style">
201 <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
202 </div>
203 </xsl:template>
204
205 <xsl:template match="abstract" mode="article.titlepage.recto.auto.mode">
206 <div xsl:use-attribute-sets="article.titlepage.recto.style">
207 <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
208 </div>
209 </xsl:template>
210
211 <xsl:template name="set.titlepage.recto">
212   <xsl:choose>
213     <xsl:when test="setinfo/title">
214       <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/title"/>
215     </xsl:when>
216     <xsl:when test="info/title">
217       <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/title"/>
218     </xsl:when>
219     <xsl:when test="title">
220       <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="title"/>
221     </xsl:when>
222   </xsl:choose>
223
224   <xsl:choose>
225     <xsl:when test="setinfo/subtitle">
226       <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/subtitle"/>
227     </xsl:when>
228     <xsl:when test="info/subtitle">
229       <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/subtitle"/>
230     </xsl:when>
231     <xsl:when test="subtitle">
232       <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="subtitle"/>
233     </xsl:when>
234   </xsl:choose>
235
236   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/corpauthor"/>
237   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/corpauthor"/>
238   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/authorgroup"/>
239   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/authorgroup"/>
240   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/author"/>
241   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/author"/>
242   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/othercredit"/>
243   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/othercredit"/>
244   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/releaseinfo"/>
245   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/releaseinfo"/>
246   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/copyright"/>
247   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/copyright"/>
248   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/legalnotice"/>
249   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/legalnotice"/>
250   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/pubdate"/>
251   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/pubdate"/>
252   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/revision"/>
253   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/revision"/>
254   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/revhistory"/>
255   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/revhistory"/>
256   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/abstract"/>
257   <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/abstract"/>
258 </xsl:template>
259
260 <xsl:template name="set.titlepage.verso">
261 </xsl:template>
262
263 <xsl:template name="set.titlepage.separator"><hr/>
264 </xsl:template>
265
266 <xsl:template name="set.titlepage.before.recto">
267 </xsl:template>
268
269 <xsl:template name="set.titlepage.before.verso">
270 </xsl:template>
271
272 <xsl:template name="set.titlepage">
273   <div class="titlepage">
274     <xsl:variable name="recto.content">
275       <xsl:call-template name="set.titlepage.before.recto"/>
276       <xsl:call-template name="set.titlepage.recto"/>
277     </xsl:variable>
278     <xsl:variable name="recto.elements.count">
279       <xsl:choose>
280         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
281         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
282           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
283         <xsl:otherwise>1</xsl:otherwise>
284       </xsl:choose>
285     </xsl:variable>
286     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
287       <div><xsl:copy-of select="$recto.content"/></div>
288     </xsl:if>
289     <xsl:variable name="verso.content">
290       <xsl:call-template name="set.titlepage.before.verso"/>
291       <xsl:call-template name="set.titlepage.verso"/>
292     </xsl:variable>
293     <xsl:variable name="verso.elements.count">
294       <xsl:choose>
295         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
296         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
297           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
298         <xsl:otherwise>1</xsl:otherwise>
299       </xsl:choose>
300     </xsl:variable>
301     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
302       <div><xsl:copy-of select="$verso.content"/></div>
303     </xsl:if>
304     <xsl:call-template name="set.titlepage.separator"/>
305   </div>
306 </xsl:template>
307
308 <xsl:template match="*" mode="set.titlepage.recto.mode">
309   <!-- if an element isn't found in this mode, -->
310   <!-- try the generic titlepage.mode -->
311   <xsl:apply-templates select="." mode="titlepage.mode"/>
312 </xsl:template>
313
314 <xsl:template match="*" mode="set.titlepage.verso.mode">
315   <!-- if an element isn't found in this mode, -->
316   <!-- try the generic titlepage.mode -->
317   <xsl:apply-templates select="." mode="titlepage.mode"/>
318 </xsl:template>
319
320 <xsl:template match="title" mode="set.titlepage.recto.auto.mode">
321 <div xsl:use-attribute-sets="set.titlepage.recto.style">
322 <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
323 </div>
324 </xsl:template>
325
326 <xsl:template match="subtitle" mode="set.titlepage.recto.auto.mode">
327 <div xsl:use-attribute-sets="set.titlepage.recto.style">
328 <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
329 </div>
330 </xsl:template>
331
332 <xsl:template match="corpauthor" mode="set.titlepage.recto.auto.mode">
333 <div xsl:use-attribute-sets="set.titlepage.recto.style">
334 <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
335 </div>
336 </xsl:template>
337
338 <xsl:template match="authorgroup" mode="set.titlepage.recto.auto.mode">
339 <div xsl:use-attribute-sets="set.titlepage.recto.style">
340 <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
341 </div>
342 </xsl:template>
343
344 <xsl:template match="author" mode="set.titlepage.recto.auto.mode">
345 <div xsl:use-attribute-sets="set.titlepage.recto.style">
346 <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
347 </div>
348 </xsl:template>
349
350 <xsl:template match="othercredit" mode="set.titlepage.recto.auto.mode">
351 <div xsl:use-attribute-sets="set.titlepage.recto.style">
352 <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
353 </div>
354 </xsl:template>
355
356 <xsl:template match="releaseinfo" mode="set.titlepage.recto.auto.mode">
357 <div xsl:use-attribute-sets="set.titlepage.recto.style">
358 <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
359 </div>
360 </xsl:template>
361
362 <xsl:template match="copyright" mode="set.titlepage.recto.auto.mode">
363 <div xsl:use-attribute-sets="set.titlepage.recto.style">
364 <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
365 </div>
366 </xsl:template>
367
368 <xsl:template match="legalnotice" mode="set.titlepage.recto.auto.mode">
369 <div xsl:use-attribute-sets="set.titlepage.recto.style">
370 <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
371 </div>
372 </xsl:template>
373
374 <xsl:template match="pubdate" mode="set.titlepage.recto.auto.mode">
375 <div xsl:use-attribute-sets="set.titlepage.recto.style">
376 <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
377 </div>
378 </xsl:template>
379
380 <xsl:template match="revision" mode="set.titlepage.recto.auto.mode">
381 <div xsl:use-attribute-sets="set.titlepage.recto.style">
382 <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
383 </div>
384 </xsl:template>
385
386 <xsl:template match="revhistory" mode="set.titlepage.recto.auto.mode">
387 <div xsl:use-attribute-sets="set.titlepage.recto.style">
388 <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
389 </div>
390 </xsl:template>
391
392 <xsl:template match="abstract" mode="set.titlepage.recto.auto.mode">
393 <div xsl:use-attribute-sets="set.titlepage.recto.style">
394 <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
395 </div>
396 </xsl:template>
397
398 <xsl:template name="book.titlepage.recto">
399   <xsl:choose>
400     <xsl:when test="bookinfo/title">
401       <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/title"/>
402     </xsl:when>
403     <xsl:when test="info/title">
404       <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/title"/>
405     </xsl:when>
406     <xsl:when test="title">
407       <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="title"/>
408     </xsl:when>
409   </xsl:choose>
410
411   <xsl:choose>
412     <xsl:when test="bookinfo/subtitle">
413       <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/subtitle"/>
414     </xsl:when>
415     <xsl:when test="info/subtitle">
416       <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/subtitle"/>
417     </xsl:when>
418     <xsl:when test="subtitle">
419       <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="subtitle"/>
420     </xsl:when>
421   </xsl:choose>
422
423   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/corpauthor"/>
424   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/corpauthor"/>
425   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/authorgroup"/>
426   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/authorgroup"/>
427   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/author"/>
428   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/author"/>
429   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/othercredit"/>
430   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/othercredit"/>
431   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/releaseinfo"/>
432   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/releaseinfo"/>
433   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/copyright"/>
434   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/copyright"/>
435   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/legalnotice"/>
436   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/legalnotice"/>
437   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/pubdate"/>
438   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/pubdate"/>
439   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revision"/>
440   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/revision"/>
441   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revhistory"/>
442   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/revhistory"/>
443   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/abstract"/>
444   <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/abstract"/>
445 </xsl:template>
446
447 <xsl:template name="book.titlepage.verso">
448 </xsl:template>
449
450 <xsl:template name="book.titlepage.separator"><hr/>
451 </xsl:template>
452
453 <xsl:template name="book.titlepage.before.recto">
454 </xsl:template>
455
456 <xsl:template name="book.titlepage.before.verso">
457 </xsl:template>
458
459 <xsl:template name="book.titlepage">
460   <div class="titlepage">
461     <xsl:variable name="recto.content">
462       <xsl:call-template name="book.titlepage.before.recto"/>
463       <xsl:call-template name="book.titlepage.recto"/>
464     </xsl:variable>
465     <xsl:variable name="recto.elements.count">
466       <xsl:choose>
467         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
468         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
469           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
470         <xsl:otherwise>1</xsl:otherwise>
471       </xsl:choose>
472     </xsl:variable>
473     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
474       <div><xsl:copy-of select="$recto.content"/></div>
475     </xsl:if>
476     <xsl:variable name="verso.content">
477       <xsl:call-template name="book.titlepage.before.verso"/>
478       <xsl:call-template name="book.titlepage.verso"/>
479     </xsl:variable>
480     <xsl:variable name="verso.elements.count">
481       <xsl:choose>
482         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
483         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
484           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
485         <xsl:otherwise>1</xsl:otherwise>
486       </xsl:choose>
487     </xsl:variable>
488     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
489       <div><xsl:copy-of select="$verso.content"/></div>
490     </xsl:if>
491     <xsl:call-template name="book.titlepage.separator"/>
492   </div>
493 </xsl:template>
494
495 <xsl:template match="*" mode="book.titlepage.recto.mode">
496   <!-- if an element isn't found in this mode, -->
497   <!-- try the generic titlepage.mode -->
498   <xsl:apply-templates select="." mode="titlepage.mode"/>
499 </xsl:template>
500
501 <xsl:template match="*" mode="book.titlepage.verso.mode">
502   <!-- if an element isn't found in this mode, -->
503   <!-- try the generic titlepage.mode -->
504   <xsl:apply-templates select="." mode="titlepage.mode"/>
505 </xsl:template>
506
507 <xsl:template match="title" mode="book.titlepage.recto.auto.mode">
508 <div xsl:use-attribute-sets="book.titlepage.recto.style">
509 <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
510 </div>
511 </xsl:template>
512
513 <xsl:template match="subtitle" mode="book.titlepage.recto.auto.mode">
514 <div xsl:use-attribute-sets="book.titlepage.recto.style">
515 <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
516 </div>
517 </xsl:template>
518
519 <xsl:template match="corpauthor" mode="book.titlepage.recto.auto.mode">
520 <div xsl:use-attribute-sets="book.titlepage.recto.style">
521 <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
522 </div>
523 </xsl:template>
524
525 <xsl:template match="authorgroup" mode="book.titlepage.recto.auto.mode">
526 <div xsl:use-attribute-sets="book.titlepage.recto.style">
527 <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
528 </div>
529 </xsl:template>
530
531 <xsl:template match="author" mode="book.titlepage.recto.auto.mode">
532 <div xsl:use-attribute-sets="book.titlepage.recto.style">
533 <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
534 </div>
535 </xsl:template>
536
537 <xsl:template match="othercredit" mode="book.titlepage.recto.auto.mode">
538 <div xsl:use-attribute-sets="book.titlepage.recto.style">
539 <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
540 </div>
541 </xsl:template>
542
543 <xsl:template match="releaseinfo" mode="book.titlepage.recto.auto.mode">
544 <div xsl:use-attribute-sets="book.titlepage.recto.style">
545 <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
546 </div>
547 </xsl:template>
548
549 <xsl:template match="copyright" mode="book.titlepage.recto.auto.mode">
550 <div xsl:use-attribute-sets="book.titlepage.recto.style">
551 <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
552 </div>
553 </xsl:template>
554
555 <xsl:template match="legalnotice" mode="book.titlepage.recto.auto.mode">
556 <div xsl:use-attribute-sets="book.titlepage.recto.style">
557 <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
558 </div>
559 </xsl:template>
560
561 <xsl:template match="pubdate" mode="book.titlepage.recto.auto.mode">
562 <div xsl:use-attribute-sets="book.titlepage.recto.style">
563 <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
564 </div>
565 </xsl:template>
566
567 <xsl:template match="revision" mode="book.titlepage.recto.auto.mode">
568 <div xsl:use-attribute-sets="book.titlepage.recto.style">
569 <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
570 </div>
571 </xsl:template>
572
573 <xsl:template match="revhistory" mode="book.titlepage.recto.auto.mode">
574 <div xsl:use-attribute-sets="book.titlepage.recto.style">
575 <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
576 </div>
577 </xsl:template>
578
579 <xsl:template match="abstract" mode="book.titlepage.recto.auto.mode">
580 <div xsl:use-attribute-sets="book.titlepage.recto.style">
581 <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
582 </div>
583 </xsl:template>
584
585 <xsl:template name="part.titlepage.recto">
586   <div xsl:use-attribute-sets="part.titlepage.recto.style">
587 <xsl:call-template name="division.title">
588 <xsl:with-param name="node" select="ancestor-or-self::part[1]"/>
589 </xsl:call-template></div>
590   <xsl:choose>
591     <xsl:when test="partinfo/subtitle">
592       <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/subtitle"/>
593     </xsl:when>
594     <xsl:when test="docinfo/subtitle">
595       <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
596     </xsl:when>
597     <xsl:when test="info/subtitle">
598       <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/subtitle"/>
599     </xsl:when>
600     <xsl:when test="subtitle">
601       <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="subtitle"/>
602     </xsl:when>
603   </xsl:choose>
604
605   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/corpauthor"/>
606   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
607   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/corpauthor"/>
608   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/authorgroup"/>
609   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
610   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/authorgroup"/>
611   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/author"/>
612   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/author"/>
613   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/author"/>
614   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/othercredit"/>
615   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
616   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/othercredit"/>
617   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/releaseinfo"/>
618   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
619   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/releaseinfo"/>
620   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/copyright"/>
621   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/copyright"/>
622   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/copyright"/>
623   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/legalnotice"/>
624   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
625   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/legalnotice"/>
626   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/pubdate"/>
627   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
628   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/pubdate"/>
629   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/revision"/>
630   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/revision"/>
631   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/revision"/>
632   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/revhistory"/>
633   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
634   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/revhistory"/>
635   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/abstract"/>
636   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/abstract"/>
637   <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/abstract"/>
638 </xsl:template>
639
640 <xsl:template name="part.titlepage.verso">
641 </xsl:template>
642
643 <xsl:template name="part.titlepage.separator">
644 </xsl:template>
645
646 <xsl:template name="part.titlepage.before.recto">
647 </xsl:template>
648
649 <xsl:template name="part.titlepage.before.verso">
650 </xsl:template>
651
652 <xsl:template name="part.titlepage">
653   <div class="titlepage">
654     <xsl:variable name="recto.content">
655       <xsl:call-template name="part.titlepage.before.recto"/>
656       <xsl:call-template name="part.titlepage.recto"/>
657     </xsl:variable>
658     <xsl:variable name="recto.elements.count">
659       <xsl:choose>
660         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
661         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
662           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
663         <xsl:otherwise>1</xsl:otherwise>
664       </xsl:choose>
665     </xsl:variable>
666     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
667       <div><xsl:copy-of select="$recto.content"/></div>
668     </xsl:if>
669     <xsl:variable name="verso.content">
670       <xsl:call-template name="part.titlepage.before.verso"/>
671       <xsl:call-template name="part.titlepage.verso"/>
672     </xsl:variable>
673     <xsl:variable name="verso.elements.count">
674       <xsl:choose>
675         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
676         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
677           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
678         <xsl:otherwise>1</xsl:otherwise>
679       </xsl:choose>
680     </xsl:variable>
681     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
682       <div><xsl:copy-of select="$verso.content"/></div>
683     </xsl:if>
684     <xsl:call-template name="part.titlepage.separator"/>
685   </div>
686 </xsl:template>
687
688 <xsl:template match="*" mode="part.titlepage.recto.mode">
689   <!-- if an element isn't found in this mode, -->
690   <!-- try the generic titlepage.mode -->
691   <xsl:apply-templates select="." mode="titlepage.mode"/>
692 </xsl:template>
693
694 <xsl:template match="*" mode="part.titlepage.verso.mode">
695   <!-- if an element isn't found in this mode, -->
696   <!-- try the generic titlepage.mode -->
697   <xsl:apply-templates select="." mode="titlepage.mode"/>
698 </xsl:template>
699
700 <xsl:template match="subtitle" mode="part.titlepage.recto.auto.mode">
701 <div xsl:use-attribute-sets="part.titlepage.recto.style">
702 <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
703 </div>
704 </xsl:template>
705
706 <xsl:template match="corpauthor" mode="part.titlepage.recto.auto.mode">
707 <div xsl:use-attribute-sets="part.titlepage.recto.style">
708 <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
709 </div>
710 </xsl:template>
711
712 <xsl:template match="authorgroup" mode="part.titlepage.recto.auto.mode">
713 <div xsl:use-attribute-sets="part.titlepage.recto.style">
714 <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
715 </div>
716 </xsl:template>
717
718 <xsl:template match="author" mode="part.titlepage.recto.auto.mode">
719 <div xsl:use-attribute-sets="part.titlepage.recto.style">
720 <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
721 </div>
722 </xsl:template>
723
724 <xsl:template match="othercredit" mode="part.titlepage.recto.auto.mode">
725 <div xsl:use-attribute-sets="part.titlepage.recto.style">
726 <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
727 </div>
728 </xsl:template>
729
730 <xsl:template match="releaseinfo" mode="part.titlepage.recto.auto.mode">
731 <div xsl:use-attribute-sets="part.titlepage.recto.style">
732 <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
733 </div>
734 </xsl:template>
735
736 <xsl:template match="copyright" mode="part.titlepage.recto.auto.mode">
737 <div xsl:use-attribute-sets="part.titlepage.recto.style">
738 <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
739 </div>
740 </xsl:template>
741
742 <xsl:template match="legalnotice" mode="part.titlepage.recto.auto.mode">
743 <div xsl:use-attribute-sets="part.titlepage.recto.style">
744 <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
745 </div>
746 </xsl:template>
747
748 <xsl:template match="pubdate" mode="part.titlepage.recto.auto.mode">
749 <div xsl:use-attribute-sets="part.titlepage.recto.style">
750 <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
751 </div>
752 </xsl:template>
753
754 <xsl:template match="revision" mode="part.titlepage.recto.auto.mode">
755 <div xsl:use-attribute-sets="part.titlepage.recto.style">
756 <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
757 </div>
758 </xsl:template>
759
760 <xsl:template match="revhistory" mode="part.titlepage.recto.auto.mode">
761 <div xsl:use-attribute-sets="part.titlepage.recto.style">
762 <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
763 </div>
764 </xsl:template>
765
766 <xsl:template match="abstract" mode="part.titlepage.recto.auto.mode">
767 <div xsl:use-attribute-sets="part.titlepage.recto.style">
768 <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
769 </div>
770 </xsl:template>
771
772 <xsl:template name="partintro.titlepage.recto">
773   <xsl:choose>
774     <xsl:when test="partintroinfo/title">
775       <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/title"/>
776     </xsl:when>
777     <xsl:when test="docinfo/title">
778       <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/title"/>
779     </xsl:when>
780     <xsl:when test="info/title">
781       <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/title"/>
782     </xsl:when>
783     <xsl:when test="title">
784       <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="title"/>
785     </xsl:when>
786   </xsl:choose>
787
788   <xsl:choose>
789     <xsl:when test="partintroinfo/subtitle">
790       <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/subtitle"/>
791     </xsl:when>
792     <xsl:when test="docinfo/subtitle">
793       <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
794     </xsl:when>
795     <xsl:when test="info/subtitle">
796       <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/subtitle"/>
797     </xsl:when>
798     <xsl:when test="subtitle">
799       <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="subtitle"/>
800     </xsl:when>
801   </xsl:choose>
802
803   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/corpauthor"/>
804   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
805   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/corpauthor"/>
806   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/authorgroup"/>
807   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
808   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/authorgroup"/>
809   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/author"/>
810   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/author"/>
811   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/author"/>
812   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/othercredit"/>
813   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
814   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/othercredit"/>
815   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/releaseinfo"/>
816   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
817   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/releaseinfo"/>
818   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/copyright"/>
819   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/copyright"/>
820   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/copyright"/>
821   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/legalnotice"/>
822   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
823   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/legalnotice"/>
824   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/pubdate"/>
825   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
826   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/pubdate"/>
827   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/revision"/>
828   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/revision"/>
829   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/revision"/>
830   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/revhistory"/>
831   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
832   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/revhistory"/>
833   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/abstract"/>
834   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/abstract"/>
835   <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/abstract"/>
836 </xsl:template>
837
838 <xsl:template name="partintro.titlepage.verso">
839 </xsl:template>
840
841 <xsl:template name="partintro.titlepage.separator">
842 </xsl:template>
843
844 <xsl:template name="partintro.titlepage.before.recto">
845 </xsl:template>
846
847 <xsl:template name="partintro.titlepage.before.verso">
848 </xsl:template>
849
850 <xsl:template name="partintro.titlepage">
851   <div>
852     <xsl:variable name="recto.content">
853       <xsl:call-template name="partintro.titlepage.before.recto"/>
854       <xsl:call-template name="partintro.titlepage.recto"/>
855     </xsl:variable>
856     <xsl:variable name="recto.elements.count">
857       <xsl:choose>
858         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
859         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
860           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
861         <xsl:otherwise>1</xsl:otherwise>
862       </xsl:choose>
863     </xsl:variable>
864     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
865       <div><xsl:copy-of select="$recto.content"/></div>
866     </xsl:if>
867     <xsl:variable name="verso.content">
868       <xsl:call-template name="partintro.titlepage.before.verso"/>
869       <xsl:call-template name="partintro.titlepage.verso"/>
870     </xsl:variable>
871     <xsl:variable name="verso.elements.count">
872       <xsl:choose>
873         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
874         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
875           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
876         <xsl:otherwise>1</xsl:otherwise>
877       </xsl:choose>
878     </xsl:variable>
879     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
880       <div><xsl:copy-of select="$verso.content"/></div>
881     </xsl:if>
882     <xsl:call-template name="partintro.titlepage.separator"/>
883   </div>
884 </xsl:template>
885
886 <xsl:template match="*" mode="partintro.titlepage.recto.mode">
887   <!-- if an element isn't found in this mode, -->
888   <!-- try the generic titlepage.mode -->
889   <xsl:apply-templates select="." mode="titlepage.mode"/>
890 </xsl:template>
891
892 <xsl:template match="*" mode="partintro.titlepage.verso.mode">
893   <!-- if an element isn't found in this mode, -->
894   <!-- try the generic titlepage.mode -->
895   <xsl:apply-templates select="." mode="titlepage.mode"/>
896 </xsl:template>
897
898 <xsl:template match="title" mode="partintro.titlepage.recto.auto.mode">
899 <div xsl:use-attribute-sets="partintro.titlepage.recto.style">
900 <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
901 </div>
902 </xsl:template>
903
904 <xsl:template match="subtitle" mode="partintro.titlepage.recto.auto.mode">
905 <div xsl:use-attribute-sets="partintro.titlepage.recto.style">
906 <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
907 </div>
908 </xsl:template>
909
910 <xsl:template match="corpauthor" mode="partintro.titlepage.recto.auto.mode">
911 <div xsl:use-attribute-sets="partintro.titlepage.recto.style">
912 <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
913 </div>
914 </xsl:template>
915
916 <xsl:template match="authorgroup" mode="partintro.titlepage.recto.auto.mode">
917 <div xsl:use-attribute-sets="partintro.titlepage.recto.style">
918 <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
919 </div>
920 </xsl:template>
921
922 <xsl:template match="author" mode="partintro.titlepage.recto.auto.mode">
923 <div xsl:use-attribute-sets="partintro.titlepage.recto.style">
924 <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
925 </div>
926 </xsl:template>
927
928 <xsl:template match="othercredit" mode="partintro.titlepage.recto.auto.mode">
929 <div xsl:use-attribute-sets="partintro.titlepage.recto.style">
930 <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
931 </div>
932 </xsl:template>
933
934 <xsl:template match="releaseinfo" mode="partintro.titlepage.recto.auto.mode">
935 <div xsl:use-attribute-sets="partintro.titlepage.recto.style">
936 <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
937 </div>
938 </xsl:template>
939
940 <xsl:template match="copyright" mode="partintro.titlepage.recto.auto.mode">
941 <div xsl:use-attribute-sets="partintro.titlepage.recto.style">
942 <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
943 </div>
944 </xsl:template>
945
946 <xsl:template match="legalnotice" mode="partintro.titlepage.recto.auto.mode">
947 <div xsl:use-attribute-sets="partintro.titlepage.recto.style">
948 <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
949 </div>
950 </xsl:template>
951
952 <xsl:template match="pubdate" mode="partintro.titlepage.recto.auto.mode">
953 <div xsl:use-attribute-sets="partintro.titlepage.recto.style">
954 <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
955 </div>
956 </xsl:template>
957
958 <xsl:template match="revision" mode="partintro.titlepage.recto.auto.mode">
959 <div xsl:use-attribute-sets="partintro.titlepage.recto.style">
960 <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
961 </div>
962 </xsl:template>
963
964 <xsl:template match="revhistory" mode="partintro.titlepage.recto.auto.mode">
965 <div xsl:use-attribute-sets="partintro.titlepage.recto.style">
966 <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
967 </div>
968 </xsl:template>
969
970 <xsl:template match="abstract" mode="partintro.titlepage.recto.auto.mode">
971 <div xsl:use-attribute-sets="partintro.titlepage.recto.style">
972 <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
973 </div>
974 </xsl:template>
975
976 <xsl:template name="reference.titlepage.recto">
977   <xsl:choose>
978     <xsl:when test="referenceinfo/title">
979       <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/title"/>
980     </xsl:when>
981     <xsl:when test="docinfo/title">
982       <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/title"/>
983     </xsl:when>
984     <xsl:when test="info/title">
985       <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/title"/>
986     </xsl:when>
987     <xsl:when test="title">
988       <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="title"/>
989     </xsl:when>
990   </xsl:choose>
991
992   <xsl:choose>
993     <xsl:when test="referenceinfo/subtitle">
994       <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/subtitle"/>
995     </xsl:when>
996     <xsl:when test="docinfo/subtitle">
997       <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
998     </xsl:when>
999     <xsl:when test="info/subtitle">
1000       <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/subtitle"/>
1001     </xsl:when>
1002     <xsl:when test="subtitle">
1003       <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="subtitle"/>
1004     </xsl:when>
1005   </xsl:choose>
1006
1007   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/corpauthor"/>
1008   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
1009   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/corpauthor"/>
1010   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/authorgroup"/>
1011   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
1012   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/authorgroup"/>
1013   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/author"/>
1014   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/author"/>
1015   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/author"/>
1016   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/othercredit"/>
1017   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
1018   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/othercredit"/>
1019   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/releaseinfo"/>
1020   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
1021   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/releaseinfo"/>
1022   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/copyright"/>
1023   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/copyright"/>
1024   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/copyright"/>
1025   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/legalnotice"/>
1026   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
1027   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/legalnotice"/>
1028   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/pubdate"/>
1029   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
1030   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/pubdate"/>
1031   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/revision"/>
1032   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/revision"/>
1033   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/revision"/>
1034   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/revhistory"/>
1035   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
1036   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/revhistory"/>
1037   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/abstract"/>
1038   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/abstract"/>
1039   <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/abstract"/>
1040 </xsl:template>
1041
1042 <xsl:template name="reference.titlepage.verso">
1043 </xsl:template>
1044
1045 <xsl:template name="reference.titlepage.separator"><hr/>
1046 </xsl:template>
1047
1048 <xsl:template name="reference.titlepage.before.recto">
1049 </xsl:template>
1050
1051 <xsl:template name="reference.titlepage.before.verso">
1052 </xsl:template>
1053
1054 <xsl:template name="reference.titlepage">
1055   <div class="titlepage">
1056     <xsl:variable name="recto.content">
1057       <xsl:call-template name="reference.titlepage.before.recto"/>
1058       <xsl:call-template name="reference.titlepage.recto"/>
1059     </xsl:variable>
1060     <xsl:variable name="recto.elements.count">
1061       <xsl:choose>
1062         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1063         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1064           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1065         <xsl:otherwise>1</xsl:otherwise>
1066       </xsl:choose>
1067     </xsl:variable>
1068     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
1069       <div><xsl:copy-of select="$recto.content"/></div>
1070     </xsl:if>
1071     <xsl:variable name="verso.content">
1072       <xsl:call-template name="reference.titlepage.before.verso"/>
1073       <xsl:call-template name="reference.titlepage.verso"/>
1074     </xsl:variable>
1075     <xsl:variable name="verso.elements.count">
1076       <xsl:choose>
1077         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1078         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1079           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1080         <xsl:otherwise>1</xsl:otherwise>
1081       </xsl:choose>
1082     </xsl:variable>
1083     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
1084       <div><xsl:copy-of select="$verso.content"/></div>
1085     </xsl:if>
1086     <xsl:call-template name="reference.titlepage.separator"/>
1087   </div>
1088 </xsl:template>
1089
1090 <xsl:template match="*" mode="reference.titlepage.recto.mode">
1091   <!-- if an element isn't found in this mode, -->
1092   <!-- try the generic titlepage.mode -->
1093   <xsl:apply-templates select="." mode="titlepage.mode"/>
1094 </xsl:template>
1095
1096 <xsl:template match="*" mode="reference.titlepage.verso.mode">
1097   <!-- if an element isn't found in this mode, -->
1098   <!-- try the generic titlepage.mode -->
1099   <xsl:apply-templates select="." mode="titlepage.mode"/>
1100 </xsl:template>
1101
1102 <xsl:template match="title" mode="reference.titlepage.recto.auto.mode">
1103 <div xsl:use-attribute-sets="reference.titlepage.recto.style">
1104 <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1105 </div>
1106 </xsl:template>
1107
1108 <xsl:template match="subtitle" mode="reference.titlepage.recto.auto.mode">
1109 <div xsl:use-attribute-sets="reference.titlepage.recto.style">
1110 <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1111 </div>
1112 </xsl:template>
1113
1114 <xsl:template match="corpauthor" mode="reference.titlepage.recto.auto.mode">
1115 <div xsl:use-attribute-sets="reference.titlepage.recto.style">
1116 <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1117 </div>
1118 </xsl:template>
1119
1120 <xsl:template match="authorgroup" mode="reference.titlepage.recto.auto.mode">
1121 <div xsl:use-attribute-sets="reference.titlepage.recto.style">
1122 <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1123 </div>
1124 </xsl:template>
1125
1126 <xsl:template match="author" mode="reference.titlepage.recto.auto.mode">
1127 <div xsl:use-attribute-sets="reference.titlepage.recto.style">
1128 <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1129 </div>
1130 </xsl:template>
1131
1132 <xsl:template match="othercredit" mode="reference.titlepage.recto.auto.mode">
1133 <div xsl:use-attribute-sets="reference.titlepage.recto.style">
1134 <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1135 </div>
1136 </xsl:template>
1137
1138 <xsl:template match="releaseinfo" mode="reference.titlepage.recto.auto.mode">
1139 <div xsl:use-attribute-sets="reference.titlepage.recto.style">
1140 <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1141 </div>
1142 </xsl:template>
1143
1144 <xsl:template match="copyright" mode="reference.titlepage.recto.auto.mode">
1145 <div xsl:use-attribute-sets="reference.titlepage.recto.style">
1146 <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1147 </div>
1148 </xsl:template>
1149
1150 <xsl:template match="legalnotice" mode="reference.titlepage.recto.auto.mode">
1151 <div xsl:use-attribute-sets="reference.titlepage.recto.style">
1152 <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1153 </div>
1154 </xsl:template>
1155
1156 <xsl:template match="pubdate" mode="reference.titlepage.recto.auto.mode">
1157 <div xsl:use-attribute-sets="reference.titlepage.recto.style">
1158 <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1159 </div>
1160 </xsl:template>
1161
1162 <xsl:template match="revision" mode="reference.titlepage.recto.auto.mode">
1163 <div xsl:use-attribute-sets="reference.titlepage.recto.style">
1164 <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1165 </div>
1166 </xsl:template>
1167
1168 <xsl:template match="revhistory" mode="reference.titlepage.recto.auto.mode">
1169 <div xsl:use-attribute-sets="reference.titlepage.recto.style">
1170 <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1171 </div>
1172 </xsl:template>
1173
1174 <xsl:template match="abstract" mode="reference.titlepage.recto.auto.mode">
1175 <div xsl:use-attribute-sets="reference.titlepage.recto.style">
1176 <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1177 </div>
1178 </xsl:template>
1179
1180 <xsl:template name="refentry.titlepage.recto">
1181 </xsl:template>
1182
1183 <xsl:template name="refentry.titlepage.verso">
1184 </xsl:template>
1185
1186 <xsl:template name="refentry.titlepage.separator">
1187 </xsl:template>
1188
1189 <xsl:template name="refentry.titlepage.before.recto">
1190 </xsl:template>
1191
1192 <xsl:template name="refentry.titlepage.before.verso">
1193 </xsl:template>
1194
1195 <xsl:template name="refentry.titlepage">
1196   <div class="titlepage">
1197     <xsl:variable name="recto.content">
1198       <xsl:call-template name="refentry.titlepage.before.recto"/>
1199       <xsl:call-template name="refentry.titlepage.recto"/>
1200     </xsl:variable>
1201     <xsl:variable name="recto.elements.count">
1202       <xsl:choose>
1203         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1204         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1205           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1206         <xsl:otherwise>1</xsl:otherwise>
1207       </xsl:choose>
1208     </xsl:variable>
1209     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
1210       <div><xsl:copy-of select="$recto.content"/></div>
1211     </xsl:if>
1212     <xsl:variable name="verso.content">
1213       <xsl:call-template name="refentry.titlepage.before.verso"/>
1214       <xsl:call-template name="refentry.titlepage.verso"/>
1215     </xsl:variable>
1216     <xsl:variable name="verso.elements.count">
1217       <xsl:choose>
1218         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1219         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1220           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1221         <xsl:otherwise>1</xsl:otherwise>
1222       </xsl:choose>
1223     </xsl:variable>
1224     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
1225       <div><xsl:copy-of select="$verso.content"/></div>
1226     </xsl:if>
1227     <xsl:call-template name="refentry.titlepage.separator"/>
1228   </div>
1229 </xsl:template>
1230
1231 <xsl:template match="*" mode="refentry.titlepage.recto.mode">
1232   <!-- if an element isn't found in this mode, -->
1233   <!-- try the generic titlepage.mode -->
1234   <xsl:apply-templates select="." mode="titlepage.mode"/>
1235 </xsl:template>
1236
1237 <xsl:template match="*" mode="refentry.titlepage.verso.mode">
1238   <!-- if an element isn't found in this mode, -->
1239   <!-- try the generic titlepage.mode -->
1240   <xsl:apply-templates select="." mode="titlepage.mode"/>
1241 </xsl:template>
1242
1243 <xsl:template name="dedication.titlepage.recto">
1244   <div xsl:use-attribute-sets="dedication.titlepage.recto.style">
1245 <xsl:call-template name="component.title">
1246 <xsl:with-param name="node" select="ancestor-or-self::dedication[1]"/>
1247 </xsl:call-template></div>
1248   <xsl:choose>
1249     <xsl:when test="dedicationinfo/subtitle">
1250       <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="dedicationinfo/subtitle"/>
1251     </xsl:when>
1252     <xsl:when test="docinfo/subtitle">
1253       <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
1254     </xsl:when>
1255     <xsl:when test="info/subtitle">
1256       <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="info/subtitle"/>
1257     </xsl:when>
1258     <xsl:when test="subtitle">
1259       <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="subtitle"/>
1260     </xsl:when>
1261   </xsl:choose>
1262
1263 </xsl:template>
1264
1265 <xsl:template name="dedication.titlepage.verso">
1266 </xsl:template>
1267
1268 <xsl:template name="dedication.titlepage.separator">
1269 </xsl:template>
1270
1271 <xsl:template name="dedication.titlepage.before.recto">
1272 </xsl:template>
1273
1274 <xsl:template name="dedication.titlepage.before.verso">
1275 </xsl:template>
1276
1277 <xsl:template name="dedication.titlepage">
1278   <div class="titlepage">
1279     <xsl:variable name="recto.content">
1280       <xsl:call-template name="dedication.titlepage.before.recto"/>
1281       <xsl:call-template name="dedication.titlepage.recto"/>
1282     </xsl:variable>
1283     <xsl:variable name="recto.elements.count">
1284       <xsl:choose>
1285         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1286         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1287           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1288         <xsl:otherwise>1</xsl:otherwise>
1289       </xsl:choose>
1290     </xsl:variable>
1291     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
1292       <div><xsl:copy-of select="$recto.content"/></div>
1293     </xsl:if>
1294     <xsl:variable name="verso.content">
1295       <xsl:call-template name="dedication.titlepage.before.verso"/>
1296       <xsl:call-template name="dedication.titlepage.verso"/>
1297     </xsl:variable>
1298     <xsl:variable name="verso.elements.count">
1299       <xsl:choose>
1300         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1301         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1302           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1303         <xsl:otherwise>1</xsl:otherwise>
1304       </xsl:choose>
1305     </xsl:variable>
1306     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
1307       <div><xsl:copy-of select="$verso.content"/></div>
1308     </xsl:if>
1309     <xsl:call-template name="dedication.titlepage.separator"/>
1310   </div>
1311 </xsl:template>
1312
1313 <xsl:template match="*" mode="dedication.titlepage.recto.mode">
1314   <!-- if an element isn't found in this mode, -->
1315   <!-- try the generic titlepage.mode -->
1316   <xsl:apply-templates select="." mode="titlepage.mode"/>
1317 </xsl:template>
1318
1319 <xsl:template match="*" mode="dedication.titlepage.verso.mode">
1320   <!-- if an element isn't found in this mode, -->
1321   <!-- try the generic titlepage.mode -->
1322   <xsl:apply-templates select="." mode="titlepage.mode"/>
1323 </xsl:template>
1324
1325 <xsl:template match="subtitle" mode="dedication.titlepage.recto.auto.mode">
1326 <div xsl:use-attribute-sets="dedication.titlepage.recto.style">
1327 <xsl:apply-templates select="." mode="dedication.titlepage.recto.mode"/>
1328 </div>
1329 </xsl:template>
1330
1331 <xsl:template name="acknowledgements.titlepage.recto">
1332   <div xsl:use-attribute-sets="acknowledgements.titlepage.recto.style">
1333 <xsl:call-template name="component.title">
1334 <xsl:with-param name="node" select="ancestor-or-self::acknowledgements[1]"/>
1335 </xsl:call-template></div>
1336   <xsl:choose>
1337     <xsl:when test="acknowledgementsinfo/subtitle">
1338       <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="acknowledgementsinfo/subtitle"/>
1339     </xsl:when>
1340     <xsl:when test="docinfo/subtitle">
1341       <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
1342     </xsl:when>
1343     <xsl:when test="info/subtitle">
1344       <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="info/subtitle"/>
1345     </xsl:when>
1346     <xsl:when test="subtitle">
1347       <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="subtitle"/>
1348     </xsl:when>
1349   </xsl:choose>
1350
1351 </xsl:template>
1352
1353 <xsl:template name="acknowledgements.titlepage.verso">
1354 </xsl:template>
1355
1356 <xsl:template name="acknowledgements.titlepage.separator">
1357 </xsl:template>
1358
1359 <xsl:template name="acknowledgements.titlepage.before.recto">
1360 </xsl:template>
1361
1362 <xsl:template name="acknowledgements.titlepage.before.verso">
1363 </xsl:template>
1364
1365 <xsl:template name="acknowledgements.titlepage">
1366   <div class="titlepage">
1367     <xsl:variable name="recto.content">
1368       <xsl:call-template name="acknowledgements.titlepage.before.recto"/>
1369       <xsl:call-template name="acknowledgements.titlepage.recto"/>
1370     </xsl:variable>
1371     <xsl:variable name="recto.elements.count">
1372       <xsl:choose>
1373         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1374         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1375           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1376         <xsl:otherwise>1</xsl:otherwise>
1377       </xsl:choose>
1378     </xsl:variable>
1379     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
1380       <div><xsl:copy-of select="$recto.content"/></div>
1381     </xsl:if>
1382     <xsl:variable name="verso.content">
1383       <xsl:call-template name="acknowledgements.titlepage.before.verso"/>
1384       <xsl:call-template name="acknowledgements.titlepage.verso"/>
1385     </xsl:variable>
1386     <xsl:variable name="verso.elements.count">
1387       <xsl:choose>
1388         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1389         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1390           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1391         <xsl:otherwise>1</xsl:otherwise>
1392       </xsl:choose>
1393     </xsl:variable>
1394     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
1395       <div><xsl:copy-of select="$verso.content"/></div>
1396     </xsl:if>
1397     <xsl:call-template name="acknowledgements.titlepage.separator"/>
1398   </div>
1399 </xsl:template>
1400
1401 <xsl:template match="*" mode="acknowledgements.titlepage.recto.mode">
1402   <!-- if an element isn't found in this mode, -->
1403   <!-- try the generic titlepage.mode -->
1404   <xsl:apply-templates select="." mode="titlepage.mode"/>
1405 </xsl:template>
1406
1407 <xsl:template match="*" mode="acknowledgements.titlepage.verso.mode">
1408   <!-- if an element isn't found in this mode, -->
1409   <!-- try the generic titlepage.mode -->
1410   <xsl:apply-templates select="." mode="titlepage.mode"/>
1411 </xsl:template>
1412
1413 <xsl:template match="subtitle" mode="acknowledgements.titlepage.recto.auto.mode">
1414 <div xsl:use-attribute-sets="acknowledgements.titlepage.recto.style">
1415 <xsl:apply-templates select="." mode="acknowledgements.titlepage.recto.mode"/>
1416 </div>
1417 </xsl:template>
1418
1419 <xsl:template name="preface.titlepage.recto">
1420   <xsl:choose>
1421     <xsl:when test="prefaceinfo/title">
1422       <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/title"/>
1423     </xsl:when>
1424     <xsl:when test="docinfo/title">
1425       <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/title"/>
1426     </xsl:when>
1427     <xsl:when test="info/title">
1428       <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/title"/>
1429     </xsl:when>
1430     <xsl:when test="title">
1431       <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="title"/>
1432     </xsl:when>
1433   </xsl:choose>
1434
1435   <xsl:choose>
1436     <xsl:when test="prefaceinfo/subtitle">
1437       <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/subtitle"/>
1438     </xsl:when>
1439     <xsl:when test="docinfo/subtitle">
1440       <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
1441     </xsl:when>
1442     <xsl:when test="info/subtitle">
1443       <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/subtitle"/>
1444     </xsl:when>
1445     <xsl:when test="subtitle">
1446       <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="subtitle"/>
1447     </xsl:when>
1448   </xsl:choose>
1449
1450   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/corpauthor"/>
1451   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
1452   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/corpauthor"/>
1453   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/authorgroup"/>
1454   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
1455   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/authorgroup"/>
1456   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/author"/>
1457   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/author"/>
1458   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/author"/>
1459   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/othercredit"/>
1460   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
1461   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/othercredit"/>
1462   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/releaseinfo"/>
1463   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
1464   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/releaseinfo"/>
1465   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/copyright"/>
1466   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/copyright"/>
1467   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/copyright"/>
1468   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/legalnotice"/>
1469   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
1470   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/legalnotice"/>
1471   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/pubdate"/>
1472   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
1473   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/pubdate"/>
1474   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/revision"/>
1475   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/revision"/>
1476   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/revision"/>
1477   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/revhistory"/>
1478   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
1479   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/revhistory"/>
1480   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/abstract"/>
1481   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/abstract"/>
1482   <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/abstract"/>
1483 </xsl:template>
1484
1485 <xsl:template name="preface.titlepage.verso">
1486 </xsl:template>
1487
1488 <xsl:template name="preface.titlepage.separator">
1489 </xsl:template>
1490
1491 <xsl:template name="preface.titlepage.before.recto">
1492 </xsl:template>
1493
1494 <xsl:template name="preface.titlepage.before.verso">
1495 </xsl:template>
1496
1497 <xsl:template name="preface.titlepage">
1498   <div class="titlepage">
1499     <xsl:variable name="recto.content">
1500       <xsl:call-template name="preface.titlepage.before.recto"/>
1501       <xsl:call-template name="preface.titlepage.recto"/>
1502     </xsl:variable>
1503     <xsl:variable name="recto.elements.count">
1504       <xsl:choose>
1505         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1506         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1507           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1508         <xsl:otherwise>1</xsl:otherwise>
1509       </xsl:choose>
1510     </xsl:variable>
1511     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
1512       <div><xsl:copy-of select="$recto.content"/></div>
1513     </xsl:if>
1514     <xsl:variable name="verso.content">
1515       <xsl:call-template name="preface.titlepage.before.verso"/>
1516       <xsl:call-template name="preface.titlepage.verso"/>
1517     </xsl:variable>
1518     <xsl:variable name="verso.elements.count">
1519       <xsl:choose>
1520         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1521         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1522           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1523         <xsl:otherwise>1</xsl:otherwise>
1524       </xsl:choose>
1525     </xsl:variable>
1526     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
1527       <div><xsl:copy-of select="$verso.content"/></div>
1528     </xsl:if>
1529     <xsl:call-template name="preface.titlepage.separator"/>
1530   </div>
1531 </xsl:template>
1532
1533 <xsl:template match="*" mode="preface.titlepage.recto.mode">
1534   <!-- if an element isn't found in this mode, -->
1535   <!-- try the generic titlepage.mode -->
1536   <xsl:apply-templates select="." mode="titlepage.mode"/>
1537 </xsl:template>
1538
1539 <xsl:template match="*" mode="preface.titlepage.verso.mode">
1540   <!-- if an element isn't found in this mode, -->
1541   <!-- try the generic titlepage.mode -->
1542   <xsl:apply-templates select="." mode="titlepage.mode"/>
1543 </xsl:template>
1544
1545 <xsl:template match="title" mode="preface.titlepage.recto.auto.mode">
1546 <div xsl:use-attribute-sets="preface.titlepage.recto.style">
1547 <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1548 </div>
1549 </xsl:template>
1550
1551 <xsl:template match="subtitle" mode="preface.titlepage.recto.auto.mode">
1552 <div xsl:use-attribute-sets="preface.titlepage.recto.style">
1553 <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1554 </div>
1555 </xsl:template>
1556
1557 <xsl:template match="corpauthor" mode="preface.titlepage.recto.auto.mode">
1558 <div xsl:use-attribute-sets="preface.titlepage.recto.style">
1559 <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1560 </div>
1561 </xsl:template>
1562
1563 <xsl:template match="authorgroup" mode="preface.titlepage.recto.auto.mode">
1564 <div xsl:use-attribute-sets="preface.titlepage.recto.style">
1565 <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1566 </div>
1567 </xsl:template>
1568
1569 <xsl:template match="author" mode="preface.titlepage.recto.auto.mode">
1570 <div xsl:use-attribute-sets="preface.titlepage.recto.style">
1571 <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1572 </div>
1573 </xsl:template>
1574
1575 <xsl:template match="othercredit" mode="preface.titlepage.recto.auto.mode">
1576 <div xsl:use-attribute-sets="preface.titlepage.recto.style">
1577 <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1578 </div>
1579 </xsl:template>
1580
1581 <xsl:template match="releaseinfo" mode="preface.titlepage.recto.auto.mode">
1582 <div xsl:use-attribute-sets="preface.titlepage.recto.style">
1583 <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1584 </div>
1585 </xsl:template>
1586
1587 <xsl:template match="copyright" mode="preface.titlepage.recto.auto.mode">
1588 <div xsl:use-attribute-sets="preface.titlepage.recto.style">
1589 <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1590 </div>
1591 </xsl:template>
1592
1593 <xsl:template match="legalnotice" mode="preface.titlepage.recto.auto.mode">
1594 <div xsl:use-attribute-sets="preface.titlepage.recto.style">
1595 <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1596 </div>
1597 </xsl:template>
1598
1599 <xsl:template match="pubdate" mode="preface.titlepage.recto.auto.mode">
1600 <div xsl:use-attribute-sets="preface.titlepage.recto.style">
1601 <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1602 </div>
1603 </xsl:template>
1604
1605 <xsl:template match="revision" mode="preface.titlepage.recto.auto.mode">
1606 <div xsl:use-attribute-sets="preface.titlepage.recto.style">
1607 <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1608 </div>
1609 </xsl:template>
1610
1611 <xsl:template match="revhistory" mode="preface.titlepage.recto.auto.mode">
1612 <div xsl:use-attribute-sets="preface.titlepage.recto.style">
1613 <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1614 </div>
1615 </xsl:template>
1616
1617 <xsl:template match="abstract" mode="preface.titlepage.recto.auto.mode">
1618 <div xsl:use-attribute-sets="preface.titlepage.recto.style">
1619 <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1620 </div>
1621 </xsl:template>
1622
1623 <xsl:template name="chapter.titlepage.recto">
1624   <xsl:choose>
1625     <xsl:when test="chapterinfo/title">
1626       <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/title"/>
1627     </xsl:when>
1628     <xsl:when test="docinfo/title">
1629       <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/title"/>
1630     </xsl:when>
1631     <xsl:when test="info/title">
1632       <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/title"/>
1633     </xsl:when>
1634     <xsl:when test="title">
1635       <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="title"/>
1636     </xsl:when>
1637   </xsl:choose>
1638
1639   <xsl:choose>
1640     <xsl:when test="chapterinfo/subtitle">
1641       <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/subtitle"/>
1642     </xsl:when>
1643     <xsl:when test="docinfo/subtitle">
1644       <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
1645     </xsl:when>
1646     <xsl:when test="info/subtitle">
1647       <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/subtitle"/>
1648     </xsl:when>
1649     <xsl:when test="subtitle">
1650       <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="subtitle"/>
1651     </xsl:when>
1652   </xsl:choose>
1653
1654   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/corpauthor"/>
1655   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
1656   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/corpauthor"/>
1657   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/authorgroup"/>
1658   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
1659   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/authorgroup"/>
1660   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/author"/>
1661   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/author"/>
1662   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/author"/>
1663   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/othercredit"/>
1664   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
1665   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/othercredit"/>
1666   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/releaseinfo"/>
1667   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
1668   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/releaseinfo"/>
1669   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/copyright"/>
1670   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/copyright"/>
1671   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/copyright"/>
1672   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/legalnotice"/>
1673   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
1674   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/legalnotice"/>
1675   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/pubdate"/>
1676   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
1677   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/pubdate"/>
1678   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/revision"/>
1679   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/revision"/>
1680   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/revision"/>
1681   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/revhistory"/>
1682   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
1683   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/revhistory"/>
1684   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/abstract"/>
1685   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/abstract"/>
1686   <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/abstract"/>
1687 </xsl:template>
1688
1689 <xsl:template name="chapter.titlepage.verso">
1690 </xsl:template>
1691
1692 <xsl:template name="chapter.titlepage.separator">
1693 </xsl:template>
1694
1695 <xsl:template name="chapter.titlepage.before.recto">
1696 </xsl:template>
1697
1698 <xsl:template name="chapter.titlepage.before.verso">
1699 </xsl:template>
1700
1701 <xsl:template name="chapter.titlepage">
1702   <div class="titlepage">
1703     <xsl:variable name="recto.content">
1704       <xsl:call-template name="chapter.titlepage.before.recto"/>
1705       <xsl:call-template name="chapter.titlepage.recto"/>
1706     </xsl:variable>
1707     <xsl:variable name="recto.elements.count">
1708       <xsl:choose>
1709         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1710         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1711           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1712         <xsl:otherwise>1</xsl:otherwise>
1713       </xsl:choose>
1714     </xsl:variable>
1715     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
1716       <div><xsl:copy-of select="$recto.content"/></div>
1717     </xsl:if>
1718     <xsl:variable name="verso.content">
1719       <xsl:call-template name="chapter.titlepage.before.verso"/>
1720       <xsl:call-template name="chapter.titlepage.verso"/>
1721     </xsl:variable>
1722     <xsl:variable name="verso.elements.count">
1723       <xsl:choose>
1724         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1725         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1726           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1727         <xsl:otherwise>1</xsl:otherwise>
1728       </xsl:choose>
1729     </xsl:variable>
1730     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
1731       <div><xsl:copy-of select="$verso.content"/></div>
1732     </xsl:if>
1733     <xsl:call-template name="chapter.titlepage.separator"/>
1734   </div>
1735 </xsl:template>
1736
1737 <xsl:template match="*" mode="chapter.titlepage.recto.mode">
1738   <!-- if an element isn't found in this mode, -->
1739   <!-- try the generic titlepage.mode -->
1740   <xsl:apply-templates select="." mode="titlepage.mode"/>
1741 </xsl:template>
1742
1743 <xsl:template match="*" mode="chapter.titlepage.verso.mode">
1744   <!-- if an element isn't found in this mode, -->
1745   <!-- try the generic titlepage.mode -->
1746   <xsl:apply-templates select="." mode="titlepage.mode"/>
1747 </xsl:template>
1748
1749 <xsl:template match="title" mode="chapter.titlepage.recto.auto.mode">
1750 <div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1751 <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1752 </div>
1753 </xsl:template>
1754
1755 <xsl:template match="subtitle" mode="chapter.titlepage.recto.auto.mode">
1756 <div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1757 <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1758 </div>
1759 </xsl:template>
1760
1761 <xsl:template match="corpauthor" mode="chapter.titlepage.recto.auto.mode">
1762 <div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1763 <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1764 </div>
1765 </xsl:template>
1766
1767 <xsl:template match="authorgroup" mode="chapter.titlepage.recto.auto.mode">
1768 <div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1769 <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1770 </div>
1771 </xsl:template>
1772
1773 <xsl:template match="author" mode="chapter.titlepage.recto.auto.mode">
1774 <div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1775 <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1776 </div>
1777 </xsl:template>
1778
1779 <xsl:template match="othercredit" mode="chapter.titlepage.recto.auto.mode">
1780 <div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1781 <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1782 </div>
1783 </xsl:template>
1784
1785 <xsl:template match="releaseinfo" mode="chapter.titlepage.recto.auto.mode">
1786 <div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1787 <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1788 </div>
1789 </xsl:template>
1790
1791 <xsl:template match="copyright" mode="chapter.titlepage.recto.auto.mode">
1792 <div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1793 <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1794 </div>
1795 </xsl:template>
1796
1797 <xsl:template match="legalnotice" mode="chapter.titlepage.recto.auto.mode">
1798 <div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1799 <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1800 </div>
1801 </xsl:template>
1802
1803 <xsl:template match="pubdate" mode="chapter.titlepage.recto.auto.mode">
1804 <div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1805 <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1806 </div>
1807 </xsl:template>
1808
1809 <xsl:template match="revision" mode="chapter.titlepage.recto.auto.mode">
1810 <div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1811 <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1812 </div>
1813 </xsl:template>
1814
1815 <xsl:template match="revhistory" mode="chapter.titlepage.recto.auto.mode">
1816 <div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1817 <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1818 </div>
1819 </xsl:template>
1820
1821 <xsl:template match="abstract" mode="chapter.titlepage.recto.auto.mode">
1822 <div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1823 <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1824 </div>
1825 </xsl:template>
1826
1827 <xsl:template name="topic.titlepage.recto">
1828   <xsl:choose>
1829     <xsl:when test="topicinfo/title">
1830       <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/title"/>
1831     </xsl:when>
1832     <xsl:when test="info/title">
1833       <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/title"/>
1834     </xsl:when>
1835     <xsl:when test="title">
1836       <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="title"/>
1837     </xsl:when>
1838   </xsl:choose>
1839
1840   <xsl:choose>
1841     <xsl:when test="topicinfo/subtitle">
1842       <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/subtitle"/>
1843     </xsl:when>
1844     <xsl:when test="info/subtitle">
1845       <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/subtitle"/>
1846     </xsl:when>
1847     <xsl:when test="subtitle">
1848       <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="subtitle"/>
1849     </xsl:when>
1850   </xsl:choose>
1851
1852   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/corpauthor"/>
1853   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/corpauthor"/>
1854   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/authorgroup"/>
1855   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/authorgroup"/>
1856   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/author"/>
1857   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/author"/>
1858   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/othercredit"/>
1859   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/othercredit"/>
1860   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/releaseinfo"/>
1861   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/releaseinfo"/>
1862   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/copyright"/>
1863   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/copyright"/>
1864   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/legalnotice"/>
1865   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/legalnotice"/>
1866   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/pubdate"/>
1867   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/pubdate"/>
1868   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/revision"/>
1869   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/revision"/>
1870   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/revhistory"/>
1871   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/revhistory"/>
1872   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="topicinfo/abstract"/>
1873   <xsl:apply-templates mode="topic.titlepage.recto.auto.mode" select="info/abstract"/>
1874 </xsl:template>
1875
1876 <xsl:template name="topic.titlepage.verso">
1877 </xsl:template>
1878
1879 <xsl:template name="topic.titlepage.separator">
1880 </xsl:template>
1881
1882 <xsl:template name="topic.titlepage.before.recto">
1883 </xsl:template>
1884
1885 <xsl:template name="topic.titlepage.before.verso">
1886 </xsl:template>
1887
1888 <xsl:template name="topic.titlepage">
1889   <div class="titlepage">
1890     <xsl:variable name="recto.content">
1891       <xsl:call-template name="topic.titlepage.before.recto"/>
1892       <xsl:call-template name="topic.titlepage.recto"/>
1893     </xsl:variable>
1894     <xsl:variable name="recto.elements.count">
1895       <xsl:choose>
1896         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1897         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1898           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1899         <xsl:otherwise>1</xsl:otherwise>
1900       </xsl:choose>
1901     </xsl:variable>
1902     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
1903       <div><xsl:copy-of select="$recto.content"/></div>
1904     </xsl:if>
1905     <xsl:variable name="verso.content">
1906       <xsl:call-template name="topic.titlepage.before.verso"/>
1907       <xsl:call-template name="topic.titlepage.verso"/>
1908     </xsl:variable>
1909     <xsl:variable name="verso.elements.count">
1910       <xsl:choose>
1911         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1912         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1913           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1914         <xsl:otherwise>1</xsl:otherwise>
1915       </xsl:choose>
1916     </xsl:variable>
1917     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
1918       <div><xsl:copy-of select="$verso.content"/></div>
1919     </xsl:if>
1920     <xsl:call-template name="topic.titlepage.separator"/>
1921   </div>
1922 </xsl:template>
1923
1924 <xsl:template match="*" mode="topic.titlepage.recto.mode">
1925   <!-- if an element isn't found in this mode, -->
1926   <!-- try the generic titlepage.mode -->
1927   <xsl:apply-templates select="." mode="titlepage.mode"/>
1928 </xsl:template>
1929
1930 <xsl:template match="*" mode="topic.titlepage.verso.mode">
1931   <!-- if an element isn't found in this mode, -->
1932   <!-- try the generic titlepage.mode -->
1933   <xsl:apply-templates select="." mode="titlepage.mode"/>
1934 </xsl:template>
1935
1936 <xsl:template match="title" mode="topic.titlepage.recto.auto.mode">
1937 <div xsl:use-attribute-sets="topic.titlepage.recto.style">
1938 <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/>
1939 </div>
1940 </xsl:template>
1941
1942 <xsl:template match="subtitle" mode="topic.titlepage.recto.auto.mode">
1943 <div xsl:use-attribute-sets="topic.titlepage.recto.style">
1944 <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/>
1945 </div>
1946 </xsl:template>
1947
1948 <xsl:template match="corpauthor" mode="topic.titlepage.recto.auto.mode">
1949 <div xsl:use-attribute-sets="topic.titlepage.recto.style">
1950 <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/>
1951 </div>
1952 </xsl:template>
1953
1954 <xsl:template match="authorgroup" mode="topic.titlepage.recto.auto.mode">
1955 <div xsl:use-attribute-sets="topic.titlepage.recto.style">
1956 <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/>
1957 </div>
1958 </xsl:template>
1959
1960 <xsl:template match="author" mode="topic.titlepage.recto.auto.mode">
1961 <div xsl:use-attribute-sets="topic.titlepage.recto.style">
1962 <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/>
1963 </div>
1964 </xsl:template>
1965
1966 <xsl:template match="othercredit" mode="topic.titlepage.recto.auto.mode">
1967 <div xsl:use-attribute-sets="topic.titlepage.recto.style">
1968 <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/>
1969 </div>
1970 </xsl:template>
1971
1972 <xsl:template match="releaseinfo" mode="topic.titlepage.recto.auto.mode">
1973 <div xsl:use-attribute-sets="topic.titlepage.recto.style">
1974 <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/>
1975 </div>
1976 </xsl:template>
1977
1978 <xsl:template match="copyright" mode="topic.titlepage.recto.auto.mode">
1979 <div xsl:use-attribute-sets="topic.titlepage.recto.style">
1980 <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/>
1981 </div>
1982 </xsl:template>
1983
1984 <xsl:template match="legalnotice" mode="topic.titlepage.recto.auto.mode">
1985 <div xsl:use-attribute-sets="topic.titlepage.recto.style">
1986 <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/>
1987 </div>
1988 </xsl:template>
1989
1990 <xsl:template match="pubdate" mode="topic.titlepage.recto.auto.mode">
1991 <div xsl:use-attribute-sets="topic.titlepage.recto.style">
1992 <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/>
1993 </div>
1994 </xsl:template>
1995
1996 <xsl:template match="revision" mode="topic.titlepage.recto.auto.mode">
1997 <div xsl:use-attribute-sets="topic.titlepage.recto.style">
1998 <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/>
1999 </div>
2000 </xsl:template>
2001
2002 <xsl:template match="revhistory" mode="topic.titlepage.recto.auto.mode">
2003 <div xsl:use-attribute-sets="topic.titlepage.recto.style">
2004 <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/>
2005 </div>
2006 </xsl:template>
2007
2008 <xsl:template match="abstract" mode="topic.titlepage.recto.auto.mode">
2009 <div xsl:use-attribute-sets="topic.titlepage.recto.style">
2010 <xsl:apply-templates select="." mode="topic.titlepage.recto.mode"/>
2011 </div>
2012 </xsl:template>
2013
2014 <xsl:template name="appendix.titlepage.recto">
2015   <xsl:choose>
2016     <xsl:when test="appendixinfo/title">
2017       <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/title"/>
2018     </xsl:when>
2019     <xsl:when test="docinfo/title">
2020       <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/title"/>
2021     </xsl:when>
2022     <xsl:when test="info/title">
2023       <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/title"/>
2024     </xsl:when>
2025     <xsl:when test="title">
2026       <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="title"/>
2027     </xsl:when>
2028   </xsl:choose>
2029
2030   <xsl:choose>
2031     <xsl:when test="appendixinfo/subtitle">
2032       <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/subtitle"/>
2033     </xsl:when>
2034     <xsl:when test="docinfo/subtitle">
2035       <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
2036     </xsl:when>
2037     <xsl:when test="info/subtitle">
2038       <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/subtitle"/>
2039     </xsl:when>
2040     <xsl:when test="subtitle">
2041       <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="subtitle"/>
2042     </xsl:when>
2043   </xsl:choose>
2044
2045   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/corpauthor"/>
2046   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
2047   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/corpauthor"/>
2048   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/authorgroup"/>
2049   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
2050   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/authorgroup"/>
2051   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/author"/>
2052   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/author"/>
2053   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/author"/>
2054   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/othercredit"/>
2055   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
2056   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/othercredit"/>
2057   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/releaseinfo"/>
2058   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
2059   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/releaseinfo"/>
2060   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/copyright"/>
2061   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/copyright"/>
2062   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/copyright"/>
2063   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/legalnotice"/>
2064   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
2065   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/legalnotice"/>
2066   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/pubdate"/>
2067   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
2068   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/pubdate"/>
2069   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/revision"/>
2070   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/revision"/>
2071   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/revision"/>
2072   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/revhistory"/>
2073   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
2074   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/revhistory"/>
2075   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/abstract"/>
2076   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/abstract"/>
2077   <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/abstract"/>
2078 </xsl:template>
2079
2080 <xsl:template name="appendix.titlepage.verso">
2081 </xsl:template>
2082
2083 <xsl:template name="appendix.titlepage.separator">
2084 </xsl:template>
2085
2086 <xsl:template name="appendix.titlepage.before.recto">
2087 </xsl:template>
2088
2089 <xsl:template name="appendix.titlepage.before.verso">
2090 </xsl:template>
2091
2092 <xsl:template name="appendix.titlepage">
2093   <div class="titlepage">
2094     <xsl:variable name="recto.content">
2095       <xsl:call-template name="appendix.titlepage.before.recto"/>
2096       <xsl:call-template name="appendix.titlepage.recto"/>
2097     </xsl:variable>
2098     <xsl:variable name="recto.elements.count">
2099       <xsl:choose>
2100         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2101         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2102           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2103         <xsl:otherwise>1</xsl:otherwise>
2104       </xsl:choose>
2105     </xsl:variable>
2106     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
2107       <div><xsl:copy-of select="$recto.content"/></div>
2108     </xsl:if>
2109     <xsl:variable name="verso.content">
2110       <xsl:call-template name="appendix.titlepage.before.verso"/>
2111       <xsl:call-template name="appendix.titlepage.verso"/>
2112     </xsl:variable>
2113     <xsl:variable name="verso.elements.count">
2114       <xsl:choose>
2115         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2116         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2117           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2118         <xsl:otherwise>1</xsl:otherwise>
2119       </xsl:choose>
2120     </xsl:variable>
2121     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
2122       <div><xsl:copy-of select="$verso.content"/></div>
2123     </xsl:if>
2124     <xsl:call-template name="appendix.titlepage.separator"/>
2125   </div>
2126 </xsl:template>
2127
2128 <xsl:template match="*" mode="appendix.titlepage.recto.mode">
2129   <!-- if an element isn't found in this mode, -->
2130   <!-- try the generic titlepage.mode -->
2131   <xsl:apply-templates select="." mode="titlepage.mode"/>
2132 </xsl:template>
2133
2134 <xsl:template match="*" mode="appendix.titlepage.verso.mode">
2135   <!-- if an element isn't found in this mode, -->
2136   <!-- try the generic titlepage.mode -->
2137   <xsl:apply-templates select="." mode="titlepage.mode"/>
2138 </xsl:template>
2139
2140 <xsl:template match="title" mode="appendix.titlepage.recto.auto.mode">
2141 <div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2142 <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2143 </div>
2144 </xsl:template>
2145
2146 <xsl:template match="subtitle" mode="appendix.titlepage.recto.auto.mode">
2147 <div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2148 <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2149 </div>
2150 </xsl:template>
2151
2152 <xsl:template match="corpauthor" mode="appendix.titlepage.recto.auto.mode">
2153 <div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2154 <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2155 </div>
2156 </xsl:template>
2157
2158 <xsl:template match="authorgroup" mode="appendix.titlepage.recto.auto.mode">
2159 <div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2160 <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2161 </div>
2162 </xsl:template>
2163
2164 <xsl:template match="author" mode="appendix.titlepage.recto.auto.mode">
2165 <div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2166 <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2167 </div>
2168 </xsl:template>
2169
2170 <xsl:template match="othercredit" mode="appendix.titlepage.recto.auto.mode">
2171 <div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2172 <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2173 </div>
2174 </xsl:template>
2175
2176 <xsl:template match="releaseinfo" mode="appendix.titlepage.recto.auto.mode">
2177 <div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2178 <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2179 </div>
2180 </xsl:template>
2181
2182 <xsl:template match="copyright" mode="appendix.titlepage.recto.auto.mode">
2183 <div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2184 <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2185 </div>
2186 </xsl:template>
2187
2188 <xsl:template match="legalnotice" mode="appendix.titlepage.recto.auto.mode">
2189 <div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2190 <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2191 </div>
2192 </xsl:template>
2193
2194 <xsl:template match="pubdate" mode="appendix.titlepage.recto.auto.mode">
2195 <div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2196 <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2197 </div>
2198 </xsl:template>
2199
2200 <xsl:template match="revision" mode="appendix.titlepage.recto.auto.mode">
2201 <div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2202 <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2203 </div>
2204 </xsl:template>
2205
2206 <xsl:template match="revhistory" mode="appendix.titlepage.recto.auto.mode">
2207 <div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2208 <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2209 </div>
2210 </xsl:template>
2211
2212 <xsl:template match="abstract" mode="appendix.titlepage.recto.auto.mode">
2213 <div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2214 <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2215 </div>
2216 </xsl:template>
2217
2218 <xsl:template name="section.titlepage.recto">
2219   <xsl:choose>
2220     <xsl:when test="sectioninfo/title">
2221       <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/title"/>
2222     </xsl:when>
2223     <xsl:when test="info/title">
2224       <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/title"/>
2225     </xsl:when>
2226     <xsl:when test="title">
2227       <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="title"/>
2228     </xsl:when>
2229   </xsl:choose>
2230
2231   <xsl:choose>
2232     <xsl:when test="sectioninfo/subtitle">
2233       <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/subtitle"/>
2234     </xsl:when>
2235     <xsl:when test="info/subtitle">
2236       <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/subtitle"/>
2237     </xsl:when>
2238     <xsl:when test="subtitle">
2239       <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="subtitle"/>
2240     </xsl:when>
2241   </xsl:choose>
2242
2243   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/corpauthor"/>
2244   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/corpauthor"/>
2245   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/authorgroup"/>
2246   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/authorgroup"/>
2247   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/author"/>
2248   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/author"/>
2249   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/othercredit"/>
2250   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/othercredit"/>
2251   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/releaseinfo"/>
2252   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/releaseinfo"/>
2253   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/copyright"/>
2254   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/copyright"/>
2255   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/legalnotice"/>
2256   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/legalnotice"/>
2257   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/pubdate"/>
2258   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/pubdate"/>
2259   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/revision"/>
2260   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/revision"/>
2261   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/revhistory"/>
2262   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/revhistory"/>
2263   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/abstract"/>
2264   <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/abstract"/>
2265 </xsl:template>
2266
2267 <xsl:template name="section.titlepage.verso">
2268 </xsl:template>
2269
2270 <xsl:template name="section.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
2271 </xsl:template>
2272
2273 <xsl:template name="section.titlepage.before.recto">
2274 </xsl:template>
2275
2276 <xsl:template name="section.titlepage.before.verso">
2277 </xsl:template>
2278
2279 <xsl:template name="section.titlepage">
2280   <div class="titlepage">
2281     <xsl:variable name="recto.content">
2282       <xsl:call-template name="section.titlepage.before.recto"/>
2283       <xsl:call-template name="section.titlepage.recto"/>
2284     </xsl:variable>
2285     <xsl:variable name="recto.elements.count">
2286       <xsl:choose>
2287         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2288         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2289           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2290         <xsl:otherwise>1</xsl:otherwise>
2291       </xsl:choose>
2292     </xsl:variable>
2293     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
2294       <div><xsl:copy-of select="$recto.content"/></div>
2295     </xsl:if>
2296     <xsl:variable name="verso.content">
2297       <xsl:call-template name="section.titlepage.before.verso"/>
2298       <xsl:call-template name="section.titlepage.verso"/>
2299     </xsl:variable>
2300     <xsl:variable name="verso.elements.count">
2301       <xsl:choose>
2302         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2303         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2304           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2305         <xsl:otherwise>1</xsl:otherwise>
2306       </xsl:choose>
2307     </xsl:variable>
2308     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
2309       <div><xsl:copy-of select="$verso.content"/></div>
2310     </xsl:if>
2311     <xsl:call-template name="section.titlepage.separator"/>
2312   </div>
2313 </xsl:template>
2314
2315 <xsl:template match="*" mode="section.titlepage.recto.mode">
2316   <!-- if an element isn't found in this mode, -->
2317   <!-- try the generic titlepage.mode -->
2318   <xsl:apply-templates select="." mode="titlepage.mode"/>
2319 </xsl:template>
2320
2321 <xsl:template match="*" mode="section.titlepage.verso.mode">
2322   <!-- if an element isn't found in this mode, -->
2323   <!-- try the generic titlepage.mode -->
2324   <xsl:apply-templates select="." mode="titlepage.mode"/>
2325 </xsl:template>
2326
2327 <xsl:template match="title" mode="section.titlepage.recto.auto.mode">
2328 <div xsl:use-attribute-sets="section.titlepage.recto.style">
2329 <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2330 </div>
2331 </xsl:template>
2332
2333 <xsl:template match="subtitle" mode="section.titlepage.recto.auto.mode">
2334 <div xsl:use-attribute-sets="section.titlepage.recto.style">
2335 <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2336 </div>
2337 </xsl:template>
2338
2339 <xsl:template match="corpauthor" mode="section.titlepage.recto.auto.mode">
2340 <div xsl:use-attribute-sets="section.titlepage.recto.style">
2341 <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2342 </div>
2343 </xsl:template>
2344
2345 <xsl:template match="authorgroup" mode="section.titlepage.recto.auto.mode">
2346 <div xsl:use-attribute-sets="section.titlepage.recto.style">
2347 <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2348 </div>
2349 </xsl:template>
2350
2351 <xsl:template match="author" mode="section.titlepage.recto.auto.mode">
2352 <div xsl:use-attribute-sets="section.titlepage.recto.style">
2353 <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2354 </div>
2355 </xsl:template>
2356
2357 <xsl:template match="othercredit" mode="section.titlepage.recto.auto.mode">
2358 <div xsl:use-attribute-sets="section.titlepage.recto.style">
2359 <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2360 </div>
2361 </xsl:template>
2362
2363 <xsl:template match="releaseinfo" mode="section.titlepage.recto.auto.mode">
2364 <div xsl:use-attribute-sets="section.titlepage.recto.style">
2365 <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2366 </div>
2367 </xsl:template>
2368
2369 <xsl:template match="copyright" mode="section.titlepage.recto.auto.mode">
2370 <div xsl:use-attribute-sets="section.titlepage.recto.style">
2371 <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2372 </div>
2373 </xsl:template>
2374
2375 <xsl:template match="legalnotice" mode="section.titlepage.recto.auto.mode">
2376 <div xsl:use-attribute-sets="section.titlepage.recto.style">
2377 <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2378 </div>
2379 </xsl:template>
2380
2381 <xsl:template match="pubdate" mode="section.titlepage.recto.auto.mode">
2382 <div xsl:use-attribute-sets="section.titlepage.recto.style">
2383 <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2384 </div>
2385 </xsl:template>
2386
2387 <xsl:template match="revision" mode="section.titlepage.recto.auto.mode">
2388 <div xsl:use-attribute-sets="section.titlepage.recto.style">
2389 <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2390 </div>
2391 </xsl:template>
2392
2393 <xsl:template match="revhistory" mode="section.titlepage.recto.auto.mode">
2394 <div xsl:use-attribute-sets="section.titlepage.recto.style">
2395 <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2396 </div>
2397 </xsl:template>
2398
2399 <xsl:template match="abstract" mode="section.titlepage.recto.auto.mode">
2400 <div xsl:use-attribute-sets="section.titlepage.recto.style">
2401 <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2402 </div>
2403 </xsl:template>
2404
2405 <xsl:template name="sect1.titlepage.recto">
2406   <xsl:choose>
2407     <xsl:when test="sect1info/title">
2408       <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/title"/>
2409     </xsl:when>
2410     <xsl:when test="info/title">
2411       <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/title"/>
2412     </xsl:when>
2413     <xsl:when test="title">
2414       <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="title"/>
2415     </xsl:when>
2416   </xsl:choose>
2417
2418   <xsl:choose>
2419     <xsl:when test="sect1info/subtitle">
2420       <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/subtitle"/>
2421     </xsl:when>
2422     <xsl:when test="info/subtitle">
2423       <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/subtitle"/>
2424     </xsl:when>
2425     <xsl:when test="subtitle">
2426       <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="subtitle"/>
2427     </xsl:when>
2428   </xsl:choose>
2429
2430   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/corpauthor"/>
2431   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/corpauthor"/>
2432   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/authorgroup"/>
2433   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/authorgroup"/>
2434   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/author"/>
2435   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/author"/>
2436   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/othercredit"/>
2437   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/othercredit"/>
2438   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/releaseinfo"/>
2439   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/releaseinfo"/>
2440   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/copyright"/>
2441   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/copyright"/>
2442   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/legalnotice"/>
2443   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/legalnotice"/>
2444   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/pubdate"/>
2445   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/pubdate"/>
2446   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/revision"/>
2447   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/revision"/>
2448   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/revhistory"/>
2449   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/revhistory"/>
2450   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/abstract"/>
2451   <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/abstract"/>
2452 </xsl:template>
2453
2454 <xsl:template name="sect1.titlepage.verso">
2455 </xsl:template>
2456
2457 <xsl:template name="sect1.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
2458 </xsl:template>
2459
2460 <xsl:template name="sect1.titlepage.before.recto">
2461 </xsl:template>
2462
2463 <xsl:template name="sect1.titlepage.before.verso">
2464 </xsl:template>
2465
2466 <xsl:template name="sect1.titlepage">
2467   <div class="titlepage">
2468     <xsl:variable name="recto.content">
2469       <xsl:call-template name="sect1.titlepage.before.recto"/>
2470       <xsl:call-template name="sect1.titlepage.recto"/>
2471     </xsl:variable>
2472     <xsl:variable name="recto.elements.count">
2473       <xsl:choose>
2474         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2475         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2476           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2477         <xsl:otherwise>1</xsl:otherwise>
2478       </xsl:choose>
2479     </xsl:variable>
2480     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
2481       <div><xsl:copy-of select="$recto.content"/></div>
2482     </xsl:if>
2483     <xsl:variable name="verso.content">
2484       <xsl:call-template name="sect1.titlepage.before.verso"/>
2485       <xsl:call-template name="sect1.titlepage.verso"/>
2486     </xsl:variable>
2487     <xsl:variable name="verso.elements.count">
2488       <xsl:choose>
2489         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2490         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2491           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2492         <xsl:otherwise>1</xsl:otherwise>
2493       </xsl:choose>
2494     </xsl:variable>
2495     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
2496       <div><xsl:copy-of select="$verso.content"/></div>
2497     </xsl:if>
2498     <xsl:call-template name="sect1.titlepage.separator"/>
2499   </div>
2500 </xsl:template>
2501
2502 <xsl:template match="*" mode="sect1.titlepage.recto.mode">
2503   <!-- if an element isn't found in this mode, -->
2504   <!-- try the generic titlepage.mode -->
2505   <xsl:apply-templates select="." mode="titlepage.mode"/>
2506 </xsl:template>
2507
2508 <xsl:template match="*" mode="sect1.titlepage.verso.mode">
2509   <!-- if an element isn't found in this mode, -->
2510   <!-- try the generic titlepage.mode -->
2511   <xsl:apply-templates select="." mode="titlepage.mode"/>
2512 </xsl:template>
2513
2514 <xsl:template match="title" mode="sect1.titlepage.recto.auto.mode">
2515 <div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2516 <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2517 </div>
2518 </xsl:template>
2519
2520 <xsl:template match="subtitle" mode="sect1.titlepage.recto.auto.mode">
2521 <div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2522 <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2523 </div>
2524 </xsl:template>
2525
2526 <xsl:template match="corpauthor" mode="sect1.titlepage.recto.auto.mode">
2527 <div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2528 <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2529 </div>
2530 </xsl:template>
2531
2532 <xsl:template match="authorgroup" mode="sect1.titlepage.recto.auto.mode">
2533 <div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2534 <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2535 </div>
2536 </xsl:template>
2537
2538 <xsl:template match="author" mode="sect1.titlepage.recto.auto.mode">
2539 <div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2540 <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2541 </div>
2542 </xsl:template>
2543
2544 <xsl:template match="othercredit" mode="sect1.titlepage.recto.auto.mode">
2545 <div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2546 <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2547 </div>
2548 </xsl:template>
2549
2550 <xsl:template match="releaseinfo" mode="sect1.titlepage.recto.auto.mode">
2551 <div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2552 <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2553 </div>
2554 </xsl:template>
2555
2556 <xsl:template match="copyright" mode="sect1.titlepage.recto.auto.mode">
2557 <div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2558 <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2559 </div>
2560 </xsl:template>
2561
2562 <xsl:template match="legalnotice" mode="sect1.titlepage.recto.auto.mode">
2563 <div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2564 <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2565 </div>
2566 </xsl:template>
2567
2568 <xsl:template match="pubdate" mode="sect1.titlepage.recto.auto.mode">
2569 <div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2570 <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2571 </div>
2572 </xsl:template>
2573
2574 <xsl:template match="revision" mode="sect1.titlepage.recto.auto.mode">
2575 <div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2576 <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2577 </div>
2578 </xsl:template>
2579
2580 <xsl:template match="revhistory" mode="sect1.titlepage.recto.auto.mode">
2581 <div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2582 <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2583 </div>
2584 </xsl:template>
2585
2586 <xsl:template match="abstract" mode="sect1.titlepage.recto.auto.mode">
2587 <div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2588 <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2589 </div>
2590 </xsl:template>
2591
2592 <xsl:template name="sect2.titlepage.recto">
2593   <xsl:choose>
2594     <xsl:when test="sect2info/title">
2595       <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/title"/>
2596     </xsl:when>
2597     <xsl:when test="info/title">
2598       <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/title"/>
2599     </xsl:when>
2600     <xsl:when test="title">
2601       <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="title"/>
2602     </xsl:when>
2603   </xsl:choose>
2604
2605   <xsl:choose>
2606     <xsl:when test="sect2info/subtitle">
2607       <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/subtitle"/>
2608     </xsl:when>
2609     <xsl:when test="info/subtitle">
2610       <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/subtitle"/>
2611     </xsl:when>
2612     <xsl:when test="subtitle">
2613       <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="subtitle"/>
2614     </xsl:when>
2615   </xsl:choose>
2616
2617   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/corpauthor"/>
2618   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/corpauthor"/>
2619   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/authorgroup"/>
2620   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/authorgroup"/>
2621   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/author"/>
2622   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/author"/>
2623   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/othercredit"/>
2624   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/othercredit"/>
2625   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/releaseinfo"/>
2626   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/releaseinfo"/>
2627   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/copyright"/>
2628   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/copyright"/>
2629   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/legalnotice"/>
2630   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/legalnotice"/>
2631   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/pubdate"/>
2632   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/pubdate"/>
2633   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/revision"/>
2634   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/revision"/>
2635   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/revhistory"/>
2636   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/revhistory"/>
2637   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/abstract"/>
2638   <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/abstract"/>
2639 </xsl:template>
2640
2641 <xsl:template name="sect2.titlepage.verso">
2642 </xsl:template>
2643
2644 <xsl:template name="sect2.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
2645 </xsl:template>
2646
2647 <xsl:template name="sect2.titlepage.before.recto">
2648 </xsl:template>
2649
2650 <xsl:template name="sect2.titlepage.before.verso">
2651 </xsl:template>
2652
2653 <xsl:template name="sect2.titlepage">
2654   <div class="titlepage">
2655     <xsl:variable name="recto.content">
2656       <xsl:call-template name="sect2.titlepage.before.recto"/>
2657       <xsl:call-template name="sect2.titlepage.recto"/>
2658     </xsl:variable>
2659     <xsl:variable name="recto.elements.count">
2660       <xsl:choose>
2661         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2662         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2663           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2664         <xsl:otherwise>1</xsl:otherwise>
2665       </xsl:choose>
2666     </xsl:variable>
2667     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
2668       <div><xsl:copy-of select="$recto.content"/></div>
2669     </xsl:if>
2670     <xsl:variable name="verso.content">
2671       <xsl:call-template name="sect2.titlepage.before.verso"/>
2672       <xsl:call-template name="sect2.titlepage.verso"/>
2673     </xsl:variable>
2674     <xsl:variable name="verso.elements.count">
2675       <xsl:choose>
2676         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2677         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2678           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2679         <xsl:otherwise>1</xsl:otherwise>
2680       </xsl:choose>
2681     </xsl:variable>
2682     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
2683       <div><xsl:copy-of select="$verso.content"/></div>
2684     </xsl:if>
2685     <xsl:call-template name="sect2.titlepage.separator"/>
2686   </div>
2687 </xsl:template>
2688
2689 <xsl:template match="*" mode="sect2.titlepage.recto.mode">
2690   <!-- if an element isn't found in this mode, -->
2691   <!-- try the generic titlepage.mode -->
2692   <xsl:apply-templates select="." mode="titlepage.mode"/>
2693 </xsl:template>
2694
2695 <xsl:template match="*" mode="sect2.titlepage.verso.mode">
2696   <!-- if an element isn't found in this mode, -->
2697   <!-- try the generic titlepage.mode -->
2698   <xsl:apply-templates select="." mode="titlepage.mode"/>
2699 </xsl:template>
2700
2701 <xsl:template match="title" mode="sect2.titlepage.recto.auto.mode">
2702 <div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2703 <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2704 </div>
2705 </xsl:template>
2706
2707 <xsl:template match="subtitle" mode="sect2.titlepage.recto.auto.mode">
2708 <div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2709 <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2710 </div>
2711 </xsl:template>
2712
2713 <xsl:template match="corpauthor" mode="sect2.titlepage.recto.auto.mode">
2714 <div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2715 <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2716 </div>
2717 </xsl:template>
2718
2719 <xsl:template match="authorgroup" mode="sect2.titlepage.recto.auto.mode">
2720 <div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2721 <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2722 </div>
2723 </xsl:template>
2724
2725 <xsl:template match="author" mode="sect2.titlepage.recto.auto.mode">
2726 <div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2727 <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2728 </div>
2729 </xsl:template>
2730
2731 <xsl:template match="othercredit" mode="sect2.titlepage.recto.auto.mode">
2732 <div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2733 <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2734 </div>
2735 </xsl:template>
2736
2737 <xsl:template match="releaseinfo" mode="sect2.titlepage.recto.auto.mode">
2738 <div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2739 <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2740 </div>
2741 </xsl:template>
2742
2743 <xsl:template match="copyright" mode="sect2.titlepage.recto.auto.mode">
2744 <div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2745 <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2746 </div>
2747 </xsl:template>
2748
2749 <xsl:template match="legalnotice" mode="sect2.titlepage.recto.auto.mode">
2750 <div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2751 <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2752 </div>
2753 </xsl:template>
2754
2755 <xsl:template match="pubdate" mode="sect2.titlepage.recto.auto.mode">
2756 <div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2757 <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2758 </div>
2759 </xsl:template>
2760
2761 <xsl:template match="revision" mode="sect2.titlepage.recto.auto.mode">
2762 <div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2763 <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2764 </div>
2765 </xsl:template>
2766
2767 <xsl:template match="revhistory" mode="sect2.titlepage.recto.auto.mode">
2768 <div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2769 <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2770 </div>
2771 </xsl:template>
2772
2773 <xsl:template match="abstract" mode="sect2.titlepage.recto.auto.mode">
2774 <div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2775 <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2776 </div>
2777 </xsl:template>
2778
2779 <xsl:template name="sect3.titlepage.recto">
2780   <xsl:choose>
2781     <xsl:when test="sect3info/title">
2782       <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/title"/>
2783     </xsl:when>
2784     <xsl:when test="info/title">
2785       <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/title"/>
2786     </xsl:when>
2787     <xsl:when test="title">
2788       <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="title"/>
2789     </xsl:when>
2790   </xsl:choose>
2791
2792   <xsl:choose>
2793     <xsl:when test="sect3info/subtitle">
2794       <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/subtitle"/>
2795     </xsl:when>
2796     <xsl:when test="info/subtitle">
2797       <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/subtitle"/>
2798     </xsl:when>
2799     <xsl:when test="subtitle">
2800       <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="subtitle"/>
2801     </xsl:when>
2802   </xsl:choose>
2803
2804   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/corpauthor"/>
2805   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/corpauthor"/>
2806   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/authorgroup"/>
2807   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/authorgroup"/>
2808   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/author"/>
2809   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/author"/>
2810   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/othercredit"/>
2811   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/othercredit"/>
2812   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/releaseinfo"/>
2813   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/releaseinfo"/>
2814   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/copyright"/>
2815   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/copyright"/>
2816   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/legalnotice"/>
2817   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/legalnotice"/>
2818   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/pubdate"/>
2819   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/pubdate"/>
2820   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/revision"/>
2821   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/revision"/>
2822   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/revhistory"/>
2823   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/revhistory"/>
2824   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/abstract"/>
2825   <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/abstract"/>
2826 </xsl:template>
2827
2828 <xsl:template name="sect3.titlepage.verso">
2829 </xsl:template>
2830
2831 <xsl:template name="sect3.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
2832 </xsl:template>
2833
2834 <xsl:template name="sect3.titlepage.before.recto">
2835 </xsl:template>
2836
2837 <xsl:template name="sect3.titlepage.before.verso">
2838 </xsl:template>
2839
2840 <xsl:template name="sect3.titlepage">
2841   <div class="titlepage">
2842     <xsl:variable name="recto.content">
2843       <xsl:call-template name="sect3.titlepage.before.recto"/>
2844       <xsl:call-template name="sect3.titlepage.recto"/>
2845     </xsl:variable>
2846     <xsl:variable name="recto.elements.count">
2847       <xsl:choose>
2848         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2849         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2850           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2851         <xsl:otherwise>1</xsl:otherwise>
2852       </xsl:choose>
2853     </xsl:variable>
2854     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
2855       <div><xsl:copy-of select="$recto.content"/></div>
2856     </xsl:if>
2857     <xsl:variable name="verso.content">
2858       <xsl:call-template name="sect3.titlepage.before.verso"/>
2859       <xsl:call-template name="sect3.titlepage.verso"/>
2860     </xsl:variable>
2861     <xsl:variable name="verso.elements.count">
2862       <xsl:choose>
2863         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2864         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2865           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2866         <xsl:otherwise>1</xsl:otherwise>
2867       </xsl:choose>
2868     </xsl:variable>
2869     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
2870       <div><xsl:copy-of select="$verso.content"/></div>
2871     </xsl:if>
2872     <xsl:call-template name="sect3.titlepage.separator"/>
2873   </div>
2874 </xsl:template>
2875
2876 <xsl:template match="*" mode="sect3.titlepage.recto.mode">
2877   <!-- if an element isn't found in this mode, -->
2878   <!-- try the generic titlepage.mode -->
2879   <xsl:apply-templates select="." mode="titlepage.mode"/>
2880 </xsl:template>
2881
2882 <xsl:template match="*" mode="sect3.titlepage.verso.mode">
2883   <!-- if an element isn't found in this mode, -->
2884   <!-- try the generic titlepage.mode -->
2885   <xsl:apply-templates select="." mode="titlepage.mode"/>
2886 </xsl:template>
2887
2888 <xsl:template match="title" mode="sect3.titlepage.recto.auto.mode">
2889 <div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2890 <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2891 </div>
2892 </xsl:template>
2893
2894 <xsl:template match="subtitle" mode="sect3.titlepage.recto.auto.mode">
2895 <div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2896 <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2897 </div>
2898 </xsl:template>
2899
2900 <xsl:template match="corpauthor" mode="sect3.titlepage.recto.auto.mode">
2901 <div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2902 <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2903 </div>
2904 </xsl:template>
2905
2906 <xsl:template match="authorgroup" mode="sect3.titlepage.recto.auto.mode">
2907 <div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2908 <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2909 </div>
2910 </xsl:template>
2911
2912 <xsl:template match="author" mode="sect3.titlepage.recto.auto.mode">
2913 <div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2914 <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2915 </div>
2916 </xsl:template>
2917
2918 <xsl:template match="othercredit" mode="sect3.titlepage.recto.auto.mode">
2919 <div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2920 <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2921 </div>
2922 </xsl:template>
2923
2924 <xsl:template match="releaseinfo" mode="sect3.titlepage.recto.auto.mode">
2925 <div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2926 <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2927 </div>
2928 </xsl:template>
2929
2930 <xsl:template match="copyright" mode="sect3.titlepage.recto.auto.mode">
2931 <div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2932 <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2933 </div>
2934 </xsl:template>
2935
2936 <xsl:template match="legalnotice" mode="sect3.titlepage.recto.auto.mode">
2937 <div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2938 <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2939 </div>
2940 </xsl:template>
2941
2942 <xsl:template match="pubdate" mode="sect3.titlepage.recto.auto.mode">
2943 <div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2944 <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2945 </div>
2946 </xsl:template>
2947
2948 <xsl:template match="revision" mode="sect3.titlepage.recto.auto.mode">
2949 <div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2950 <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2951 </div>
2952 </xsl:template>
2953
2954 <xsl:template match="revhistory" mode="sect3.titlepage.recto.auto.mode">
2955 <div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2956 <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2957 </div>
2958 </xsl:template>
2959
2960 <xsl:template match="abstract" mode="sect3.titlepage.recto.auto.mode">
2961 <div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2962 <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2963 </div>
2964 </xsl:template>
2965
2966 <xsl:template name="sect4.titlepage.recto">
2967   <xsl:choose>
2968     <xsl:when test="sect4info/title">
2969       <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/title"/>
2970     </xsl:when>
2971     <xsl:when test="info/title">
2972       <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/title"/>
2973     </xsl:when>
2974     <xsl:when test="title">
2975       <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="title"/>
2976     </xsl:when>
2977   </xsl:choose>
2978
2979   <xsl:choose>
2980     <xsl:when test="sect4info/subtitle">
2981       <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/subtitle"/>
2982     </xsl:when>
2983     <xsl:when test="info/subtitle">
2984       <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/subtitle"/>
2985     </xsl:when>
2986     <xsl:when test="subtitle">
2987       <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="subtitle"/>
2988     </xsl:when>
2989   </xsl:choose>
2990
2991   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/corpauthor"/>
2992   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/corpauthor"/>
2993   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/authorgroup"/>
2994   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/authorgroup"/>
2995   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/author"/>
2996   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/author"/>
2997   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/othercredit"/>
2998   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/othercredit"/>
2999   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/releaseinfo"/>
3000   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/releaseinfo"/>
3001   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/copyright"/>
3002   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/copyright"/>
3003   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/legalnotice"/>
3004   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/legalnotice"/>
3005   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/pubdate"/>
3006   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/pubdate"/>
3007   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/revision"/>
3008   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/revision"/>
3009   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/revhistory"/>
3010   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/revhistory"/>
3011   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/abstract"/>
3012   <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/abstract"/>
3013 </xsl:template>
3014
3015 <xsl:template name="sect4.titlepage.verso">
3016 </xsl:template>
3017
3018 <xsl:template name="sect4.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
3019 </xsl:template>
3020
3021 <xsl:template name="sect4.titlepage.before.recto">
3022 </xsl:template>
3023
3024 <xsl:template name="sect4.titlepage.before.verso">
3025 </xsl:template>
3026
3027 <xsl:template name="sect4.titlepage">
3028   <div class="titlepage">
3029     <xsl:variable name="recto.content">
3030       <xsl:call-template name="sect4.titlepage.before.recto"/>
3031       <xsl:call-template name="sect4.titlepage.recto"/>
3032     </xsl:variable>
3033     <xsl:variable name="recto.elements.count">
3034       <xsl:choose>
3035         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3036         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3037           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3038         <xsl:otherwise>1</xsl:otherwise>
3039       </xsl:choose>
3040     </xsl:variable>
3041     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
3042       <div><xsl:copy-of select="$recto.content"/></div>
3043     </xsl:if>
3044     <xsl:variable name="verso.content">
3045       <xsl:call-template name="sect4.titlepage.before.verso"/>
3046       <xsl:call-template name="sect4.titlepage.verso"/>
3047     </xsl:variable>
3048     <xsl:variable name="verso.elements.count">
3049       <xsl:choose>
3050         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3051         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3052           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3053         <xsl:otherwise>1</xsl:otherwise>
3054       </xsl:choose>
3055     </xsl:variable>
3056     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
3057       <div><xsl:copy-of select="$verso.content"/></div>
3058     </xsl:if>
3059     <xsl:call-template name="sect4.titlepage.separator"/>
3060   </div>
3061 </xsl:template>
3062
3063 <xsl:template match="*" mode="sect4.titlepage.recto.mode">
3064   <!-- if an element isn't found in this mode, -->
3065   <!-- try the generic titlepage.mode -->
3066   <xsl:apply-templates select="." mode="titlepage.mode"/>
3067 </xsl:template>
3068
3069 <xsl:template match="*" mode="sect4.titlepage.verso.mode">
3070   <!-- if an element isn't found in this mode, -->
3071   <!-- try the generic titlepage.mode -->
3072   <xsl:apply-templates select="." mode="titlepage.mode"/>
3073 </xsl:template>
3074
3075 <xsl:template match="title" mode="sect4.titlepage.recto.auto.mode">
3076 <div xsl:use-attribute-sets="sect4.titlepage.recto.style">
3077 <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
3078 </div>
3079 </xsl:template>
3080
3081 <xsl:template match="subtitle" mode="sect4.titlepage.recto.auto.mode">
3082 <div xsl:use-attribute-sets="sect4.titlepage.recto.style">
3083 <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
3084 </div>
3085 </xsl:template>
3086
3087 <xsl:template match="corpauthor" mode="sect4.titlepage.recto.auto.mode">
3088 <div xsl:use-attribute-sets="sect4.titlepage.recto.style">
3089 <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
3090 </div>
3091 </xsl:template>
3092
3093 <xsl:template match="authorgroup" mode="sect4.titlepage.recto.auto.mode">
3094 <div xsl:use-attribute-sets="sect4.titlepage.recto.style">
3095 <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
3096 </div>
3097 </xsl:template>
3098
3099 <xsl:template match="author" mode="sect4.titlepage.recto.auto.mode">
3100 <div xsl:use-attribute-sets="sect4.titlepage.recto.style">
3101 <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
3102 </div>
3103 </xsl:template>
3104
3105 <xsl:template match="othercredit" mode="sect4.titlepage.recto.auto.mode">
3106 <div xsl:use-attribute-sets="sect4.titlepage.recto.style">
3107 <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
3108 </div>
3109 </xsl:template>
3110
3111 <xsl:template match="releaseinfo" mode="sect4.titlepage.recto.auto.mode">
3112 <div xsl:use-attribute-sets="sect4.titlepage.recto.style">
3113 <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
3114 </div>
3115 </xsl:template>
3116
3117 <xsl:template match="copyright" mode="sect4.titlepage.recto.auto.mode">
3118 <div xsl:use-attribute-sets="sect4.titlepage.recto.style">
3119 <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
3120 </div>
3121 </xsl:template>
3122
3123 <xsl:template match="legalnotice" mode="sect4.titlepage.recto.auto.mode">
3124 <div xsl:use-attribute-sets="sect4.titlepage.recto.style">
3125 <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
3126 </div>
3127 </xsl:template>
3128
3129 <xsl:template match="pubdate" mode="sect4.titlepage.recto.auto.mode">
3130 <div xsl:use-attribute-sets="sect4.titlepage.recto.style">
3131 <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
3132 </div>
3133 </xsl:template>
3134
3135 <xsl:template match="revision" mode="sect4.titlepage.recto.auto.mode">
3136 <div xsl:use-attribute-sets="sect4.titlepage.recto.style">
3137 <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
3138 </div>
3139 </xsl:template>
3140
3141 <xsl:template match="revhistory" mode="sect4.titlepage.recto.auto.mode">
3142 <div xsl:use-attribute-sets="sect4.titlepage.recto.style">
3143 <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
3144 </div>
3145 </xsl:template>
3146
3147 <xsl:template match="abstract" mode="sect4.titlepage.recto.auto.mode">
3148 <div xsl:use-attribute-sets="sect4.titlepage.recto.style">
3149 <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
3150 </div>
3151 </xsl:template>
3152
3153 <xsl:template name="sect5.titlepage.recto">
3154   <xsl:choose>
3155     <xsl:when test="sect5info/title">
3156       <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/title"/>
3157     </xsl:when>
3158     <xsl:when test="info/title">
3159       <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/title"/>
3160     </xsl:when>
3161     <xsl:when test="title">
3162       <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="title"/>
3163     </xsl:when>
3164   </xsl:choose>
3165
3166   <xsl:choose>
3167     <xsl:when test="sect5info/subtitle">
3168       <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/subtitle"/>
3169     </xsl:when>
3170     <xsl:when test="info/subtitle">
3171       <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/subtitle"/>
3172     </xsl:when>
3173     <xsl:when test="subtitle">
3174       <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="subtitle"/>
3175     </xsl:when>
3176   </xsl:choose>
3177
3178   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/corpauthor"/>
3179   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/corpauthor"/>
3180   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/authorgroup"/>
3181   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/authorgroup"/>
3182   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/author"/>
3183   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/author"/>
3184   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/othercredit"/>
3185   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/othercredit"/>
3186   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/releaseinfo"/>
3187   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/releaseinfo"/>
3188   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/copyright"/>
3189   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/copyright"/>
3190   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/legalnotice"/>
3191   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/legalnotice"/>
3192   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/pubdate"/>
3193   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/pubdate"/>
3194   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/revision"/>
3195   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/revision"/>
3196   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/revhistory"/>
3197   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/revhistory"/>
3198   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/abstract"/>
3199   <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/abstract"/>
3200 </xsl:template>
3201
3202 <xsl:template name="sect5.titlepage.verso">
3203 </xsl:template>
3204
3205 <xsl:template name="sect5.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
3206 </xsl:template>
3207
3208 <xsl:template name="sect5.titlepage.before.recto">
3209 </xsl:template>
3210
3211 <xsl:template name="sect5.titlepage.before.verso">
3212 </xsl:template>
3213
3214 <xsl:template name="sect5.titlepage">
3215   <div class="titlepage">
3216     <xsl:variable name="recto.content">
3217       <xsl:call-template name="sect5.titlepage.before.recto"/>
3218       <xsl:call-template name="sect5.titlepage.recto"/>
3219     </xsl:variable>
3220     <xsl:variable name="recto.elements.count">
3221       <xsl:choose>
3222         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3223         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3224           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3225         <xsl:otherwise>1</xsl:otherwise>
3226       </xsl:choose>
3227     </xsl:variable>
3228     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
3229       <div><xsl:copy-of select="$recto.content"/></div>
3230     </xsl:if>
3231     <xsl:variable name="verso.content">
3232       <xsl:call-template name="sect5.titlepage.before.verso"/>
3233       <xsl:call-template name="sect5.titlepage.verso"/>
3234     </xsl:variable>
3235     <xsl:variable name="verso.elements.count">
3236       <xsl:choose>
3237         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3238         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3239           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3240         <xsl:otherwise>1</xsl:otherwise>
3241       </xsl:choose>
3242     </xsl:variable>
3243     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
3244       <div><xsl:copy-of select="$verso.content"/></div>
3245     </xsl:if>
3246     <xsl:call-template name="sect5.titlepage.separator"/>
3247   </div>
3248 </xsl:template>
3249
3250 <xsl:template match="*" mode="sect5.titlepage.recto.mode">
3251   <!-- if an element isn't found in this mode, -->
3252   <!-- try the generic titlepage.mode -->
3253   <xsl:apply-templates select="." mode="titlepage.mode"/>
3254 </xsl:template>
3255
3256 <xsl:template match="*" mode="sect5.titlepage.verso.mode">
3257   <!-- if an element isn't found in this mode, -->
3258   <!-- try the generic titlepage.mode -->
3259   <xsl:apply-templates select="." mode="titlepage.mode"/>
3260 </xsl:template>
3261
3262 <xsl:template match="title" mode="sect5.titlepage.recto.auto.mode">
3263 <div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3264 <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3265 </div>
3266 </xsl:template>
3267
3268 <xsl:template match="subtitle" mode="sect5.titlepage.recto.auto.mode">
3269 <div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3270 <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3271 </div>
3272 </xsl:template>
3273
3274 <xsl:template match="corpauthor" mode="sect5.titlepage.recto.auto.mode">
3275 <div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3276 <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3277 </div>
3278 </xsl:template>
3279
3280 <xsl:template match="authorgroup" mode="sect5.titlepage.recto.auto.mode">
3281 <div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3282 <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3283 </div>
3284 </xsl:template>
3285
3286 <xsl:template match="author" mode="sect5.titlepage.recto.auto.mode">
3287 <div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3288 <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3289 </div>
3290 </xsl:template>
3291
3292 <xsl:template match="othercredit" mode="sect5.titlepage.recto.auto.mode">
3293 <div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3294 <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3295 </div>
3296 </xsl:template>
3297
3298 <xsl:template match="releaseinfo" mode="sect5.titlepage.recto.auto.mode">
3299 <div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3300 <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3301 </div>
3302 </xsl:template>
3303
3304 <xsl:template match="copyright" mode="sect5.titlepage.recto.auto.mode">
3305 <div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3306 <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3307 </div>
3308 </xsl:template>
3309
3310 <xsl:template match="legalnotice" mode="sect5.titlepage.recto.auto.mode">
3311 <div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3312 <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3313 </div>
3314 </xsl:template>
3315
3316 <xsl:template match="pubdate" mode="sect5.titlepage.recto.auto.mode">
3317 <div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3318 <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3319 </div>
3320 </xsl:template>
3321
3322 <xsl:template match="revision" mode="sect5.titlepage.recto.auto.mode">
3323 <div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3324 <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3325 </div>
3326 </xsl:template>
3327
3328 <xsl:template match="revhistory" mode="sect5.titlepage.recto.auto.mode">
3329 <div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3330 <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3331 </div>
3332 </xsl:template>
3333
3334 <xsl:template match="abstract" mode="sect5.titlepage.recto.auto.mode">
3335 <div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3336 <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3337 </div>
3338 </xsl:template>
3339
3340 <xsl:template name="simplesect.titlepage.recto">
3341   <xsl:choose>
3342     <xsl:when test="simplesectinfo/title">
3343       <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/title"/>
3344     </xsl:when>
3345     <xsl:when test="docinfo/title">
3346       <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/title"/>
3347     </xsl:when>
3348     <xsl:when test="info/title">
3349       <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/title"/>
3350     </xsl:when>
3351     <xsl:when test="title">
3352       <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="title"/>
3353     </xsl:when>
3354   </xsl:choose>
3355
3356   <xsl:choose>
3357     <xsl:when test="simplesectinfo/subtitle">
3358       <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/subtitle"/>
3359     </xsl:when>
3360     <xsl:when test="docinfo/subtitle">
3361       <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
3362     </xsl:when>
3363     <xsl:when test="info/subtitle">
3364       <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/subtitle"/>
3365     </xsl:when>
3366     <xsl:when test="subtitle">
3367       <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="subtitle"/>
3368     </xsl:when>
3369   </xsl:choose>
3370
3371   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/corpauthor"/>
3372   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
3373   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/corpauthor"/>
3374   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/authorgroup"/>
3375   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
3376   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/authorgroup"/>
3377   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/author"/>
3378   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/author"/>
3379   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/author"/>
3380   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/othercredit"/>
3381   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
3382   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/othercredit"/>
3383   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/releaseinfo"/>
3384   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
3385   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/releaseinfo"/>
3386   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/copyright"/>
3387   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/copyright"/>
3388   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/copyright"/>
3389   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/legalnotice"/>
3390   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
3391   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/legalnotice"/>
3392   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/pubdate"/>
3393   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
3394   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/pubdate"/>
3395   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/revision"/>
3396   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/revision"/>
3397   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/revision"/>
3398   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/revhistory"/>
3399   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
3400   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/revhistory"/>
3401   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/abstract"/>
3402   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/abstract"/>
3403   <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/abstract"/>
3404 </xsl:template>
3405
3406 <xsl:template name="simplesect.titlepage.verso">
3407 </xsl:template>
3408
3409 <xsl:template name="simplesect.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
3410 </xsl:template>
3411
3412 <xsl:template name="simplesect.titlepage.before.recto">
3413 </xsl:template>
3414
3415 <xsl:template name="simplesect.titlepage.before.verso">
3416 </xsl:template>
3417
3418 <xsl:template name="simplesect.titlepage">
3419   <div class="titlepage">
3420     <xsl:variable name="recto.content">
3421       <xsl:call-template name="simplesect.titlepage.before.recto"/>
3422       <xsl:call-template name="simplesect.titlepage.recto"/>
3423     </xsl:variable>
3424     <xsl:variable name="recto.elements.count">
3425       <xsl:choose>
3426         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3427         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3428           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3429         <xsl:otherwise>1</xsl:otherwise>
3430       </xsl:choose>
3431     </xsl:variable>
3432     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
3433       <div><xsl:copy-of select="$recto.content"/></div>
3434     </xsl:if>
3435     <xsl:variable name="verso.content">
3436       <xsl:call-template name="simplesect.titlepage.before.verso"/>
3437       <xsl:call-template name="simplesect.titlepage.verso"/>
3438     </xsl:variable>
3439     <xsl:variable name="verso.elements.count">
3440       <xsl:choose>
3441         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3442         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3443           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3444         <xsl:otherwise>1</xsl:otherwise>
3445       </xsl:choose>
3446     </xsl:variable>
3447     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
3448       <div><xsl:copy-of select="$verso.content"/></div>
3449     </xsl:if>
3450     <xsl:call-template name="simplesect.titlepage.separator"/>
3451   </div>
3452 </xsl:template>
3453
3454 <xsl:template match="*" mode="simplesect.titlepage.recto.mode">
3455   <!-- if an element isn't found in this mode, -->
3456   <!-- try the generic titlepage.mode -->
3457   <xsl:apply-templates select="." mode="titlepage.mode"/>
3458 </xsl:template>
3459
3460 <xsl:template match="*" mode="simplesect.titlepage.verso.mode">
3461   <!-- if an element isn't found in this mode, -->
3462   <!-- try the generic titlepage.mode -->
3463   <xsl:apply-templates select="." mode="titlepage.mode"/>
3464 </xsl:template>
3465
3466 <xsl:template match="title" mode="simplesect.titlepage.recto.auto.mode">
3467 <div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3468 <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3469 </div>
3470 </xsl:template>
3471
3472 <xsl:template match="subtitle" mode="simplesect.titlepage.recto.auto.mode">
3473 <div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3474 <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3475 </div>
3476 </xsl:template>
3477
3478 <xsl:template match="corpauthor" mode="simplesect.titlepage.recto.auto.mode">
3479 <div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3480 <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3481 </div>
3482 </xsl:template>
3483
3484 <xsl:template match="authorgroup" mode="simplesect.titlepage.recto.auto.mode">
3485 <div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3486 <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3487 </div>
3488 </xsl:template>
3489
3490 <xsl:template match="author" mode="simplesect.titlepage.recto.auto.mode">
3491 <div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3492 <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3493 </div>
3494 </xsl:template>
3495
3496 <xsl:template match="othercredit" mode="simplesect.titlepage.recto.auto.mode">
3497 <div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3498 <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3499 </div>
3500 </xsl:template>
3501
3502 <xsl:template match="releaseinfo" mode="simplesect.titlepage.recto.auto.mode">
3503 <div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3504 <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3505 </div>
3506 </xsl:template>
3507
3508 <xsl:template match="copyright" mode="simplesect.titlepage.recto.auto.mode">
3509 <div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3510 <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3511 </div>
3512 </xsl:template>
3513
3514 <xsl:template match="legalnotice" mode="simplesect.titlepage.recto.auto.mode">
3515 <div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3516 <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3517 </div>
3518 </xsl:template>
3519
3520 <xsl:template match="pubdate" mode="simplesect.titlepage.recto.auto.mode">
3521 <div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3522 <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3523 </div>
3524 </xsl:template>
3525
3526 <xsl:template match="revision" mode="simplesect.titlepage.recto.auto.mode">
3527 <div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3528 <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3529 </div>
3530 </xsl:template>
3531
3532 <xsl:template match="revhistory" mode="simplesect.titlepage.recto.auto.mode">
3533 <div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3534 <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3535 </div>
3536 </xsl:template>
3537
3538 <xsl:template match="abstract" mode="simplesect.titlepage.recto.auto.mode">
3539 <div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3540 <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3541 </div>
3542 </xsl:template>
3543
3544 <xsl:template name="bibliography.titlepage.recto">
3545   <div xsl:use-attribute-sets="bibliography.titlepage.recto.style">
3546 <xsl:call-template name="component.title">
3547 <xsl:with-param name="node" select="ancestor-or-self::bibliography[1]"/>
3548 </xsl:call-template></div>
3549   <xsl:choose>
3550     <xsl:when test="bibliographyinfo/subtitle">
3551       <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="bibliographyinfo/subtitle"/>
3552     </xsl:when>
3553     <xsl:when test="docinfo/subtitle">
3554       <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
3555     </xsl:when>
3556     <xsl:when test="info/subtitle">
3557       <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="info/subtitle"/>
3558     </xsl:when>
3559     <xsl:when test="subtitle">
3560       <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="subtitle"/>
3561     </xsl:when>
3562   </xsl:choose>
3563
3564 </xsl:template>
3565
3566 <xsl:template name="bibliography.titlepage.verso">
3567 </xsl:template>
3568
3569 <xsl:template name="bibliography.titlepage.separator">
3570 </xsl:template>
3571
3572 <xsl:template name="bibliography.titlepage.before.recto">
3573 </xsl:template>
3574
3575 <xsl:template name="bibliography.titlepage.before.verso">
3576 </xsl:template>
3577
3578 <xsl:template name="bibliography.titlepage">
3579   <div class="titlepage">
3580     <xsl:variable name="recto.content">
3581       <xsl:call-template name="bibliography.titlepage.before.recto"/>
3582       <xsl:call-template name="bibliography.titlepage.recto"/>
3583     </xsl:variable>
3584     <xsl:variable name="recto.elements.count">
3585       <xsl:choose>
3586         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3587         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3588           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3589         <xsl:otherwise>1</xsl:otherwise>
3590       </xsl:choose>
3591     </xsl:variable>
3592     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
3593       <div><xsl:copy-of select="$recto.content"/></div>
3594     </xsl:if>
3595     <xsl:variable name="verso.content">
3596       <xsl:call-template name="bibliography.titlepage.before.verso"/>
3597       <xsl:call-template name="bibliography.titlepage.verso"/>
3598     </xsl:variable>
3599     <xsl:variable name="verso.elements.count">
3600       <xsl:choose>
3601         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3602         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3603           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3604         <xsl:otherwise>1</xsl:otherwise>
3605       </xsl:choose>
3606     </xsl:variable>
3607     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
3608       <div><xsl:copy-of select="$verso.content"/></div>
3609     </xsl:if>
3610     <xsl:call-template name="bibliography.titlepage.separator"/>
3611   </div>
3612 </xsl:template>
3613
3614 <xsl:template match="*" mode="bibliography.titlepage.recto.mode">
3615   <!-- if an element isn't found in this mode, -->
3616   <!-- try the generic titlepage.mode -->
3617   <xsl:apply-templates select="." mode="titlepage.mode"/>
3618 </xsl:template>
3619
3620 <xsl:template match="*" mode="bibliography.titlepage.verso.mode">
3621   <!-- if an element isn't found in this mode, -->
3622   <!-- try the generic titlepage.mode -->
3623   <xsl:apply-templates select="." mode="titlepage.mode"/>
3624 </xsl:template>
3625
3626 <xsl:template match="subtitle" mode="bibliography.titlepage.recto.auto.mode">
3627 <div xsl:use-attribute-sets="bibliography.titlepage.recto.style">
3628 <xsl:apply-templates select="." mode="bibliography.titlepage.recto.mode"/>
3629 </div>
3630 </xsl:template>
3631
3632 <xsl:template name="glossary.titlepage.recto">
3633   <div xsl:use-attribute-sets="glossary.titlepage.recto.style">
3634 <xsl:call-template name="component.title">
3635 <xsl:with-param name="node" select="ancestor-or-self::glossary[1]"/>
3636 </xsl:call-template></div>
3637   <xsl:choose>
3638     <xsl:when test="glossaryinfo/subtitle">
3639       <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="glossaryinfo/subtitle"/>
3640     </xsl:when>
3641     <xsl:when test="docinfo/subtitle">
3642       <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
3643     </xsl:when>
3644     <xsl:when test="info/subtitle">
3645       <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="info/subtitle"/>
3646     </xsl:when>
3647     <xsl:when test="subtitle">
3648       <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="subtitle"/>
3649     </xsl:when>
3650   </xsl:choose>
3651
3652 </xsl:template>
3653
3654 <xsl:template name="glossary.titlepage.verso">
3655 </xsl:template>
3656
3657 <xsl:template name="glossary.titlepage.separator">
3658 </xsl:template>
3659
3660 <xsl:template name="glossary.titlepage.before.recto">
3661 </xsl:template>
3662
3663 <xsl:template name="glossary.titlepage.before.verso">
3664 </xsl:template>
3665
3666 <xsl:template name="glossary.titlepage">
3667   <div class="titlepage">
3668     <xsl:variable name="recto.content">
3669       <xsl:call-template name="glossary.titlepage.before.recto"/>
3670       <xsl:call-template name="glossary.titlepage.recto"/>
3671     </xsl:variable>
3672     <xsl:variable name="recto.elements.count">
3673       <xsl:choose>
3674         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3675         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3676           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3677         <xsl:otherwise>1</xsl:otherwise>
3678       </xsl:choose>
3679     </xsl:variable>
3680     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
3681       <div><xsl:copy-of select="$recto.content"/></div>
3682     </xsl:if>
3683     <xsl:variable name="verso.content">
3684       <xsl:call-template name="glossary.titlepage.before.verso"/>
3685       <xsl:call-template name="glossary.titlepage.verso"/>
3686     </xsl:variable>
3687     <xsl:variable name="verso.elements.count">
3688       <xsl:choose>
3689         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3690         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3691           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3692         <xsl:otherwise>1</xsl:otherwise>
3693       </xsl:choose>
3694     </xsl:variable>
3695     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
3696       <div><xsl:copy-of select="$verso.content"/></div>
3697     </xsl:if>
3698     <xsl:call-template name="glossary.titlepage.separator"/>
3699   </div>
3700 </xsl:template>
3701
3702 <xsl:template match="*" mode="glossary.titlepage.recto.mode">
3703   <!-- if an element isn't found in this mode, -->
3704   <!-- try the generic titlepage.mode -->
3705   <xsl:apply-templates select="." mode="titlepage.mode"/>
3706 </xsl:template>
3707
3708 <xsl:template match="*" mode="glossary.titlepage.verso.mode">
3709   <!-- if an element isn't found in this mode, -->
3710   <!-- try the generic titlepage.mode -->
3711   <xsl:apply-templates select="." mode="titlepage.mode"/>
3712 </xsl:template>
3713
3714 <xsl:template match="subtitle" mode="glossary.titlepage.recto.auto.mode">
3715 <div xsl:use-attribute-sets="glossary.titlepage.recto.style">
3716 <xsl:apply-templates select="." mode="glossary.titlepage.recto.mode"/>
3717 </div>
3718 </xsl:template>
3719
3720 <xsl:template name="index.titlepage.recto">
3721   <div xsl:use-attribute-sets="index.titlepage.recto.style">
3722 <xsl:call-template name="component.title">
3723 <xsl:with-param name="node" select="ancestor-or-self::index[1]"/>
3724 </xsl:call-template></div>
3725   <xsl:choose>
3726     <xsl:when test="indexinfo/subtitle">
3727       <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="indexinfo/subtitle"/>
3728     </xsl:when>
3729     <xsl:when test="docinfo/subtitle">
3730       <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
3731     </xsl:when>
3732     <xsl:when test="info/subtitle">
3733       <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="info/subtitle"/>
3734     </xsl:when>
3735     <xsl:when test="subtitle">
3736       <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="subtitle"/>
3737     </xsl:when>
3738   </xsl:choose>
3739
3740 </xsl:template>
3741
3742 <xsl:template name="index.titlepage.verso">
3743 </xsl:template>
3744
3745 <xsl:template name="index.titlepage.separator">
3746 </xsl:template>
3747
3748 <xsl:template name="index.titlepage.before.recto">
3749 </xsl:template>
3750
3751 <xsl:template name="index.titlepage.before.verso">
3752 </xsl:template>
3753
3754 <xsl:template name="index.titlepage">
3755   <div class="titlepage">
3756     <xsl:variable name="recto.content">
3757       <xsl:call-template name="index.titlepage.before.recto"/>
3758       <xsl:call-template name="index.titlepage.recto"/>
3759     </xsl:variable>
3760     <xsl:variable name="recto.elements.count">
3761       <xsl:choose>
3762         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3763         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3764           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3765         <xsl:otherwise>1</xsl:otherwise>
3766       </xsl:choose>
3767     </xsl:variable>
3768     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
3769       <div><xsl:copy-of select="$recto.content"/></div>
3770     </xsl:if>
3771     <xsl:variable name="verso.content">
3772       <xsl:call-template name="index.titlepage.before.verso"/>
3773       <xsl:call-template name="index.titlepage.verso"/>
3774     </xsl:variable>
3775     <xsl:variable name="verso.elements.count">
3776       <xsl:choose>
3777         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3778         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3779           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3780         <xsl:otherwise>1</xsl:otherwise>
3781       </xsl:choose>
3782     </xsl:variable>
3783     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
3784       <div><xsl:copy-of select="$verso.content"/></div>
3785     </xsl:if>
3786     <xsl:call-template name="index.titlepage.separator"/>
3787   </div>
3788 </xsl:template>
3789
3790 <xsl:template match="*" mode="index.titlepage.recto.mode">
3791   <!-- if an element isn't found in this mode, -->
3792   <!-- try the generic titlepage.mode -->
3793   <xsl:apply-templates select="." mode="titlepage.mode"/>
3794 </xsl:template>
3795
3796 <xsl:template match="*" mode="index.titlepage.verso.mode">
3797   <!-- if an element isn't found in this mode, -->
3798   <!-- try the generic titlepage.mode -->
3799   <xsl:apply-templates select="." mode="titlepage.mode"/>
3800 </xsl:template>
3801
3802 <xsl:template match="subtitle" mode="index.titlepage.recto.auto.mode">
3803 <div xsl:use-attribute-sets="index.titlepage.recto.style">
3804 <xsl:apply-templates select="." mode="index.titlepage.recto.mode"/>
3805 </div>
3806 </xsl:template>
3807
3808 <xsl:template name="setindex.titlepage.recto">
3809   <div xsl:use-attribute-sets="setindex.titlepage.recto.style">
3810 <xsl:call-template name="component.title">
3811 <xsl:with-param name="node" select="ancestor-or-self::setindex[1]"/>
3812 </xsl:call-template></div>
3813   <xsl:choose>
3814     <xsl:when test="setindexinfo/subtitle">
3815       <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="setindexinfo/subtitle"/>
3816     </xsl:when>
3817     <xsl:when test="docinfo/subtitle">
3818       <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
3819     </xsl:when>
3820     <xsl:when test="info/subtitle">
3821       <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="info/subtitle"/>
3822     </xsl:when>
3823     <xsl:when test="subtitle">
3824       <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="subtitle"/>
3825     </xsl:when>
3826   </xsl:choose>
3827
3828 </xsl:template>
3829
3830 <xsl:template name="setindex.titlepage.verso">
3831 </xsl:template>
3832
3833 <xsl:template name="setindex.titlepage.separator">
3834 </xsl:template>
3835
3836 <xsl:template name="setindex.titlepage.before.recto">
3837 </xsl:template>
3838
3839 <xsl:template name="setindex.titlepage.before.verso">
3840 </xsl:template>
3841
3842 <xsl:template name="setindex.titlepage">
3843   <div class="titlepage">
3844     <xsl:variable name="recto.content">
3845       <xsl:call-template name="setindex.titlepage.before.recto"/>
3846       <xsl:call-template name="setindex.titlepage.recto"/>
3847     </xsl:variable>
3848     <xsl:variable name="recto.elements.count">
3849       <xsl:choose>
3850         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3851         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3852           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3853         <xsl:otherwise>1</xsl:otherwise>
3854       </xsl:choose>
3855     </xsl:variable>
3856     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
3857       <div><xsl:copy-of select="$recto.content"/></div>
3858     </xsl:if>
3859     <xsl:variable name="verso.content">
3860       <xsl:call-template name="setindex.titlepage.before.verso"/>
3861       <xsl:call-template name="setindex.titlepage.verso"/>
3862     </xsl:variable>
3863     <xsl:variable name="verso.elements.count">
3864       <xsl:choose>
3865         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3866         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3867           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3868         <xsl:otherwise>1</xsl:otherwise>
3869       </xsl:choose>
3870     </xsl:variable>
3871     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
3872       <div><xsl:copy-of select="$verso.content"/></div>
3873     </xsl:if>
3874     <xsl:call-template name="setindex.titlepage.separator"/>
3875   </div>
3876 </xsl:template>
3877
3878 <xsl:template match="*" mode="setindex.titlepage.recto.mode">
3879   <!-- if an element isn't found in this mode, -->
3880   <!-- try the generic titlepage.mode -->
3881   <xsl:apply-templates select="." mode="titlepage.mode"/>
3882 </xsl:template>
3883
3884 <xsl:template match="*" mode="setindex.titlepage.verso.mode">
3885   <!-- if an element isn't found in this mode, -->
3886   <!-- try the generic titlepage.mode -->
3887   <xsl:apply-templates select="." mode="titlepage.mode"/>
3888 </xsl:template>
3889
3890 <xsl:template match="subtitle" mode="setindex.titlepage.recto.auto.mode">
3891 <div xsl:use-attribute-sets="setindex.titlepage.recto.style">
3892 <xsl:apply-templates select="." mode="setindex.titlepage.recto.mode"/>
3893 </div>
3894 </xsl:template>
3895
3896 <xsl:template name="sidebar.titlepage.recto">
3897   <xsl:choose>
3898     <xsl:when test="sidebarinfo/title">
3899       <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="sidebarinfo/title"/>
3900     </xsl:when>
3901     <xsl:when test="docinfo/title">
3902       <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="docinfo/title"/>
3903     </xsl:when>
3904     <xsl:when test="info/title">
3905       <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="info/title"/>
3906     </xsl:when>
3907     <xsl:when test="title">
3908       <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="title"/>
3909     </xsl:when>
3910   </xsl:choose>
3911
3912   <xsl:choose>
3913     <xsl:when test="sidebarinfo/subtitle">
3914       <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="sidebarinfo/subtitle"/>
3915     </xsl:when>
3916     <xsl:when test="docinfo/subtitle">
3917       <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
3918     </xsl:when>
3919     <xsl:when test="info/subtitle">
3920       <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="info/subtitle"/>
3921     </xsl:when>
3922     <xsl:when test="subtitle">
3923       <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="subtitle"/>
3924     </xsl:when>
3925   </xsl:choose>
3926
3927 </xsl:template>
3928
3929 <xsl:template name="sidebar.titlepage.verso">
3930 </xsl:template>
3931
3932 <xsl:template name="sidebar.titlepage.separator">
3933 </xsl:template>
3934
3935 <xsl:template name="sidebar.titlepage.before.recto">
3936 </xsl:template>
3937
3938 <xsl:template name="sidebar.titlepage.before.verso">
3939 </xsl:template>
3940
3941 <xsl:template name="sidebar.titlepage">
3942   <div class="titlepage">
3943     <xsl:variable name="recto.content">
3944       <xsl:call-template name="sidebar.titlepage.before.recto"/>
3945       <xsl:call-template name="sidebar.titlepage.recto"/>
3946     </xsl:variable>
3947     <xsl:variable name="recto.elements.count">
3948       <xsl:choose>
3949         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3950         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3951           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3952         <xsl:otherwise>1</xsl:otherwise>
3953       </xsl:choose>
3954     </xsl:variable>
3955     <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
3956       <div><xsl:copy-of select="$recto.content"/></div>
3957     </xsl:if>
3958     <xsl:variable name="verso.content">
3959       <xsl:call-template name="sidebar.titlepage.before.verso"/>
3960       <xsl:call-template name="sidebar.titlepage.verso"/>
3961     </xsl:variable>
3962     <xsl:variable name="verso.elements.count">
3963       <xsl:choose>
3964         <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3965         <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3966           <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3967         <xsl:otherwise>1</xsl:otherwise>
3968       </xsl:choose>
3969     </xsl:variable>
3970     <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
3971       <div><xsl:copy-of select="$verso.content"/></div>
3972     </xsl:if>
3973     <xsl:call-template name="sidebar.titlepage.separator"/>
3974   </div>
3975 </xsl:template>
3976
3977 <xsl:template match="*" mode="sidebar.titlepage.recto.mode">
3978   <!-- if an element isn't found in this mode, -->
3979   <!-- try the generic titlepage.mode -->
3980   <xsl:apply-templates select="." mode="titlepage.mode"/>
3981 </xsl:template>
3982
3983 <xsl:template match="*" mode="sidebar.titlepage.verso.mode">
3984   <!-- if an element isn't found in this mode, -->
3985   <!-- try the generic titlepage.mode -->
3986   <xsl:apply-templates select="." mode="titlepage.mode"/>
3987 </xsl:template>
3988
3989 <xsl:template match="title" mode="sidebar.titlepage.recto.auto.mode">
3990 <div xsl:use-attribute-sets="sidebar.titlepage.recto.style">
3991 <xsl:call-template name="formal.object.heading">
3992 <xsl:with-param name="object" select="ancestor-or-self::sidebar[1]"/>
3993 </xsl:call-template>
3994 </div>
3995 </xsl:template>
3996
3997 <xsl:template match="subtitle" mode="sidebar.titlepage.recto.auto.mode">
3998 <div xsl:use-attribute-sets="sidebar.titlepage.recto.style">
3999 <xsl:apply-templates select="." mode="sidebar.titlepage.recto.mode"/>
4000 </div>
4001 </xsl:template>
4002
4003 </xsl:stylesheet>
4004