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