Project

General

Profile

1
<?xml version="1.0"?>
2

    
3
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" version="1.0" exclude-result-prefixes="exsl">
4

    
5
<!-- This stylesheet was created by template/titlepage.xsl-->
6

    
7
<xsl:template name="article.titlepage.recto">
8
  <xsl:choose>
9
    <xsl:when test="articleinfo/title">
10
      <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/title"/>
11
    </xsl:when>
12
    <xsl:when test="artheader/title">
13
      <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/title"/>
14
    </xsl:when>
15
    <xsl:when test="info/title">
16
      <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/title"/>
17
    </xsl:when>
18
    <xsl:when test="title">
19
      <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="title"/>
20
    </xsl:when>
21
  </xsl:choose>
22

    
23
  <xsl:choose>
24
    <xsl:when test="articleinfo/subtitle">
25
      <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/subtitle"/>
26
    </xsl:when>
27
    <xsl:when test="artheader/subtitle">
28
      <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/subtitle"/>
29
    </xsl:when>
30
    <xsl:when test="info/subtitle">
31
      <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/subtitle"/>
32
    </xsl:when>
33
    <xsl:when test="subtitle">
34
      <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="subtitle"/>
35
    </xsl:when>
36
  </xsl:choose>
37

    
38
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/corpauthor"/>
39
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/corpauthor"/>
40
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/corpauthor"/>
41
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/authorgroup"/>
42
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/authorgroup"/>
43
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/authorgroup"/>
44
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/author"/>
45
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/author"/>
46
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/author"/>
47
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/othercredit"/>
48
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/othercredit"/>
49
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/othercredit"/>
50
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/releaseinfo"/>
51
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/releaseinfo"/>
52
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/releaseinfo"/>
53
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/copyright"/>
54
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/copyright"/>
55
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/copyright"/>
56
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/legalnotice"/>
57
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/legalnotice"/>
58
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/legalnotice"/>
59
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/pubdate"/>
60
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/pubdate"/>
61
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/pubdate"/>
62
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revision"/>
63
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/revision"/>
64
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/revision"/>
65
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revhistory"/>
66
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/revhistory"/>
67
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/revhistory"/>
68
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/abstract"/>
69
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/abstract"/>
70
  <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/abstract"/>
71
</xsl:template>
72

    
73
<xsl:template name="article.titlepage.verso">
74
</xsl:template>
75

    
76
<xsl:template name="article.titlepage.separator"><hr/>
77
</xsl:template>
78

    
79
<xsl:template name="article.titlepage.before.recto">
80
</xsl:template>
81

    
82
<xsl:template name="article.titlepage.before.verso">
83
</xsl:template>
84

    
85
<xsl:template name="article.titlepage">
86
  <div class="titlepage">
87
    <xsl:variable name="recto.content">
88
      <xsl:call-template name="article.titlepage.before.recto"/>
89
      <xsl:call-template name="article.titlepage.recto"/>
90
    </xsl:variable>
91
    <xsl:variable name="recto.elements.count">
92
      <xsl:choose>
93
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
94
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
95
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
96
        <xsl:otherwise>1</xsl:otherwise>
97
      </xsl:choose>
98
    </xsl:variable>
99
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
100
      <div><xsl:copy-of select="$recto.content"/></div>
101
    </xsl:if>
102
    <xsl:variable name="verso.content">
103
      <xsl:call-template name="article.titlepage.before.verso"/>
104
      <xsl:call-template name="article.titlepage.verso"/>
105
    </xsl:variable>
106
    <xsl:variable name="verso.elements.count">
107
      <xsl:choose>
108
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
109
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
110
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
111
        <xsl:otherwise>1</xsl:otherwise>
112
      </xsl:choose>
113
    </xsl:variable>
114
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
115
      <div><xsl:copy-of select="$verso.content"/></div>
116
    </xsl:if>
117
    <xsl:call-template name="article.titlepage.separator"/>
118
  </div>
119
</xsl:template>
120

    
121
<xsl:template match="*" mode="article.titlepage.recto.mode">
122
  <!-- if an element isn't found in this mode, -->
123
  <!-- try the generic titlepage.mode -->
124
  <xsl:apply-templates select="." mode="titlepage.mode"/>
125
</xsl:template>
126

    
127
<xsl:template match="*" mode="article.titlepage.verso.mode">
128
  <!-- if an element isn't found in this mode, -->
129
  <!-- try the generic titlepage.mode -->
130
  <xsl:apply-templates select="." mode="titlepage.mode"/>
131
</xsl:template>
132

    
133
<xsl:template match="title" mode="article.titlepage.recto.auto.mode">
134
<div xsl:use-attribute-sets="article.titlepage.recto.style">
135
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
136
</div>
137
</xsl:template>
138

    
139
<xsl:template match="subtitle" mode="article.titlepage.recto.auto.mode">
140
<div xsl:use-attribute-sets="article.titlepage.recto.style">
141
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
142
</div>
143
</xsl:template>
144

    
145
<xsl:template match="corpauthor" mode="article.titlepage.recto.auto.mode">
146
<div xsl:use-attribute-sets="article.titlepage.recto.style">
147
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
148
</div>
149
</xsl:template>
150

    
151
<xsl:template match="authorgroup" mode="article.titlepage.recto.auto.mode">
152
<div xsl:use-attribute-sets="article.titlepage.recto.style">
153
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
154
</div>
155
</xsl:template>
156

    
157
<xsl:template match="author" mode="article.titlepage.recto.auto.mode">
158
<div xsl:use-attribute-sets="article.titlepage.recto.style">
159
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
160
</div>
161
</xsl:template>
162

    
163
<xsl:template match="othercredit" mode="article.titlepage.recto.auto.mode">
164
<div xsl:use-attribute-sets="article.titlepage.recto.style">
165
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
166
</div>
167
</xsl:template>
168

    
169
<xsl:template match="releaseinfo" mode="article.titlepage.recto.auto.mode">
170
<div xsl:use-attribute-sets="article.titlepage.recto.style">
171
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
172
</div>
173
</xsl:template>
174

    
175
<xsl:template match="copyright" mode="article.titlepage.recto.auto.mode">
176
<div xsl:use-attribute-sets="article.titlepage.recto.style">
177
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
178
</div>
179
</xsl:template>
180

    
181
<xsl:template match="legalnotice" mode="article.titlepage.recto.auto.mode">
182
<div xsl:use-attribute-sets="article.titlepage.recto.style">
183
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
184
</div>
185
</xsl:template>
186

    
187
<xsl:template match="pubdate" mode="article.titlepage.recto.auto.mode">
188
<div xsl:use-attribute-sets="article.titlepage.recto.style">
189
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
190
</div>
191
</xsl:template>
192

    
193
<xsl:template match="revision" mode="article.titlepage.recto.auto.mode">
194
<div xsl:use-attribute-sets="article.titlepage.recto.style">
195
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
196
</div>
197
</xsl:template>
198

    
199
<xsl:template match="revhistory" mode="article.titlepage.recto.auto.mode">
200
<div xsl:use-attribute-sets="article.titlepage.recto.style">
201
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
202
</div>
203
</xsl:template>
204

    
205
<xsl:template match="abstract" mode="article.titlepage.recto.auto.mode">
206
<div xsl:use-attribute-sets="article.titlepage.recto.style">
207
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
208
</div>
209
</xsl:template>
210

    
211
<xsl:template name="set.titlepage.recto">
212
  <xsl:choose>
213
    <xsl:when test="setinfo/title">
214
      <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/title"/>
215
    </xsl:when>
216
    <xsl:when test="info/title">
217
      <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/title"/>
218
    </xsl:when>
219
    <xsl:when test="title">
220
      <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="title"/>
221
    </xsl:when>
222
  </xsl:choose>
223

    
224
  <xsl:choose>
225
    <xsl:when test="setinfo/subtitle">
226
      <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/subtitle"/>
227
    </xsl:when>
228
    <xsl:when test="info/subtitle">
229
      <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/subtitle"/>
230
    </xsl:when>
231
    <xsl:when test="subtitle">
232
      <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="subtitle"/>
233
    </xsl:when>
234
  </xsl:choose>
235

    
236
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/corpauthor"/>
237
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/corpauthor"/>
238
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/authorgroup"/>
239
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/authorgroup"/>
240
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/author"/>
241
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/author"/>
242
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/othercredit"/>
243
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/othercredit"/>
244
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/releaseinfo"/>
245
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/releaseinfo"/>
246
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/copyright"/>
247
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/copyright"/>
248
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/legalnotice"/>
249
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/legalnotice"/>
250
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/pubdate"/>
251
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/pubdate"/>
252
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/revision"/>
253
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/revision"/>
254
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/revhistory"/>
255
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/revhistory"/>
256
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/abstract"/>
257
  <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/abstract"/>
258
</xsl:template>
259

    
260
<xsl:template name="set.titlepage.verso">
261
</xsl:template>
262

    
263
<xsl:template name="set.titlepage.separator"><hr/>
264
</xsl:template>
265

    
266
<xsl:template name="set.titlepage.before.recto">
267
</xsl:template>
268

    
269
<xsl:template name="set.titlepage.before.verso">
270
</xsl:template>
271

    
272
<xsl:template name="set.titlepage">
273
  <div class="titlepage">
274
    <xsl:variable name="recto.content">
275
      <xsl:call-template name="set.titlepage.before.recto"/>
276
      <xsl:call-template name="set.titlepage.recto"/>
277
    </xsl:variable>
278
    <xsl:variable name="recto.elements.count">
279
      <xsl:choose>
280
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
281
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
282
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
283
        <xsl:otherwise>1</xsl:otherwise>
284
      </xsl:choose>
285
    </xsl:variable>
286
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
287
      <div><xsl:copy-of select="$recto.content"/></div>
288
    </xsl:if>
289
    <xsl:variable name="verso.content">
290
      <xsl:call-template name="set.titlepage.before.verso"/>
291
      <xsl:call-template name="set.titlepage.verso"/>
292
    </xsl:variable>
293
    <xsl:variable name="verso.elements.count">
294
      <xsl:choose>
295
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
296
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
297
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
298
        <xsl:otherwise>1</xsl:otherwise>
299
      </xsl:choose>
300
    </xsl:variable>
301
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
302
      <div><xsl:copy-of select="$verso.content"/></div>
303
    </xsl:if>
304
    <xsl:call-template name="set.titlepage.separator"/>
305
  </div>
306
</xsl:template>
307

    
308
<xsl:template match="*" mode="set.titlepage.recto.mode">
309
  <!-- if an element isn't found in this mode, -->
310
  <!-- try the generic titlepage.mode -->
311
  <xsl:apply-templates select="." mode="titlepage.mode"/>
312
</xsl:template>
313

    
314
<xsl:template match="*" mode="set.titlepage.verso.mode">
315
  <!-- if an element isn't found in this mode, -->
316
  <!-- try the generic titlepage.mode -->
317
  <xsl:apply-templates select="." mode="titlepage.mode"/>
318
</xsl:template>
319

    
320
<xsl:template match="title" mode="set.titlepage.recto.auto.mode">
321
<div xsl:use-attribute-sets="set.titlepage.recto.style">
322
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
323
</div>
324
</xsl:template>
325

    
326
<xsl:template match="subtitle" mode="set.titlepage.recto.auto.mode">
327
<div xsl:use-attribute-sets="set.titlepage.recto.style">
328
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
329
</div>
330
</xsl:template>
331

    
332
<xsl:template match="corpauthor" mode="set.titlepage.recto.auto.mode">
333
<div xsl:use-attribute-sets="set.titlepage.recto.style">
334
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
335
</div>
336
</xsl:template>
337

    
338
<xsl:template match="authorgroup" mode="set.titlepage.recto.auto.mode">
339
<div xsl:use-attribute-sets="set.titlepage.recto.style">
340
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
341
</div>
342
</xsl:template>
343

    
344
<xsl:template match="author" mode="set.titlepage.recto.auto.mode">
345
<div xsl:use-attribute-sets="set.titlepage.recto.style">
346
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
347
</div>
348
</xsl:template>
349

    
350
<xsl:template match="othercredit" mode="set.titlepage.recto.auto.mode">
351
<div xsl:use-attribute-sets="set.titlepage.recto.style">
352
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
353
</div>
354
</xsl:template>
355

    
356
<xsl:template match="releaseinfo" mode="set.titlepage.recto.auto.mode">
357
<div xsl:use-attribute-sets="set.titlepage.recto.style">
358
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
359
</div>
360
</xsl:template>
361

    
362
<xsl:template match="copyright" mode="set.titlepage.recto.auto.mode">
363
<div xsl:use-attribute-sets="set.titlepage.recto.style">
364
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
365
</div>
366
</xsl:template>
367

    
368
<xsl:template match="legalnotice" mode="set.titlepage.recto.auto.mode">
369
<div xsl:use-attribute-sets="set.titlepage.recto.style">
370
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
371
</div>
372
</xsl:template>
373

    
374
<xsl:template match="pubdate" mode="set.titlepage.recto.auto.mode">
375
<div xsl:use-attribute-sets="set.titlepage.recto.style">
376
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
377
</div>
378
</xsl:template>
379

    
380
<xsl:template match="revision" mode="set.titlepage.recto.auto.mode">
381
<div xsl:use-attribute-sets="set.titlepage.recto.style">
382
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
383
</div>
384
</xsl:template>
385

    
386
<xsl:template match="revhistory" mode="set.titlepage.recto.auto.mode">
387
<div xsl:use-attribute-sets="set.titlepage.recto.style">
388
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
389
</div>
390
</xsl:template>
391

    
392
<xsl:template match="abstract" mode="set.titlepage.recto.auto.mode">
393
<div xsl:use-attribute-sets="set.titlepage.recto.style">
394
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
395
</div>
396
</xsl:template>
397

    
398
<xsl:template name="book.titlepage.recto">
399
  <xsl:choose>
400
    <xsl:when test="bookinfo/title">
401
      <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/title"/>
402
    </xsl:when>
403
    <xsl:when test="info/title">
404
      <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/title"/>
405
    </xsl:when>
406
    <xsl:when test="title">
407
      <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="title"/>
408
    </xsl:when>
409
  </xsl:choose>
410

    
411
  <xsl:choose>
412
    <xsl:when test="bookinfo/subtitle">
413
      <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/subtitle"/>
414
    </xsl:when>
415
    <xsl:when test="info/subtitle">
416
      <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/subtitle"/>
417
    </xsl:when>
418
    <xsl:when test="subtitle">
419
      <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="subtitle"/>
420
    </xsl:when>
421
  </xsl:choose>
422

    
423
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/corpauthor"/>
424
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/corpauthor"/>
425
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/authorgroup"/>
426
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/authorgroup"/>
427
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/author"/>
428
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/author"/>
429
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/othercredit"/>
430
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/othercredit"/>
431
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/releaseinfo"/>
432
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/releaseinfo"/>
433
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/copyright"/>
434
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/copyright"/>
435
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/legalnotice"/>
436
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/legalnotice"/>
437
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/pubdate"/>
438
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/pubdate"/>
439
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revision"/>
440
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/revision"/>
441
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revhistory"/>
442
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/revhistory"/>
443
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/abstract"/>
444
  <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/abstract"/>
445
</xsl:template>
446

    
447
<xsl:template name="book.titlepage.verso">
448
</xsl:template>
449

    
450
<xsl:template name="book.titlepage.separator"><hr/>
451
</xsl:template>
452

    
453
<xsl:template name="book.titlepage.before.recto">
454
</xsl:template>
455

    
456
<xsl:template name="book.titlepage.before.verso">
457
</xsl:template>
458

    
459
<xsl:template name="book.titlepage">
460
  <div class="titlepage">
461
    <xsl:variable name="recto.content">
462
      <xsl:call-template name="book.titlepage.before.recto"/>
463
      <xsl:call-template name="book.titlepage.recto"/>
464
    </xsl:variable>
465
    <xsl:variable name="recto.elements.count">
466
      <xsl:choose>
467
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
468
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
469
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
470
        <xsl:otherwise>1</xsl:otherwise>
471
      </xsl:choose>
472
    </xsl:variable>
473
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
474
      <div><xsl:copy-of select="$recto.content"/></div>
475
    </xsl:if>
476
    <xsl:variable name="verso.content">
477
      <xsl:call-template name="book.titlepage.before.verso"/>
478
      <xsl:call-template name="book.titlepage.verso"/>
479
    </xsl:variable>
480
    <xsl:variable name="verso.elements.count">
481
      <xsl:choose>
482
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
483
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
484
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
485
        <xsl:otherwise>1</xsl:otherwise>
486
      </xsl:choose>
487
    </xsl:variable>
488
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
489
      <div><xsl:copy-of select="$verso.content"/></div>
490
    </xsl:if>
491
    <xsl:call-template name="book.titlepage.separator"/>
492
  </div>
493
</xsl:template>
494

    
495
<xsl:template match="*" mode="book.titlepage.recto.mode">
496
  <!-- if an element isn't found in this mode, -->
497
  <!-- try the generic titlepage.mode -->
498
  <xsl:apply-templates select="." mode="titlepage.mode"/>
499
</xsl:template>
500

    
501
<xsl:template match="*" mode="book.titlepage.verso.mode">
502
  <!-- if an element isn't found in this mode, -->
503
  <!-- try the generic titlepage.mode -->
504
  <xsl:apply-templates select="." mode="titlepage.mode"/>
505
</xsl:template>
506

    
507
<xsl:template match="title" mode="book.titlepage.recto.auto.mode">
508
<div xsl:use-attribute-sets="book.titlepage.recto.style">
509
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
510
</div>
511
</xsl:template>
512

    
513
<xsl:template match="subtitle" mode="book.titlepage.recto.auto.mode">
514
<div xsl:use-attribute-sets="book.titlepage.recto.style">
515
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
516
</div>
517
</xsl:template>
518

    
519
<xsl:template match="corpauthor" mode="book.titlepage.recto.auto.mode">
520
<div xsl:use-attribute-sets="book.titlepage.recto.style">
521
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
522
</div>
523
</xsl:template>
524

    
525
<xsl:template match="authorgroup" mode="book.titlepage.recto.auto.mode">
526
<div xsl:use-attribute-sets="book.titlepage.recto.style">
527
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
528
</div>
529
</xsl:template>
530

    
531
<xsl:template match="author" mode="book.titlepage.recto.auto.mode">
532
<div xsl:use-attribute-sets="book.titlepage.recto.style">
533
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
534
</div>
535
</xsl:template>
536

    
537
<xsl:template match="othercredit" mode="book.titlepage.recto.auto.mode">
538
<div xsl:use-attribute-sets="book.titlepage.recto.style">
539
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
540
</div>
541
</xsl:template>
542

    
543
<xsl:template match="releaseinfo" mode="book.titlepage.recto.auto.mode">
544
<div xsl:use-attribute-sets="book.titlepage.recto.style">
545
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
546
</div>
547
</xsl:template>
548

    
549
<xsl:template match="copyright" mode="book.titlepage.recto.auto.mode">
550
<div xsl:use-attribute-sets="book.titlepage.recto.style">
551
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
552
</div>
553
</xsl:template>
554

    
555
<xsl:template match="legalnotice" mode="book.titlepage.recto.auto.mode">
556
<div xsl:use-attribute-sets="book.titlepage.recto.style">
557
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
558
</div>
559
</xsl:template>
560

    
561
<xsl:template match="pubdate" mode="book.titlepage.recto.auto.mode">
562
<div xsl:use-attribute-sets="book.titlepage.recto.style">
563
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
564
</div>
565
</xsl:template>
566

    
567
<xsl:template match="revision" mode="book.titlepage.recto.auto.mode">
568
<div xsl:use-attribute-sets="book.titlepage.recto.style">
569
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
570
</div>
571
</xsl:template>
572

    
573
<xsl:template match="revhistory" mode="book.titlepage.recto.auto.mode">
574
<div xsl:use-attribute-sets="book.titlepage.recto.style">
575
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
576
</div>
577
</xsl:template>
578

    
579
<xsl:template match="abstract" mode="book.titlepage.recto.auto.mode">
580
<div xsl:use-attribute-sets="book.titlepage.recto.style">
581
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
582
</div>
583
</xsl:template>
584

    
585
<xsl:template name="part.titlepage.recto">
586
  <div xsl:use-attribute-sets="part.titlepage.recto.style">
587
<xsl:call-template name="division.title">
588
<xsl:with-param name="node" select="ancestor-or-self::part[1]"/>
589
</xsl:call-template></div>
590
  <xsl:choose>
591
    <xsl:when test="partinfo/subtitle">
592
      <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/subtitle"/>
593
    </xsl:when>
594
    <xsl:when test="docinfo/subtitle">
595
      <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
596
    </xsl:when>
597
    <xsl:when test="info/subtitle">
598
      <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/subtitle"/>
599
    </xsl:when>
600
    <xsl:when test="subtitle">
601
      <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="subtitle"/>
602
    </xsl:when>
603
  </xsl:choose>
604

    
605
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/corpauthor"/>
606
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
607
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/corpauthor"/>
608
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/authorgroup"/>
609
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
610
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/authorgroup"/>
611
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/author"/>
612
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/author"/>
613
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/author"/>
614
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/othercredit"/>
615
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
616
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/othercredit"/>
617
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/releaseinfo"/>
618
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
619
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/releaseinfo"/>
620
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/copyright"/>
621
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/copyright"/>
622
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/copyright"/>
623
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/legalnotice"/>
624
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
625
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/legalnotice"/>
626
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/pubdate"/>
627
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
628
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/pubdate"/>
629
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/revision"/>
630
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/revision"/>
631
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/revision"/>
632
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/revhistory"/>
633
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
634
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/revhistory"/>
635
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/abstract"/>
636
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/abstract"/>
637
  <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/abstract"/>
638
</xsl:template>
639

    
640
<xsl:template name="part.titlepage.verso">
641
</xsl:template>
642

    
643
<xsl:template name="part.titlepage.separator">
644
</xsl:template>
645

    
646
<xsl:template name="part.titlepage.before.recto">
647
</xsl:template>
648

    
649
<xsl:template name="part.titlepage.before.verso">
650
</xsl:template>
651

    
652
<xsl:template name="part.titlepage">
653
  <div class="titlepage">
654
    <xsl:variable name="recto.content">
655
      <xsl:call-template name="part.titlepage.before.recto"/>
656
      <xsl:call-template name="part.titlepage.recto"/>
657
    </xsl:variable>
658
    <xsl:variable name="recto.elements.count">
659
      <xsl:choose>
660
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
661
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
662
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
663
        <xsl:otherwise>1</xsl:otherwise>
664
      </xsl:choose>
665
    </xsl:variable>
666
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
667
      <div><xsl:copy-of select="$recto.content"/></div>
668
    </xsl:if>
669
    <xsl:variable name="verso.content">
670
      <xsl:call-template name="part.titlepage.before.verso"/>
671
      <xsl:call-template name="part.titlepage.verso"/>
672
    </xsl:variable>
673
    <xsl:variable name="verso.elements.count">
674
      <xsl:choose>
675
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
676
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
677
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
678
        <xsl:otherwise>1</xsl:otherwise>
679
      </xsl:choose>
680
    </xsl:variable>
681
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
682
      <div><xsl:copy-of select="$verso.content"/></div>
683
    </xsl:if>
684
    <xsl:call-template name="part.titlepage.separator"/>
685
  </div>
686
</xsl:template>
687

    
688
<xsl:template match="*" mode="part.titlepage.recto.mode">
689
  <!-- if an element isn't found in this mode, -->
690
  <!-- try the generic titlepage.mode -->
691
  <xsl:apply-templates select="." mode="titlepage.mode"/>
692
</xsl:template>
693

    
694
<xsl:template match="*" mode="part.titlepage.verso.mode">
695
  <!-- if an element isn't found in this mode, -->
696
  <!-- try the generic titlepage.mode -->
697
  <xsl:apply-templates select="." mode="titlepage.mode"/>
698
</xsl:template>
699

    
700
<xsl:template match="subtitle" mode="part.titlepage.recto.auto.mode">
701
<div xsl:use-attribute-sets="part.titlepage.recto.style">
702
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
703
</div>
704
</xsl:template>
705

    
706
<xsl:template match="corpauthor" mode="part.titlepage.recto.auto.mode">
707
<div xsl:use-attribute-sets="part.titlepage.recto.style">
708
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
709
</div>
710
</xsl:template>
711

    
712
<xsl:template match="authorgroup" mode="part.titlepage.recto.auto.mode">
713
<div xsl:use-attribute-sets="part.titlepage.recto.style">
714
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
715
</div>
716
</xsl:template>
717

    
718
<xsl:template match="author" mode="part.titlepage.recto.auto.mode">
719
<div xsl:use-attribute-sets="part.titlepage.recto.style">
720
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
721
</div>
722
</xsl:template>
723

    
724
<xsl:template match="othercredit" mode="part.titlepage.recto.auto.mode">
725
<div xsl:use-attribute-sets="part.titlepage.recto.style">
726
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
727
</div>
728
</xsl:template>
729

    
730
<xsl:template match="releaseinfo" mode="part.titlepage.recto.auto.mode">
731
<div xsl:use-attribute-sets="part.titlepage.recto.style">
732
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
733
</div>
734
</xsl:template>
735

    
736
<xsl:template match="copyright" mode="part.titlepage.recto.auto.mode">
737
<div xsl:use-attribute-sets="part.titlepage.recto.style">
738
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
739
</div>
740
</xsl:template>
741

    
742
<xsl:template match="legalnotice" mode="part.titlepage.recto.auto.mode">
743
<div xsl:use-attribute-sets="part.titlepage.recto.style">
744
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
745
</div>
746
</xsl:template>
747

    
748
<xsl:template match="pubdate" mode="part.titlepage.recto.auto.mode">
749
<div xsl:use-attribute-sets="part.titlepage.recto.style">
750
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
751
</div>
752
</xsl:template>
753

    
754
<xsl:template match="revision" mode="part.titlepage.recto.auto.mode">
755
<div xsl:use-attribute-sets="part.titlepage.recto.style">
756
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
757
</div>
758
</xsl:template>
759

    
760
<xsl:template match="revhistory" mode="part.titlepage.recto.auto.mode">
761
<div xsl:use-attribute-sets="part.titlepage.recto.style">
762
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
763
</div>
764
</xsl:template>
765

    
766
<xsl:template match="abstract" mode="part.titlepage.recto.auto.mode">
767
<div xsl:use-attribute-sets="part.titlepage.recto.style">
768
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
769
</div>
770
</xsl:template>
771

    
772
<xsl:template name="partintro.titlepage.recto">
773
  <xsl:choose>
774
    <xsl:when test="partintroinfo/title">
775
      <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/title"/>
776
    </xsl:when>
777
    <xsl:when test="docinfo/title">
778
      <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/title"/>
779
    </xsl:when>
780
    <xsl:when test="info/title">
781
      <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/title"/>
782
    </xsl:when>
783
    <xsl:when test="title">
784
      <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="title"/>
785
    </xsl:when>
786
  </xsl:choose>
787

    
788
  <xsl:choose>
789
    <xsl:when test="partintroinfo/subtitle">
790
      <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/subtitle"/>
791
    </xsl:when>
792
    <xsl:when test="docinfo/subtitle">
793
      <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
794
    </xsl:when>
795
    <xsl:when test="info/subtitle">
796
      <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/subtitle"/>
797
    </xsl:when>
798
    <xsl:when test="subtitle">
799
      <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="subtitle"/>
800
    </xsl:when>
801
  </xsl:choose>
802

    
803
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/corpauthor"/>
804
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
805
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/corpauthor"/>
806
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/authorgroup"/>
807
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
808
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/authorgroup"/>
809
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/author"/>
810
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/author"/>
811
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/author"/>
812
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/othercredit"/>
813
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
814
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/othercredit"/>
815
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/releaseinfo"/>
816
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
817
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/releaseinfo"/>
818
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/copyright"/>
819
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/copyright"/>
820
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/copyright"/>
821
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/legalnotice"/>
822
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
823
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/legalnotice"/>
824
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/pubdate"/>
825
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
826
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/pubdate"/>
827
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/revision"/>
828
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/revision"/>
829
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/revision"/>
830
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/revhistory"/>
831
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
832
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/revhistory"/>
833
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/abstract"/>
834
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/abstract"/>
835
  <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/abstract"/>
836
</xsl:template>
837

    
838
<xsl:template name="partintro.titlepage.verso">
839
</xsl:template>
840

    
841
<xsl:template name="partintro.titlepage.separator">
842
</xsl:template>
843

    
844
<xsl:template name="partintro.titlepage.before.recto">
845
</xsl:template>
846

    
847
<xsl:template name="partintro.titlepage.before.verso">
848
</xsl:template>
849

    
850
<xsl:template name="partintro.titlepage">
851
  <div>
852
    <xsl:variable name="recto.content">
853
      <xsl:call-template name="partintro.titlepage.before.recto"/>
854
      <xsl:call-template name="partintro.titlepage.recto"/>
855
    </xsl:variable>
856
    <xsl:variable name="recto.elements.count">
857
      <xsl:choose>
858
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
859
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
860
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
861
        <xsl:otherwise>1</xsl:otherwise>
862
      </xsl:choose>
863
    </xsl:variable>
864
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
865
      <div><xsl:copy-of select="$recto.content"/></div>
866
    </xsl:if>
867
    <xsl:variable name="verso.content">
868
      <xsl:call-template name="partintro.titlepage.before.verso"/>
869
      <xsl:call-template name="partintro.titlepage.verso"/>
870
    </xsl:variable>
871
    <xsl:variable name="verso.elements.count">
872
      <xsl:choose>
873
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
874
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
875
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
876
        <xsl:otherwise>1</xsl:otherwise>
877
      </xsl:choose>
878
    </xsl:variable>
879
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
880
      <div><xsl:copy-of select="$verso.content"/></div>
881
    </xsl:if>
882
    <xsl:call-template name="partintro.titlepage.separator"/>
883
  </div>
884
</xsl:template>
885

    
886
<xsl:template match="*" mode="partintro.titlepage.recto.mode">
887
  <!-- if an element isn't found in this mode, -->
888
  <!-- try the generic titlepage.mode -->
889
  <xsl:apply-templates select="." mode="titlepage.mode"/>
890
</xsl:template>
891

    
892
<xsl:template match="*" mode="partintro.titlepage.verso.mode">
893
  <!-- if an element isn't found in this mode, -->
894
  <!-- try the generic titlepage.mode -->
895
  <xsl:apply-templates select="." mode="titlepage.mode"/>
896
</xsl:template>
897

    
898
<xsl:template match="title" mode="partintro.titlepage.recto.auto.mode">
899
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
900
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
901
</div>
902
</xsl:template>
903

    
904
<xsl:template match="subtitle" mode="partintro.titlepage.recto.auto.mode">
905
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
906
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
907
</div>
908
</xsl:template>
909

    
910
<xsl:template match="corpauthor" mode="partintro.titlepage.recto.auto.mode">
911
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
912
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
913
</div>
914
</xsl:template>
915

    
916
<xsl:template match="authorgroup" mode="partintro.titlepage.recto.auto.mode">
917
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
918
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
919
</div>
920
</xsl:template>
921

    
922
<xsl:template match="author" mode="partintro.titlepage.recto.auto.mode">
923
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
924
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
925
</div>
926
</xsl:template>
927

    
928
<xsl:template match="othercredit" mode="partintro.titlepage.recto.auto.mode">
929
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
930
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
931
</div>
932
</xsl:template>
933

    
934
<xsl:template match="releaseinfo" mode="partintro.titlepage.recto.auto.mode">
935
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
936
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
937
</div>
938
</xsl:template>
939

    
940
<xsl:template match="copyright" mode="partintro.titlepage.recto.auto.mode">
941
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
942
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
943
</div>
944
</xsl:template>
945

    
946
<xsl:template match="legalnotice" mode="partintro.titlepage.recto.auto.mode">
947
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
948
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
949
</div>
950
</xsl:template>
951

    
952
<xsl:template match="pubdate" mode="partintro.titlepage.recto.auto.mode">
953
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
954
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
955
</div>
956
</xsl:template>
957

    
958
<xsl:template match="revision" mode="partintro.titlepage.recto.auto.mode">
959
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
960
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
961
</div>
962
</xsl:template>
963

    
964
<xsl:template match="revhistory" mode="partintro.titlepage.recto.auto.mode">
965
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
966
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
967
</div>
968
</xsl:template>
969

    
970
<xsl:template match="abstract" mode="partintro.titlepage.recto.auto.mode">
971
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
972
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
973
</div>
974
</xsl:template>
975

    
976
<xsl:template name="reference.titlepage.recto">
977
  <xsl:choose>
978
    <xsl:when test="referenceinfo/title">
979
      <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/title"/>
980
    </xsl:when>
981
    <xsl:when test="docinfo/title">
982
      <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/title"/>
983
    </xsl:when>
984
    <xsl:when test="info/title">
985
      <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/title"/>
986
    </xsl:when>
987
    <xsl:when test="title">
988
      <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="title"/>
989
    </xsl:when>
990
  </xsl:choose>
991

    
992
  <xsl:choose>
993
    <xsl:when test="referenceinfo/subtitle">
994
      <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/subtitle"/>
995
    </xsl:when>
996
    <xsl:when test="docinfo/subtitle">
997
      <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
998
    </xsl:when>
999
    <xsl:when test="info/subtitle">
1000
      <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/subtitle"/>
1001
    </xsl:when>
1002
    <xsl:when test="subtitle">
1003
      <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="subtitle"/>
1004
    </xsl:when>
1005
  </xsl:choose>
1006

    
1007
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/corpauthor"/>
1008
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
1009
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/corpauthor"/>
1010
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/authorgroup"/>
1011
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
1012
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/authorgroup"/>
1013
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/author"/>
1014
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/author"/>
1015
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/author"/>
1016
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/othercredit"/>
1017
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
1018
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/othercredit"/>
1019
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/releaseinfo"/>
1020
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
1021
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/releaseinfo"/>
1022
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/copyright"/>
1023
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/copyright"/>
1024
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/copyright"/>
1025
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/legalnotice"/>
1026
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
1027
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/legalnotice"/>
1028
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/pubdate"/>
1029
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
1030
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/pubdate"/>
1031
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/revision"/>
1032
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/revision"/>
1033
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/revision"/>
1034
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/revhistory"/>
1035
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
1036
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/revhistory"/>
1037
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/abstract"/>
1038
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/abstract"/>
1039
  <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/abstract"/>
1040
</xsl:template>
1041

    
1042
<xsl:template name="reference.titlepage.verso">
1043
</xsl:template>
1044

    
1045
<xsl:template name="reference.titlepage.separator"><hr/>
1046
</xsl:template>
1047

    
1048
<xsl:template name="reference.titlepage.before.recto">
1049
</xsl:template>
1050

    
1051
<xsl:template name="reference.titlepage.before.verso">
1052
</xsl:template>
1053

    
1054
<xsl:template name="reference.titlepage">
1055
  <div class="titlepage">
1056
    <xsl:variable name="recto.content">
1057
      <xsl:call-template name="reference.titlepage.before.recto"/>
1058
      <xsl:call-template name="reference.titlepage.recto"/>
1059
    </xsl:variable>
1060
    <xsl:variable name="recto.elements.count">
1061
      <xsl:choose>
1062
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1063
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1064
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1065
        <xsl:otherwise>1</xsl:otherwise>
1066
      </xsl:choose>
1067
    </xsl:variable>
1068
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
1069
      <div><xsl:copy-of select="$recto.content"/></div>
1070
    </xsl:if>
1071
    <xsl:variable name="verso.content">
1072
      <xsl:call-template name="reference.titlepage.before.verso"/>
1073
      <xsl:call-template name="reference.titlepage.verso"/>
1074
    </xsl:variable>
1075
    <xsl:variable name="verso.elements.count">
1076
      <xsl:choose>
1077
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1078
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1079
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1080
        <xsl:otherwise>1</xsl:otherwise>
1081
      </xsl:choose>
1082
    </xsl:variable>
1083
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
1084
      <div><xsl:copy-of select="$verso.content"/></div>
1085
    </xsl:if>
1086
    <xsl:call-template name="reference.titlepage.separator"/>
1087
  </div>
1088
</xsl:template>
1089

    
1090
<xsl:template match="*" mode="reference.titlepage.recto.mode">
1091
  <!-- if an element isn't found in this mode, -->
1092
  <!-- try the generic titlepage.mode -->
1093
  <xsl:apply-templates select="." mode="titlepage.mode"/>
1094
</xsl:template>
1095

    
1096
<xsl:template match="*" mode="reference.titlepage.verso.mode">
1097
  <!-- if an element isn't found in this mode, -->
1098
  <!-- try the generic titlepage.mode -->
1099
  <xsl:apply-templates select="." mode="titlepage.mode"/>
1100
</xsl:template>
1101

    
1102
<xsl:template match="title" mode="reference.titlepage.recto.auto.mode">
1103
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
1104
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1105
</div>
1106
</xsl:template>
1107

    
1108
<xsl:template match="subtitle" mode="reference.titlepage.recto.auto.mode">
1109
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
1110
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1111
</div>
1112
</xsl:template>
1113

    
1114
<xsl:template match="corpauthor" mode="reference.titlepage.recto.auto.mode">
1115
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
1116
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1117
</div>
1118
</xsl:template>
1119

    
1120
<xsl:template match="authorgroup" mode="reference.titlepage.recto.auto.mode">
1121
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
1122
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1123
</div>
1124
</xsl:template>
1125

    
1126
<xsl:template match="author" mode="reference.titlepage.recto.auto.mode">
1127
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
1128
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1129
</div>
1130
</xsl:template>
1131

    
1132
<xsl:template match="othercredit" mode="reference.titlepage.recto.auto.mode">
1133
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
1134
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1135
</div>
1136
</xsl:template>
1137

    
1138
<xsl:template match="releaseinfo" mode="reference.titlepage.recto.auto.mode">
1139
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
1140
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1141
</div>
1142
</xsl:template>
1143

    
1144
<xsl:template match="copyright" mode="reference.titlepage.recto.auto.mode">
1145
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
1146
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1147
</div>
1148
</xsl:template>
1149

    
1150
<xsl:template match="legalnotice" mode="reference.titlepage.recto.auto.mode">
1151
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
1152
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1153
</div>
1154
</xsl:template>
1155

    
1156
<xsl:template match="pubdate" mode="reference.titlepage.recto.auto.mode">
1157
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
1158
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1159
</div>
1160
</xsl:template>
1161

    
1162
<xsl:template match="revision" mode="reference.titlepage.recto.auto.mode">
1163
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
1164
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1165
</div>
1166
</xsl:template>
1167

    
1168
<xsl:template match="revhistory" mode="reference.titlepage.recto.auto.mode">
1169
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
1170
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1171
</div>
1172
</xsl:template>
1173

    
1174
<xsl:template match="abstract" mode="reference.titlepage.recto.auto.mode">
1175
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
1176
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
1177
</div>
1178
</xsl:template>
1179

    
1180
<xsl:template name="refentry.titlepage.recto">
1181
</xsl:template>
1182

    
1183
<xsl:template name="refentry.titlepage.verso">
1184
</xsl:template>
1185

    
1186
<xsl:template name="refentry.titlepage.separator">
1187
</xsl:template>
1188

    
1189
<xsl:template name="refentry.titlepage.before.recto">
1190
</xsl:template>
1191

    
1192
<xsl:template name="refentry.titlepage.before.verso">
1193
</xsl:template>
1194

    
1195
<xsl:template name="refentry.titlepage">
1196
  <div class="titlepage">
1197
    <xsl:variable name="recto.content">
1198
      <xsl:call-template name="refentry.titlepage.before.recto"/>
1199
      <xsl:call-template name="refentry.titlepage.recto"/>
1200
    </xsl:variable>
1201
    <xsl:variable name="recto.elements.count">
1202
      <xsl:choose>
1203
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1204
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1205
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1206
        <xsl:otherwise>1</xsl:otherwise>
1207
      </xsl:choose>
1208
    </xsl:variable>
1209
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
1210
      <div><xsl:copy-of select="$recto.content"/></div>
1211
    </xsl:if>
1212
    <xsl:variable name="verso.content">
1213
      <xsl:call-template name="refentry.titlepage.before.verso"/>
1214
      <xsl:call-template name="refentry.titlepage.verso"/>
1215
    </xsl:variable>
1216
    <xsl:variable name="verso.elements.count">
1217
      <xsl:choose>
1218
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1219
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1220
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1221
        <xsl:otherwise>1</xsl:otherwise>
1222
      </xsl:choose>
1223
    </xsl:variable>
1224
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
1225
      <div><xsl:copy-of select="$verso.content"/></div>
1226
    </xsl:if>
1227
    <xsl:call-template name="refentry.titlepage.separator"/>
1228
  </div>
1229
</xsl:template>
1230

    
1231
<xsl:template match="*" mode="refentry.titlepage.recto.mode">
1232
  <!-- if an element isn't found in this mode, -->
1233
  <!-- try the generic titlepage.mode -->
1234
  <xsl:apply-templates select="." mode="titlepage.mode"/>
1235
</xsl:template>
1236

    
1237
<xsl:template match="*" mode="refentry.titlepage.verso.mode">
1238
  <!-- if an element isn't found in this mode, -->
1239
  <!-- try the generic titlepage.mode -->
1240
  <xsl:apply-templates select="." mode="titlepage.mode"/>
1241
</xsl:template>
1242

    
1243
<xsl:template name="dedication.titlepage.recto">
1244
  <div xsl:use-attribute-sets="dedication.titlepage.recto.style">
1245
<xsl:call-template name="component.title">
1246
<xsl:with-param name="node" select="ancestor-or-self::dedication[1]"/>
1247
</xsl:call-template></div>
1248
  <xsl:choose>
1249
    <xsl:when test="dedicationinfo/subtitle">
1250
      <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="dedicationinfo/subtitle"/>
1251
    </xsl:when>
1252
    <xsl:when test="docinfo/subtitle">
1253
      <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
1254
    </xsl:when>
1255
    <xsl:when test="info/subtitle">
1256
      <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="info/subtitle"/>
1257
    </xsl:when>
1258
    <xsl:when test="subtitle">
1259
      <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="subtitle"/>
1260
    </xsl:when>
1261
  </xsl:choose>
1262

    
1263
</xsl:template>
1264

    
1265
<xsl:template name="dedication.titlepage.verso">
1266
</xsl:template>
1267

    
1268
<xsl:template name="dedication.titlepage.separator">
1269
</xsl:template>
1270

    
1271
<xsl:template name="dedication.titlepage.before.recto">
1272
</xsl:template>
1273

    
1274
<xsl:template name="dedication.titlepage.before.verso">
1275
</xsl:template>
1276

    
1277
<xsl:template name="dedication.titlepage">
1278
  <div class="titlepage">
1279
    <xsl:variable name="recto.content">
1280
      <xsl:call-template name="dedication.titlepage.before.recto"/>
1281
      <xsl:call-template name="dedication.titlepage.recto"/>
1282
    </xsl:variable>
1283
    <xsl:variable name="recto.elements.count">
1284
      <xsl:choose>
1285
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1286
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1287
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1288
        <xsl:otherwise>1</xsl:otherwise>
1289
      </xsl:choose>
1290
    </xsl:variable>
1291
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
1292
      <div><xsl:copy-of select="$recto.content"/></div>
1293
    </xsl:if>
1294
    <xsl:variable name="verso.content">
1295
      <xsl:call-template name="dedication.titlepage.before.verso"/>
1296
      <xsl:call-template name="dedication.titlepage.verso"/>
1297
    </xsl:variable>
1298
    <xsl:variable name="verso.elements.count">
1299
      <xsl:choose>
1300
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1301
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1302
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1303
        <xsl:otherwise>1</xsl:otherwise>
1304
      </xsl:choose>
1305
    </xsl:variable>
1306
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
1307
      <div><xsl:copy-of select="$verso.content"/></div>
1308
    </xsl:if>
1309
    <xsl:call-template name="dedication.titlepage.separator"/>
1310
  </div>
1311
</xsl:template>
1312

    
1313
<xsl:template match="*" mode="dedication.titlepage.recto.mode">
1314
  <!-- if an element isn't found in this mode, -->
1315
  <!-- try the generic titlepage.mode -->
1316
  <xsl:apply-templates select="." mode="titlepage.mode"/>
1317
</xsl:template>
1318

    
1319
<xsl:template match="*" mode="dedication.titlepage.verso.mode">
1320
  <!-- if an element isn't found in this mode, -->
1321
  <!-- try the generic titlepage.mode -->
1322
  <xsl:apply-templates select="." mode="titlepage.mode"/>
1323
</xsl:template>
1324

    
1325
<xsl:template match="subtitle" mode="dedication.titlepage.recto.auto.mode">
1326
<div xsl:use-attribute-sets="dedication.titlepage.recto.style">
1327
<xsl:apply-templates select="." mode="dedication.titlepage.recto.mode"/>
1328
</div>
1329
</xsl:template>
1330

    
1331
<xsl:template name="acknowledgements.titlepage.recto">
1332
  <div xsl:use-attribute-sets="acknowledgements.titlepage.recto.style">
1333
<xsl:call-template name="component.title">
1334
<xsl:with-param name="node" select="ancestor-or-self::acknowledgements[1]"/>
1335
</xsl:call-template></div>
1336
  <xsl:choose>
1337
    <xsl:when test="acknowledgementsinfo/subtitle">
1338
      <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="acknowledgementsinfo/subtitle"/>
1339
    </xsl:when>
1340
    <xsl:when test="docinfo/subtitle">
1341
      <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
1342
    </xsl:when>
1343
    <xsl:when test="info/subtitle">
1344
      <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="info/subtitle"/>
1345
    </xsl:when>
1346
    <xsl:when test="subtitle">
1347
      <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="subtitle"/>
1348
    </xsl:when>
1349
  </xsl:choose>
1350

    
1351
</xsl:template>
1352

    
1353
<xsl:template name="acknowledgements.titlepage.verso">
1354
</xsl:template>
1355

    
1356
<xsl:template name="acknowledgements.titlepage.separator">
1357
</xsl:template>
1358

    
1359
<xsl:template name="acknowledgements.titlepage.before.recto">
1360
</xsl:template>
1361

    
1362
<xsl:template name="acknowledgements.titlepage.before.verso">
1363
</xsl:template>
1364

    
1365
<xsl:template name="acknowledgements.titlepage">
1366
  <div class="titlepage">
1367
    <xsl:variable name="recto.content">
1368
      <xsl:call-template name="acknowledgements.titlepage.before.recto"/>
1369
      <xsl:call-template name="acknowledgements.titlepage.recto"/>
1370
    </xsl:variable>
1371
    <xsl:variable name="recto.elements.count">
1372
      <xsl:choose>
1373
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1374
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1375
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1376
        <xsl:otherwise>1</xsl:otherwise>
1377
      </xsl:choose>
1378
    </xsl:variable>
1379
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
1380
      <div><xsl:copy-of select="$recto.content"/></div>
1381
    </xsl:if>
1382
    <xsl:variable name="verso.content">
1383
      <xsl:call-template name="acknowledgements.titlepage.before.verso"/>
1384
      <xsl:call-template name="acknowledgements.titlepage.verso"/>
1385
    </xsl:variable>
1386
    <xsl:variable name="verso.elements.count">
1387
      <xsl:choose>
1388
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1389
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1390
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1391
        <xsl:otherwise>1</xsl:otherwise>
1392
      </xsl:choose>
1393
    </xsl:variable>
1394
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
1395
      <div><xsl:copy-of select="$verso.content"/></div>
1396
    </xsl:if>
1397
    <xsl:call-template name="acknowledgements.titlepage.separator"/>
1398
  </div>
1399
</xsl:template>
1400

    
1401
<xsl:template match="*" mode="acknowledgements.titlepage.recto.mode">
1402
  <!-- if an element isn't found in this mode, -->
1403
  <!-- try the generic titlepage.mode -->
1404
  <xsl:apply-templates select="." mode="titlepage.mode"/>
1405
</xsl:template>
1406

    
1407
<xsl:template match="*" mode="acknowledgements.titlepage.verso.mode">
1408
  <!-- if an element isn't found in this mode, -->
1409
  <!-- try the generic titlepage.mode -->
1410
  <xsl:apply-templates select="." mode="titlepage.mode"/>
1411
</xsl:template>
1412

    
1413
<xsl:template match="subtitle" mode="acknowledgements.titlepage.recto.auto.mode">
1414
<div xsl:use-attribute-sets="acknowledgements.titlepage.recto.style">
1415
<xsl:apply-templates select="." mode="acknowledgements.titlepage.recto.mode"/>
1416
</div>
1417
</xsl:template>
1418

    
1419
<xsl:template name="preface.titlepage.recto">
1420
  <xsl:choose>
1421
    <xsl:when test="prefaceinfo/title">
1422
      <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/title"/>
1423
    </xsl:when>
1424
    <xsl:when test="docinfo/title">
1425
      <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/title"/>
1426
    </xsl:when>
1427
    <xsl:when test="info/title">
1428
      <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/title"/>
1429
    </xsl:when>
1430
    <xsl:when test="title">
1431
      <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="title"/>
1432
    </xsl:when>
1433
  </xsl:choose>
1434

    
1435
  <xsl:choose>
1436
    <xsl:when test="prefaceinfo/subtitle">
1437
      <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/subtitle"/>
1438
    </xsl:when>
1439
    <xsl:when test="docinfo/subtitle">
1440
      <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
1441
    </xsl:when>
1442
    <xsl:when test="info/subtitle">
1443
      <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/subtitle"/>
1444
    </xsl:when>
1445
    <xsl:when test="subtitle">
1446
      <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="subtitle"/>
1447
    </xsl:when>
1448
  </xsl:choose>
1449

    
1450
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/corpauthor"/>
1451
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
1452
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/corpauthor"/>
1453
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/authorgroup"/>
1454
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
1455
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/authorgroup"/>
1456
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/author"/>
1457
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/author"/>
1458
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/author"/>
1459
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/othercredit"/>
1460
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
1461
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/othercredit"/>
1462
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/releaseinfo"/>
1463
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
1464
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/releaseinfo"/>
1465
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/copyright"/>
1466
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/copyright"/>
1467
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/copyright"/>
1468
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/legalnotice"/>
1469
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
1470
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/legalnotice"/>
1471
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/pubdate"/>
1472
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
1473
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/pubdate"/>
1474
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/revision"/>
1475
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/revision"/>
1476
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/revision"/>
1477
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/revhistory"/>
1478
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
1479
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/revhistory"/>
1480
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/abstract"/>
1481
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/abstract"/>
1482
  <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/abstract"/>
1483
</xsl:template>
1484

    
1485
<xsl:template name="preface.titlepage.verso">
1486
</xsl:template>
1487

    
1488
<xsl:template name="preface.titlepage.separator">
1489
</xsl:template>
1490

    
1491
<xsl:template name="preface.titlepage.before.recto">
1492
</xsl:template>
1493

    
1494
<xsl:template name="preface.titlepage.before.verso">
1495
</xsl:template>
1496

    
1497
<xsl:template name="preface.titlepage">
1498
  <div class="titlepage">
1499
    <xsl:variable name="recto.content">
1500
      <xsl:call-template name="preface.titlepage.before.recto"/>
1501
      <xsl:call-template name="preface.titlepage.recto"/>
1502
    </xsl:variable>
1503
    <xsl:variable name="recto.elements.count">
1504
      <xsl:choose>
1505
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1506
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1507
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1508
        <xsl:otherwise>1</xsl:otherwise>
1509
      </xsl:choose>
1510
    </xsl:variable>
1511
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
1512
      <div><xsl:copy-of select="$recto.content"/></div>
1513
    </xsl:if>
1514
    <xsl:variable name="verso.content">
1515
      <xsl:call-template name="preface.titlepage.before.verso"/>
1516
      <xsl:call-template name="preface.titlepage.verso"/>
1517
    </xsl:variable>
1518
    <xsl:variable name="verso.elements.count">
1519
      <xsl:choose>
1520
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1521
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1522
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1523
        <xsl:otherwise>1</xsl:otherwise>
1524
      </xsl:choose>
1525
    </xsl:variable>
1526
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
1527
      <div><xsl:copy-of select="$verso.content"/></div>
1528
    </xsl:if>
1529
    <xsl:call-template name="preface.titlepage.separator"/>
1530
  </div>
1531
</xsl:template>
1532

    
1533
<xsl:template match="*" mode="preface.titlepage.recto.mode">
1534
  <!-- if an element isn't found in this mode, -->
1535
  <!-- try the generic titlepage.mode -->
1536
  <xsl:apply-templates select="." mode="titlepage.mode"/>
1537
</xsl:template>
1538

    
1539
<xsl:template match="*" mode="preface.titlepage.verso.mode">
1540
  <!-- if an element isn't found in this mode, -->
1541
  <!-- try the generic titlepage.mode -->
1542
  <xsl:apply-templates select="." mode="titlepage.mode"/>
1543
</xsl:template>
1544

    
1545
<xsl:template match="title" mode="preface.titlepage.recto.auto.mode">
1546
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
1547
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1548
</div>
1549
</xsl:template>
1550

    
1551
<xsl:template match="subtitle" mode="preface.titlepage.recto.auto.mode">
1552
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
1553
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1554
</div>
1555
</xsl:template>
1556

    
1557
<xsl:template match="corpauthor" mode="preface.titlepage.recto.auto.mode">
1558
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
1559
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1560
</div>
1561
</xsl:template>
1562

    
1563
<xsl:template match="authorgroup" mode="preface.titlepage.recto.auto.mode">
1564
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
1565
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1566
</div>
1567
</xsl:template>
1568

    
1569
<xsl:template match="author" mode="preface.titlepage.recto.auto.mode">
1570
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
1571
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1572
</div>
1573
</xsl:template>
1574

    
1575
<xsl:template match="othercredit" mode="preface.titlepage.recto.auto.mode">
1576
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
1577
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1578
</div>
1579
</xsl:template>
1580

    
1581
<xsl:template match="releaseinfo" mode="preface.titlepage.recto.auto.mode">
1582
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
1583
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1584
</div>
1585
</xsl:template>
1586

    
1587
<xsl:template match="copyright" mode="preface.titlepage.recto.auto.mode">
1588
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
1589
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1590
</div>
1591
</xsl:template>
1592

    
1593
<xsl:template match="legalnotice" mode="preface.titlepage.recto.auto.mode">
1594
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
1595
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1596
</div>
1597
</xsl:template>
1598

    
1599
<xsl:template match="pubdate" mode="preface.titlepage.recto.auto.mode">
1600
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
1601
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1602
</div>
1603
</xsl:template>
1604

    
1605
<xsl:template match="revision" mode="preface.titlepage.recto.auto.mode">
1606
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
1607
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1608
</div>
1609
</xsl:template>
1610

    
1611
<xsl:template match="revhistory" mode="preface.titlepage.recto.auto.mode">
1612
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
1613
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1614
</div>
1615
</xsl:template>
1616

    
1617
<xsl:template match="abstract" mode="preface.titlepage.recto.auto.mode">
1618
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
1619
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
1620
</div>
1621
</xsl:template>
1622

    
1623
<xsl:template name="chapter.titlepage.recto">
1624
  <xsl:choose>
1625
    <xsl:when test="chapterinfo/title">
1626
      <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/title"/>
1627
    </xsl:when>
1628
    <xsl:when test="docinfo/title">
1629
      <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/title"/>
1630
    </xsl:when>
1631
    <xsl:when test="info/title">
1632
      <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/title"/>
1633
    </xsl:when>
1634
    <xsl:when test="title">
1635
      <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="title"/>
1636
    </xsl:when>
1637
  </xsl:choose>
1638

    
1639
  <xsl:choose>
1640
    <xsl:when test="chapterinfo/subtitle">
1641
      <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/subtitle"/>
1642
    </xsl:when>
1643
    <xsl:when test="docinfo/subtitle">
1644
      <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
1645
    </xsl:when>
1646
    <xsl:when test="info/subtitle">
1647
      <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/subtitle"/>
1648
    </xsl:when>
1649
    <xsl:when test="subtitle">
1650
      <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="subtitle"/>
1651
    </xsl:when>
1652
  </xsl:choose>
1653

    
1654
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/corpauthor"/>
1655
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
1656
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/corpauthor"/>
1657
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/authorgroup"/>
1658
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
1659
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/authorgroup"/>
1660
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/author"/>
1661
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/author"/>
1662
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/author"/>
1663
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/othercredit"/>
1664
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
1665
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/othercredit"/>
1666
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/releaseinfo"/>
1667
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
1668
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/releaseinfo"/>
1669
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/copyright"/>
1670
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/copyright"/>
1671
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/copyright"/>
1672
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/legalnotice"/>
1673
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
1674
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/legalnotice"/>
1675
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/pubdate"/>
1676
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
1677
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/pubdate"/>
1678
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/revision"/>
1679
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/revision"/>
1680
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/revision"/>
1681
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/revhistory"/>
1682
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
1683
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/revhistory"/>
1684
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/abstract"/>
1685
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/abstract"/>
1686
  <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/abstract"/>
1687
</xsl:template>
1688

    
1689
<xsl:template name="chapter.titlepage.verso">
1690
</xsl:template>
1691

    
1692
<xsl:template name="chapter.titlepage.separator">
1693
</xsl:template>
1694

    
1695
<xsl:template name="chapter.titlepage.before.recto">
1696
</xsl:template>
1697

    
1698
<xsl:template name="chapter.titlepage.before.verso">
1699
</xsl:template>
1700

    
1701
<xsl:template name="chapter.titlepage">
1702
  <div class="titlepage">
1703
    <xsl:variable name="recto.content">
1704
      <xsl:call-template name="chapter.titlepage.before.recto"/>
1705
      <xsl:call-template name="chapter.titlepage.recto"/>
1706
    </xsl:variable>
1707
    <xsl:variable name="recto.elements.count">
1708
      <xsl:choose>
1709
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1710
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1711
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1712
        <xsl:otherwise>1</xsl:otherwise>
1713
      </xsl:choose>
1714
    </xsl:variable>
1715
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
1716
      <div><xsl:copy-of select="$recto.content"/></div>
1717
    </xsl:if>
1718
    <xsl:variable name="verso.content">
1719
      <xsl:call-template name="chapter.titlepage.before.verso"/>
1720
      <xsl:call-template name="chapter.titlepage.verso"/>
1721
    </xsl:variable>
1722
    <xsl:variable name="verso.elements.count">
1723
      <xsl:choose>
1724
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1725
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1726
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1727
        <xsl:otherwise>1</xsl:otherwise>
1728
      </xsl:choose>
1729
    </xsl:variable>
1730
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
1731
      <div><xsl:copy-of select="$verso.content"/></div>
1732
    </xsl:if>
1733
    <xsl:call-template name="chapter.titlepage.separator"/>
1734
  </div>
1735
</xsl:template>
1736

    
1737
<xsl:template match="*" mode="chapter.titlepage.recto.mode">
1738
  <!-- if an element isn't found in this mode, -->
1739
  <!-- try the generic titlepage.mode -->
1740
  <xsl:apply-templates select="." mode="titlepage.mode"/>
1741
</xsl:template>
1742

    
1743
<xsl:template match="*" mode="chapter.titlepage.verso.mode">
1744
  <!-- if an element isn't found in this mode, -->
1745
  <!-- try the generic titlepage.mode -->
1746
  <xsl:apply-templates select="." mode="titlepage.mode"/>
1747
</xsl:template>
1748

    
1749
<xsl:template match="title" mode="chapter.titlepage.recto.auto.mode">
1750
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1751
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1752
</div>
1753
</xsl:template>
1754

    
1755
<xsl:template match="subtitle" mode="chapter.titlepage.recto.auto.mode">
1756
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1757
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1758
</div>
1759
</xsl:template>
1760

    
1761
<xsl:template match="corpauthor" mode="chapter.titlepage.recto.auto.mode">
1762
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1763
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1764
</div>
1765
</xsl:template>
1766

    
1767
<xsl:template match="authorgroup" mode="chapter.titlepage.recto.auto.mode">
1768
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1769
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1770
</div>
1771
</xsl:template>
1772

    
1773
<xsl:template match="author" mode="chapter.titlepage.recto.auto.mode">
1774
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1775
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1776
</div>
1777
</xsl:template>
1778

    
1779
<xsl:template match="othercredit" mode="chapter.titlepage.recto.auto.mode">
1780
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1781
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1782
</div>
1783
</xsl:template>
1784

    
1785
<xsl:template match="releaseinfo" mode="chapter.titlepage.recto.auto.mode">
1786
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1787
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1788
</div>
1789
</xsl:template>
1790

    
1791
<xsl:template match="copyright" mode="chapter.titlepage.recto.auto.mode">
1792
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1793
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1794
</div>
1795
</xsl:template>
1796

    
1797
<xsl:template match="legalnotice" mode="chapter.titlepage.recto.auto.mode">
1798
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1799
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1800
</div>
1801
</xsl:template>
1802

    
1803
<xsl:template match="pubdate" mode="chapter.titlepage.recto.auto.mode">
1804
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1805
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1806
</div>
1807
</xsl:template>
1808

    
1809
<xsl:template match="revision" mode="chapter.titlepage.recto.auto.mode">
1810
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1811
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1812
</div>
1813
</xsl:template>
1814

    
1815
<xsl:template match="revhistory" mode="chapter.titlepage.recto.auto.mode">
1816
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1817
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1818
</div>
1819
</xsl:template>
1820

    
1821
<xsl:template match="abstract" mode="chapter.titlepage.recto.auto.mode">
1822
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
1823
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
1824
</div>
1825
</xsl:template>
1826

    
1827
<xsl:template name="appendix.titlepage.recto">
1828
  <xsl:choose>
1829
    <xsl:when test="appendixinfo/title">
1830
      <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/title"/>
1831
    </xsl:when>
1832
    <xsl:when test="docinfo/title">
1833
      <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/title"/>
1834
    </xsl:when>
1835
    <xsl:when test="info/title">
1836
      <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/title"/>
1837
    </xsl:when>
1838
    <xsl:when test="title">
1839
      <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="title"/>
1840
    </xsl:when>
1841
  </xsl:choose>
1842

    
1843
  <xsl:choose>
1844
    <xsl:when test="appendixinfo/subtitle">
1845
      <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/subtitle"/>
1846
    </xsl:when>
1847
    <xsl:when test="docinfo/subtitle">
1848
      <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
1849
    </xsl:when>
1850
    <xsl:when test="info/subtitle">
1851
      <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/subtitle"/>
1852
    </xsl:when>
1853
    <xsl:when test="subtitle">
1854
      <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="subtitle"/>
1855
    </xsl:when>
1856
  </xsl:choose>
1857

    
1858
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/corpauthor"/>
1859
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
1860
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/corpauthor"/>
1861
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/authorgroup"/>
1862
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
1863
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/authorgroup"/>
1864
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/author"/>
1865
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/author"/>
1866
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/author"/>
1867
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/othercredit"/>
1868
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
1869
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/othercredit"/>
1870
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/releaseinfo"/>
1871
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
1872
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/releaseinfo"/>
1873
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/copyright"/>
1874
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/copyright"/>
1875
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/copyright"/>
1876
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/legalnotice"/>
1877
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
1878
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/legalnotice"/>
1879
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/pubdate"/>
1880
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
1881
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/pubdate"/>
1882
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/revision"/>
1883
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/revision"/>
1884
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/revision"/>
1885
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/revhistory"/>
1886
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
1887
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/revhistory"/>
1888
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/abstract"/>
1889
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/abstract"/>
1890
  <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/abstract"/>
1891
</xsl:template>
1892

    
1893
<xsl:template name="appendix.titlepage.verso">
1894
</xsl:template>
1895

    
1896
<xsl:template name="appendix.titlepage.separator">
1897
</xsl:template>
1898

    
1899
<xsl:template name="appendix.titlepage.before.recto">
1900
</xsl:template>
1901

    
1902
<xsl:template name="appendix.titlepage.before.verso">
1903
</xsl:template>
1904

    
1905
<xsl:template name="appendix.titlepage">
1906
  <div class="titlepage">
1907
    <xsl:variable name="recto.content">
1908
      <xsl:call-template name="appendix.titlepage.before.recto"/>
1909
      <xsl:call-template name="appendix.titlepage.recto"/>
1910
    </xsl:variable>
1911
    <xsl:variable name="recto.elements.count">
1912
      <xsl:choose>
1913
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1914
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1915
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
1916
        <xsl:otherwise>1</xsl:otherwise>
1917
      </xsl:choose>
1918
    </xsl:variable>
1919
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
1920
      <div><xsl:copy-of select="$recto.content"/></div>
1921
    </xsl:if>
1922
    <xsl:variable name="verso.content">
1923
      <xsl:call-template name="appendix.titlepage.before.verso"/>
1924
      <xsl:call-template name="appendix.titlepage.verso"/>
1925
    </xsl:variable>
1926
    <xsl:variable name="verso.elements.count">
1927
      <xsl:choose>
1928
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1929
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
1930
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
1931
        <xsl:otherwise>1</xsl:otherwise>
1932
      </xsl:choose>
1933
    </xsl:variable>
1934
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
1935
      <div><xsl:copy-of select="$verso.content"/></div>
1936
    </xsl:if>
1937
    <xsl:call-template name="appendix.titlepage.separator"/>
1938
  </div>
1939
</xsl:template>
1940

    
1941
<xsl:template match="*" mode="appendix.titlepage.recto.mode">
1942
  <!-- if an element isn't found in this mode, -->
1943
  <!-- try the generic titlepage.mode -->
1944
  <xsl:apply-templates select="." mode="titlepage.mode"/>
1945
</xsl:template>
1946

    
1947
<xsl:template match="*" mode="appendix.titlepage.verso.mode">
1948
  <!-- if an element isn't found in this mode, -->
1949
  <!-- try the generic titlepage.mode -->
1950
  <xsl:apply-templates select="." mode="titlepage.mode"/>
1951
</xsl:template>
1952

    
1953
<xsl:template match="title" mode="appendix.titlepage.recto.auto.mode">
1954
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
1955
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
1956
</div>
1957
</xsl:template>
1958

    
1959
<xsl:template match="subtitle" mode="appendix.titlepage.recto.auto.mode">
1960
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
1961
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
1962
</div>
1963
</xsl:template>
1964

    
1965
<xsl:template match="corpauthor" mode="appendix.titlepage.recto.auto.mode">
1966
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
1967
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
1968
</div>
1969
</xsl:template>
1970

    
1971
<xsl:template match="authorgroup" mode="appendix.titlepage.recto.auto.mode">
1972
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
1973
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
1974
</div>
1975
</xsl:template>
1976

    
1977
<xsl:template match="author" mode="appendix.titlepage.recto.auto.mode">
1978
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
1979
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
1980
</div>
1981
</xsl:template>
1982

    
1983
<xsl:template match="othercredit" mode="appendix.titlepage.recto.auto.mode">
1984
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
1985
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
1986
</div>
1987
</xsl:template>
1988

    
1989
<xsl:template match="releaseinfo" mode="appendix.titlepage.recto.auto.mode">
1990
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
1991
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
1992
</div>
1993
</xsl:template>
1994

    
1995
<xsl:template match="copyright" mode="appendix.titlepage.recto.auto.mode">
1996
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
1997
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
1998
</div>
1999
</xsl:template>
2000

    
2001
<xsl:template match="legalnotice" mode="appendix.titlepage.recto.auto.mode">
2002
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2003
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2004
</div>
2005
</xsl:template>
2006

    
2007
<xsl:template match="pubdate" mode="appendix.titlepage.recto.auto.mode">
2008
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2009
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2010
</div>
2011
</xsl:template>
2012

    
2013
<xsl:template match="revision" mode="appendix.titlepage.recto.auto.mode">
2014
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2015
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2016
</div>
2017
</xsl:template>
2018

    
2019
<xsl:template match="revhistory" mode="appendix.titlepage.recto.auto.mode">
2020
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2021
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2022
</div>
2023
</xsl:template>
2024

    
2025
<xsl:template match="abstract" mode="appendix.titlepage.recto.auto.mode">
2026
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
2027
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
2028
</div>
2029
</xsl:template>
2030

    
2031
<xsl:template name="section.titlepage.recto">
2032
  <xsl:choose>
2033
    <xsl:when test="sectioninfo/title">
2034
      <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/title"/>
2035
    </xsl:when>
2036
    <xsl:when test="info/title">
2037
      <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/title"/>
2038
    </xsl:when>
2039
    <xsl:when test="title">
2040
      <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="title"/>
2041
    </xsl:when>
2042
  </xsl:choose>
2043

    
2044
  <xsl:choose>
2045
    <xsl:when test="sectioninfo/subtitle">
2046
      <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/subtitle"/>
2047
    </xsl:when>
2048
    <xsl:when test="info/subtitle">
2049
      <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/subtitle"/>
2050
    </xsl:when>
2051
    <xsl:when test="subtitle">
2052
      <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="subtitle"/>
2053
    </xsl:when>
2054
  </xsl:choose>
2055

    
2056
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/corpauthor"/>
2057
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/corpauthor"/>
2058
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/authorgroup"/>
2059
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/authorgroup"/>
2060
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/author"/>
2061
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/author"/>
2062
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/othercredit"/>
2063
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/othercredit"/>
2064
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/releaseinfo"/>
2065
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/releaseinfo"/>
2066
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/copyright"/>
2067
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/copyright"/>
2068
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/legalnotice"/>
2069
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/legalnotice"/>
2070
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/pubdate"/>
2071
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/pubdate"/>
2072
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/revision"/>
2073
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/revision"/>
2074
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/revhistory"/>
2075
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/revhistory"/>
2076
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/abstract"/>
2077
  <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/abstract"/>
2078
</xsl:template>
2079

    
2080
<xsl:template name="section.titlepage.verso">
2081
</xsl:template>
2082

    
2083
<xsl:template name="section.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
2084
</xsl:template>
2085

    
2086
<xsl:template name="section.titlepage.before.recto">
2087
</xsl:template>
2088

    
2089
<xsl:template name="section.titlepage.before.verso">
2090
</xsl:template>
2091

    
2092
<xsl:template name="section.titlepage">
2093
  <div class="titlepage">
2094
    <xsl:variable name="recto.content">
2095
      <xsl:call-template name="section.titlepage.before.recto"/>
2096
      <xsl:call-template name="section.titlepage.recto"/>
2097
    </xsl:variable>
2098
    <xsl:variable name="recto.elements.count">
2099
      <xsl:choose>
2100
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2101
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2102
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2103
        <xsl:otherwise>1</xsl:otherwise>
2104
      </xsl:choose>
2105
    </xsl:variable>
2106
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
2107
      <div><xsl:copy-of select="$recto.content"/></div>
2108
    </xsl:if>
2109
    <xsl:variable name="verso.content">
2110
      <xsl:call-template name="section.titlepage.before.verso"/>
2111
      <xsl:call-template name="section.titlepage.verso"/>
2112
    </xsl:variable>
2113
    <xsl:variable name="verso.elements.count">
2114
      <xsl:choose>
2115
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2116
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2117
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2118
        <xsl:otherwise>1</xsl:otherwise>
2119
      </xsl:choose>
2120
    </xsl:variable>
2121
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
2122
      <div><xsl:copy-of select="$verso.content"/></div>
2123
    </xsl:if>
2124
    <xsl:call-template name="section.titlepage.separator"/>
2125
  </div>
2126
</xsl:template>
2127

    
2128
<xsl:template match="*" mode="section.titlepage.recto.mode">
2129
  <!-- if an element isn't found in this mode, -->
2130
  <!-- try the generic titlepage.mode -->
2131
  <xsl:apply-templates select="." mode="titlepage.mode"/>
2132
</xsl:template>
2133

    
2134
<xsl:template match="*" mode="section.titlepage.verso.mode">
2135
  <!-- if an element isn't found in this mode, -->
2136
  <!-- try the generic titlepage.mode -->
2137
  <xsl:apply-templates select="." mode="titlepage.mode"/>
2138
</xsl:template>
2139

    
2140
<xsl:template match="title" mode="section.titlepage.recto.auto.mode">
2141
<div xsl:use-attribute-sets="section.titlepage.recto.style">
2142
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2143
</div>
2144
</xsl:template>
2145

    
2146
<xsl:template match="subtitle" mode="section.titlepage.recto.auto.mode">
2147
<div xsl:use-attribute-sets="section.titlepage.recto.style">
2148
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2149
</div>
2150
</xsl:template>
2151

    
2152
<xsl:template match="corpauthor" mode="section.titlepage.recto.auto.mode">
2153
<div xsl:use-attribute-sets="section.titlepage.recto.style">
2154
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2155
</div>
2156
</xsl:template>
2157

    
2158
<xsl:template match="authorgroup" mode="section.titlepage.recto.auto.mode">
2159
<div xsl:use-attribute-sets="section.titlepage.recto.style">
2160
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2161
</div>
2162
</xsl:template>
2163

    
2164
<xsl:template match="author" mode="section.titlepage.recto.auto.mode">
2165
<div xsl:use-attribute-sets="section.titlepage.recto.style">
2166
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2167
</div>
2168
</xsl:template>
2169

    
2170
<xsl:template match="othercredit" mode="section.titlepage.recto.auto.mode">
2171
<div xsl:use-attribute-sets="section.titlepage.recto.style">
2172
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2173
</div>
2174
</xsl:template>
2175

    
2176
<xsl:template match="releaseinfo" mode="section.titlepage.recto.auto.mode">
2177
<div xsl:use-attribute-sets="section.titlepage.recto.style">
2178
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2179
</div>
2180
</xsl:template>
2181

    
2182
<xsl:template match="copyright" mode="section.titlepage.recto.auto.mode">
2183
<div xsl:use-attribute-sets="section.titlepage.recto.style">
2184
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2185
</div>
2186
</xsl:template>
2187

    
2188
<xsl:template match="legalnotice" mode="section.titlepage.recto.auto.mode">
2189
<div xsl:use-attribute-sets="section.titlepage.recto.style">
2190
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2191
</div>
2192
</xsl:template>
2193

    
2194
<xsl:template match="pubdate" mode="section.titlepage.recto.auto.mode">
2195
<div xsl:use-attribute-sets="section.titlepage.recto.style">
2196
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2197
</div>
2198
</xsl:template>
2199

    
2200
<xsl:template match="revision" mode="section.titlepage.recto.auto.mode">
2201
<div xsl:use-attribute-sets="section.titlepage.recto.style">
2202
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2203
</div>
2204
</xsl:template>
2205

    
2206
<xsl:template match="revhistory" mode="section.titlepage.recto.auto.mode">
2207
<div xsl:use-attribute-sets="section.titlepage.recto.style">
2208
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2209
</div>
2210
</xsl:template>
2211

    
2212
<xsl:template match="abstract" mode="section.titlepage.recto.auto.mode">
2213
<div xsl:use-attribute-sets="section.titlepage.recto.style">
2214
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
2215
</div>
2216
</xsl:template>
2217

    
2218
<xsl:template name="sect1.titlepage.recto">
2219
  <xsl:choose>
2220
    <xsl:when test="sect1info/title">
2221
      <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/title"/>
2222
    </xsl:when>
2223
    <xsl:when test="info/title">
2224
      <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/title"/>
2225
    </xsl:when>
2226
    <xsl:when test="title">
2227
      <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="title"/>
2228
    </xsl:when>
2229
  </xsl:choose>
2230

    
2231
  <xsl:choose>
2232
    <xsl:when test="sect1info/subtitle">
2233
      <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/subtitle"/>
2234
    </xsl:when>
2235
    <xsl:when test="info/subtitle">
2236
      <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/subtitle"/>
2237
    </xsl:when>
2238
    <xsl:when test="subtitle">
2239
      <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="subtitle"/>
2240
    </xsl:when>
2241
  </xsl:choose>
2242

    
2243
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/corpauthor"/>
2244
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/corpauthor"/>
2245
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/authorgroup"/>
2246
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/authorgroup"/>
2247
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/author"/>
2248
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/author"/>
2249
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/othercredit"/>
2250
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/othercredit"/>
2251
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/releaseinfo"/>
2252
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/releaseinfo"/>
2253
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/copyright"/>
2254
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/copyright"/>
2255
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/legalnotice"/>
2256
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/legalnotice"/>
2257
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/pubdate"/>
2258
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/pubdate"/>
2259
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/revision"/>
2260
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/revision"/>
2261
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/revhistory"/>
2262
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/revhistory"/>
2263
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/abstract"/>
2264
  <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/abstract"/>
2265
</xsl:template>
2266

    
2267
<xsl:template name="sect1.titlepage.verso">
2268
</xsl:template>
2269

    
2270
<xsl:template name="sect1.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
2271
</xsl:template>
2272

    
2273
<xsl:template name="sect1.titlepage.before.recto">
2274
</xsl:template>
2275

    
2276
<xsl:template name="sect1.titlepage.before.verso">
2277
</xsl:template>
2278

    
2279
<xsl:template name="sect1.titlepage">
2280
  <div class="titlepage">
2281
    <xsl:variable name="recto.content">
2282
      <xsl:call-template name="sect1.titlepage.before.recto"/>
2283
      <xsl:call-template name="sect1.titlepage.recto"/>
2284
    </xsl:variable>
2285
    <xsl:variable name="recto.elements.count">
2286
      <xsl:choose>
2287
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2288
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2289
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2290
        <xsl:otherwise>1</xsl:otherwise>
2291
      </xsl:choose>
2292
    </xsl:variable>
2293
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
2294
      <div><xsl:copy-of select="$recto.content"/></div>
2295
    </xsl:if>
2296
    <xsl:variable name="verso.content">
2297
      <xsl:call-template name="sect1.titlepage.before.verso"/>
2298
      <xsl:call-template name="sect1.titlepage.verso"/>
2299
    </xsl:variable>
2300
    <xsl:variable name="verso.elements.count">
2301
      <xsl:choose>
2302
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2303
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2304
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2305
        <xsl:otherwise>1</xsl:otherwise>
2306
      </xsl:choose>
2307
    </xsl:variable>
2308
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
2309
      <div><xsl:copy-of select="$verso.content"/></div>
2310
    </xsl:if>
2311
    <xsl:call-template name="sect1.titlepage.separator"/>
2312
  </div>
2313
</xsl:template>
2314

    
2315
<xsl:template match="*" mode="sect1.titlepage.recto.mode">
2316
  <!-- if an element isn't found in this mode, -->
2317
  <!-- try the generic titlepage.mode -->
2318
  <xsl:apply-templates select="." mode="titlepage.mode"/>
2319
</xsl:template>
2320

    
2321
<xsl:template match="*" mode="sect1.titlepage.verso.mode">
2322
  <!-- if an element isn't found in this mode, -->
2323
  <!-- try the generic titlepage.mode -->
2324
  <xsl:apply-templates select="." mode="titlepage.mode"/>
2325
</xsl:template>
2326

    
2327
<xsl:template match="title" mode="sect1.titlepage.recto.auto.mode">
2328
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2329
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2330
</div>
2331
</xsl:template>
2332

    
2333
<xsl:template match="subtitle" mode="sect1.titlepage.recto.auto.mode">
2334
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2335
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2336
</div>
2337
</xsl:template>
2338

    
2339
<xsl:template match="corpauthor" mode="sect1.titlepage.recto.auto.mode">
2340
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2341
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2342
</div>
2343
</xsl:template>
2344

    
2345
<xsl:template match="authorgroup" mode="sect1.titlepage.recto.auto.mode">
2346
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2347
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2348
</div>
2349
</xsl:template>
2350

    
2351
<xsl:template match="author" mode="sect1.titlepage.recto.auto.mode">
2352
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2353
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2354
</div>
2355
</xsl:template>
2356

    
2357
<xsl:template match="othercredit" mode="sect1.titlepage.recto.auto.mode">
2358
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2359
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2360
</div>
2361
</xsl:template>
2362

    
2363
<xsl:template match="releaseinfo" mode="sect1.titlepage.recto.auto.mode">
2364
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2365
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2366
</div>
2367
</xsl:template>
2368

    
2369
<xsl:template match="copyright" mode="sect1.titlepage.recto.auto.mode">
2370
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2371
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2372
</div>
2373
</xsl:template>
2374

    
2375
<xsl:template match="legalnotice" mode="sect1.titlepage.recto.auto.mode">
2376
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2377
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2378
</div>
2379
</xsl:template>
2380

    
2381
<xsl:template match="pubdate" mode="sect1.titlepage.recto.auto.mode">
2382
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2383
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2384
</div>
2385
</xsl:template>
2386

    
2387
<xsl:template match="revision" mode="sect1.titlepage.recto.auto.mode">
2388
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2389
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2390
</div>
2391
</xsl:template>
2392

    
2393
<xsl:template match="revhistory" mode="sect1.titlepage.recto.auto.mode">
2394
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2395
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2396
</div>
2397
</xsl:template>
2398

    
2399
<xsl:template match="abstract" mode="sect1.titlepage.recto.auto.mode">
2400
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
2401
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
2402
</div>
2403
</xsl:template>
2404

    
2405
<xsl:template name="sect2.titlepage.recto">
2406
  <xsl:choose>
2407
    <xsl:when test="sect2info/title">
2408
      <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/title"/>
2409
    </xsl:when>
2410
    <xsl:when test="info/title">
2411
      <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/title"/>
2412
    </xsl:when>
2413
    <xsl:when test="title">
2414
      <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="title"/>
2415
    </xsl:when>
2416
  </xsl:choose>
2417

    
2418
  <xsl:choose>
2419
    <xsl:when test="sect2info/subtitle">
2420
      <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/subtitle"/>
2421
    </xsl:when>
2422
    <xsl:when test="info/subtitle">
2423
      <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/subtitle"/>
2424
    </xsl:when>
2425
    <xsl:when test="subtitle">
2426
      <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="subtitle"/>
2427
    </xsl:when>
2428
  </xsl:choose>
2429

    
2430
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/corpauthor"/>
2431
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/corpauthor"/>
2432
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/authorgroup"/>
2433
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/authorgroup"/>
2434
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/author"/>
2435
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/author"/>
2436
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/othercredit"/>
2437
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/othercredit"/>
2438
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/releaseinfo"/>
2439
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/releaseinfo"/>
2440
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/copyright"/>
2441
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/copyright"/>
2442
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/legalnotice"/>
2443
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/legalnotice"/>
2444
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/pubdate"/>
2445
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/pubdate"/>
2446
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/revision"/>
2447
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/revision"/>
2448
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/revhistory"/>
2449
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/revhistory"/>
2450
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/abstract"/>
2451
  <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/abstract"/>
2452
</xsl:template>
2453

    
2454
<xsl:template name="sect2.titlepage.verso">
2455
</xsl:template>
2456

    
2457
<xsl:template name="sect2.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
2458
</xsl:template>
2459

    
2460
<xsl:template name="sect2.titlepage.before.recto">
2461
</xsl:template>
2462

    
2463
<xsl:template name="sect2.titlepage.before.verso">
2464
</xsl:template>
2465

    
2466
<xsl:template name="sect2.titlepage">
2467
  <div class="titlepage">
2468
    <xsl:variable name="recto.content">
2469
      <xsl:call-template name="sect2.titlepage.before.recto"/>
2470
      <xsl:call-template name="sect2.titlepage.recto"/>
2471
    </xsl:variable>
2472
    <xsl:variable name="recto.elements.count">
2473
      <xsl:choose>
2474
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2475
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2476
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2477
        <xsl:otherwise>1</xsl:otherwise>
2478
      </xsl:choose>
2479
    </xsl:variable>
2480
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
2481
      <div><xsl:copy-of select="$recto.content"/></div>
2482
    </xsl:if>
2483
    <xsl:variable name="verso.content">
2484
      <xsl:call-template name="sect2.titlepage.before.verso"/>
2485
      <xsl:call-template name="sect2.titlepage.verso"/>
2486
    </xsl:variable>
2487
    <xsl:variable name="verso.elements.count">
2488
      <xsl:choose>
2489
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2490
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2491
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2492
        <xsl:otherwise>1</xsl:otherwise>
2493
      </xsl:choose>
2494
    </xsl:variable>
2495
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
2496
      <div><xsl:copy-of select="$verso.content"/></div>
2497
    </xsl:if>
2498
    <xsl:call-template name="sect2.titlepage.separator"/>
2499
  </div>
2500
</xsl:template>
2501

    
2502
<xsl:template match="*" mode="sect2.titlepage.recto.mode">
2503
  <!-- if an element isn't found in this mode, -->
2504
  <!-- try the generic titlepage.mode -->
2505
  <xsl:apply-templates select="." mode="titlepage.mode"/>
2506
</xsl:template>
2507

    
2508
<xsl:template match="*" mode="sect2.titlepage.verso.mode">
2509
  <!-- if an element isn't found in this mode, -->
2510
  <!-- try the generic titlepage.mode -->
2511
  <xsl:apply-templates select="." mode="titlepage.mode"/>
2512
</xsl:template>
2513

    
2514
<xsl:template match="title" mode="sect2.titlepage.recto.auto.mode">
2515
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2516
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2517
</div>
2518
</xsl:template>
2519

    
2520
<xsl:template match="subtitle" mode="sect2.titlepage.recto.auto.mode">
2521
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2522
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2523
</div>
2524
</xsl:template>
2525

    
2526
<xsl:template match="corpauthor" mode="sect2.titlepage.recto.auto.mode">
2527
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2528
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2529
</div>
2530
</xsl:template>
2531

    
2532
<xsl:template match="authorgroup" mode="sect2.titlepage.recto.auto.mode">
2533
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2534
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2535
</div>
2536
</xsl:template>
2537

    
2538
<xsl:template match="author" mode="sect2.titlepage.recto.auto.mode">
2539
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2540
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2541
</div>
2542
</xsl:template>
2543

    
2544
<xsl:template match="othercredit" mode="sect2.titlepage.recto.auto.mode">
2545
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2546
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2547
</div>
2548
</xsl:template>
2549

    
2550
<xsl:template match="releaseinfo" mode="sect2.titlepage.recto.auto.mode">
2551
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2552
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2553
</div>
2554
</xsl:template>
2555

    
2556
<xsl:template match="copyright" mode="sect2.titlepage.recto.auto.mode">
2557
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2558
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2559
</div>
2560
</xsl:template>
2561

    
2562
<xsl:template match="legalnotice" mode="sect2.titlepage.recto.auto.mode">
2563
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2564
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2565
</div>
2566
</xsl:template>
2567

    
2568
<xsl:template match="pubdate" mode="sect2.titlepage.recto.auto.mode">
2569
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2570
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2571
</div>
2572
</xsl:template>
2573

    
2574
<xsl:template match="revision" mode="sect2.titlepage.recto.auto.mode">
2575
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2576
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2577
</div>
2578
</xsl:template>
2579

    
2580
<xsl:template match="revhistory" mode="sect2.titlepage.recto.auto.mode">
2581
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2582
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2583
</div>
2584
</xsl:template>
2585

    
2586
<xsl:template match="abstract" mode="sect2.titlepage.recto.auto.mode">
2587
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
2588
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
2589
</div>
2590
</xsl:template>
2591

    
2592
<xsl:template name="sect3.titlepage.recto">
2593
  <xsl:choose>
2594
    <xsl:when test="sect3info/title">
2595
      <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/title"/>
2596
    </xsl:when>
2597
    <xsl:when test="info/title">
2598
      <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/title"/>
2599
    </xsl:when>
2600
    <xsl:when test="title">
2601
      <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="title"/>
2602
    </xsl:when>
2603
  </xsl:choose>
2604

    
2605
  <xsl:choose>
2606
    <xsl:when test="sect3info/subtitle">
2607
      <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/subtitle"/>
2608
    </xsl:when>
2609
    <xsl:when test="info/subtitle">
2610
      <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/subtitle"/>
2611
    </xsl:when>
2612
    <xsl:when test="subtitle">
2613
      <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="subtitle"/>
2614
    </xsl:when>
2615
  </xsl:choose>
2616

    
2617
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/corpauthor"/>
2618
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/corpauthor"/>
2619
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/authorgroup"/>
2620
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/authorgroup"/>
2621
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/author"/>
2622
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/author"/>
2623
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/othercredit"/>
2624
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/othercredit"/>
2625
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/releaseinfo"/>
2626
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/releaseinfo"/>
2627
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/copyright"/>
2628
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/copyright"/>
2629
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/legalnotice"/>
2630
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/legalnotice"/>
2631
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/pubdate"/>
2632
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/pubdate"/>
2633
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/revision"/>
2634
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/revision"/>
2635
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/revhistory"/>
2636
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/revhistory"/>
2637
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/abstract"/>
2638
  <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/abstract"/>
2639
</xsl:template>
2640

    
2641
<xsl:template name="sect3.titlepage.verso">
2642
</xsl:template>
2643

    
2644
<xsl:template name="sect3.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
2645
</xsl:template>
2646

    
2647
<xsl:template name="sect3.titlepage.before.recto">
2648
</xsl:template>
2649

    
2650
<xsl:template name="sect3.titlepage.before.verso">
2651
</xsl:template>
2652

    
2653
<xsl:template name="sect3.titlepage">
2654
  <div class="titlepage">
2655
    <xsl:variable name="recto.content">
2656
      <xsl:call-template name="sect3.titlepage.before.recto"/>
2657
      <xsl:call-template name="sect3.titlepage.recto"/>
2658
    </xsl:variable>
2659
    <xsl:variable name="recto.elements.count">
2660
      <xsl:choose>
2661
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2662
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2663
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2664
        <xsl:otherwise>1</xsl:otherwise>
2665
      </xsl:choose>
2666
    </xsl:variable>
2667
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
2668
      <div><xsl:copy-of select="$recto.content"/></div>
2669
    </xsl:if>
2670
    <xsl:variable name="verso.content">
2671
      <xsl:call-template name="sect3.titlepage.before.verso"/>
2672
      <xsl:call-template name="sect3.titlepage.verso"/>
2673
    </xsl:variable>
2674
    <xsl:variable name="verso.elements.count">
2675
      <xsl:choose>
2676
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2677
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2678
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2679
        <xsl:otherwise>1</xsl:otherwise>
2680
      </xsl:choose>
2681
    </xsl:variable>
2682
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
2683
      <div><xsl:copy-of select="$verso.content"/></div>
2684
    </xsl:if>
2685
    <xsl:call-template name="sect3.titlepage.separator"/>
2686
  </div>
2687
</xsl:template>
2688

    
2689
<xsl:template match="*" mode="sect3.titlepage.recto.mode">
2690
  <!-- if an element isn't found in this mode, -->
2691
  <!-- try the generic titlepage.mode -->
2692
  <xsl:apply-templates select="." mode="titlepage.mode"/>
2693
</xsl:template>
2694

    
2695
<xsl:template match="*" mode="sect3.titlepage.verso.mode">
2696
  <!-- if an element isn't found in this mode, -->
2697
  <!-- try the generic titlepage.mode -->
2698
  <xsl:apply-templates select="." mode="titlepage.mode"/>
2699
</xsl:template>
2700

    
2701
<xsl:template match="title" mode="sect3.titlepage.recto.auto.mode">
2702
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2703
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2704
</div>
2705
</xsl:template>
2706

    
2707
<xsl:template match="subtitle" mode="sect3.titlepage.recto.auto.mode">
2708
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2709
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2710
</div>
2711
</xsl:template>
2712

    
2713
<xsl:template match="corpauthor" mode="sect3.titlepage.recto.auto.mode">
2714
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2715
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2716
</div>
2717
</xsl:template>
2718

    
2719
<xsl:template match="authorgroup" mode="sect3.titlepage.recto.auto.mode">
2720
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2721
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2722
</div>
2723
</xsl:template>
2724

    
2725
<xsl:template match="author" mode="sect3.titlepage.recto.auto.mode">
2726
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2727
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2728
</div>
2729
</xsl:template>
2730

    
2731
<xsl:template match="othercredit" mode="sect3.titlepage.recto.auto.mode">
2732
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2733
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2734
</div>
2735
</xsl:template>
2736

    
2737
<xsl:template match="releaseinfo" mode="sect3.titlepage.recto.auto.mode">
2738
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2739
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2740
</div>
2741
</xsl:template>
2742

    
2743
<xsl:template match="copyright" mode="sect3.titlepage.recto.auto.mode">
2744
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2745
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2746
</div>
2747
</xsl:template>
2748

    
2749
<xsl:template match="legalnotice" mode="sect3.titlepage.recto.auto.mode">
2750
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2751
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2752
</div>
2753
</xsl:template>
2754

    
2755
<xsl:template match="pubdate" mode="sect3.titlepage.recto.auto.mode">
2756
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2757
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2758
</div>
2759
</xsl:template>
2760

    
2761
<xsl:template match="revision" mode="sect3.titlepage.recto.auto.mode">
2762
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2763
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2764
</div>
2765
</xsl:template>
2766

    
2767
<xsl:template match="revhistory" mode="sect3.titlepage.recto.auto.mode">
2768
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2769
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2770
</div>
2771
</xsl:template>
2772

    
2773
<xsl:template match="abstract" mode="sect3.titlepage.recto.auto.mode">
2774
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
2775
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
2776
</div>
2777
</xsl:template>
2778

    
2779
<xsl:template name="sect4.titlepage.recto">
2780
  <xsl:choose>
2781
    <xsl:when test="sect4info/title">
2782
      <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/title"/>
2783
    </xsl:when>
2784
    <xsl:when test="info/title">
2785
      <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/title"/>
2786
    </xsl:when>
2787
    <xsl:when test="title">
2788
      <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="title"/>
2789
    </xsl:when>
2790
  </xsl:choose>
2791

    
2792
  <xsl:choose>
2793
    <xsl:when test="sect4info/subtitle">
2794
      <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/subtitle"/>
2795
    </xsl:when>
2796
    <xsl:when test="info/subtitle">
2797
      <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/subtitle"/>
2798
    </xsl:when>
2799
    <xsl:when test="subtitle">
2800
      <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="subtitle"/>
2801
    </xsl:when>
2802
  </xsl:choose>
2803

    
2804
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/corpauthor"/>
2805
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/corpauthor"/>
2806
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/authorgroup"/>
2807
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/authorgroup"/>
2808
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/author"/>
2809
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/author"/>
2810
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/othercredit"/>
2811
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/othercredit"/>
2812
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/releaseinfo"/>
2813
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/releaseinfo"/>
2814
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/copyright"/>
2815
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/copyright"/>
2816
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/legalnotice"/>
2817
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/legalnotice"/>
2818
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/pubdate"/>
2819
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/pubdate"/>
2820
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/revision"/>
2821
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/revision"/>
2822
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/revhistory"/>
2823
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/revhistory"/>
2824
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/abstract"/>
2825
  <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/abstract"/>
2826
</xsl:template>
2827

    
2828
<xsl:template name="sect4.titlepage.verso">
2829
</xsl:template>
2830

    
2831
<xsl:template name="sect4.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
2832
</xsl:template>
2833

    
2834
<xsl:template name="sect4.titlepage.before.recto">
2835
</xsl:template>
2836

    
2837
<xsl:template name="sect4.titlepage.before.verso">
2838
</xsl:template>
2839

    
2840
<xsl:template name="sect4.titlepage">
2841
  <div class="titlepage">
2842
    <xsl:variable name="recto.content">
2843
      <xsl:call-template name="sect4.titlepage.before.recto"/>
2844
      <xsl:call-template name="sect4.titlepage.recto"/>
2845
    </xsl:variable>
2846
    <xsl:variable name="recto.elements.count">
2847
      <xsl:choose>
2848
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2849
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2850
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
2851
        <xsl:otherwise>1</xsl:otherwise>
2852
      </xsl:choose>
2853
    </xsl:variable>
2854
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
2855
      <div><xsl:copy-of select="$recto.content"/></div>
2856
    </xsl:if>
2857
    <xsl:variable name="verso.content">
2858
      <xsl:call-template name="sect4.titlepage.before.verso"/>
2859
      <xsl:call-template name="sect4.titlepage.verso"/>
2860
    </xsl:variable>
2861
    <xsl:variable name="verso.elements.count">
2862
      <xsl:choose>
2863
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2864
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
2865
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
2866
        <xsl:otherwise>1</xsl:otherwise>
2867
      </xsl:choose>
2868
    </xsl:variable>
2869
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
2870
      <div><xsl:copy-of select="$verso.content"/></div>
2871
    </xsl:if>
2872
    <xsl:call-template name="sect4.titlepage.separator"/>
2873
  </div>
2874
</xsl:template>
2875

    
2876
<xsl:template match="*" mode="sect4.titlepage.recto.mode">
2877
  <!-- if an element isn't found in this mode, -->
2878
  <!-- try the generic titlepage.mode -->
2879
  <xsl:apply-templates select="." mode="titlepage.mode"/>
2880
</xsl:template>
2881

    
2882
<xsl:template match="*" mode="sect4.titlepage.verso.mode">
2883
  <!-- if an element isn't found in this mode, -->
2884
  <!-- try the generic titlepage.mode -->
2885
  <xsl:apply-templates select="." mode="titlepage.mode"/>
2886
</xsl:template>
2887

    
2888
<xsl:template match="title" mode="sect4.titlepage.recto.auto.mode">
2889
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
2890
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
2891
</div>
2892
</xsl:template>
2893

    
2894
<xsl:template match="subtitle" mode="sect4.titlepage.recto.auto.mode">
2895
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
2896
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
2897
</div>
2898
</xsl:template>
2899

    
2900
<xsl:template match="corpauthor" mode="sect4.titlepage.recto.auto.mode">
2901
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
2902
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
2903
</div>
2904
</xsl:template>
2905

    
2906
<xsl:template match="authorgroup" mode="sect4.titlepage.recto.auto.mode">
2907
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
2908
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
2909
</div>
2910
</xsl:template>
2911

    
2912
<xsl:template match="author" mode="sect4.titlepage.recto.auto.mode">
2913
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
2914
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
2915
</div>
2916
</xsl:template>
2917

    
2918
<xsl:template match="othercredit" mode="sect4.titlepage.recto.auto.mode">
2919
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
2920
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
2921
</div>
2922
</xsl:template>
2923

    
2924
<xsl:template match="releaseinfo" mode="sect4.titlepage.recto.auto.mode">
2925
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
2926
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
2927
</div>
2928
</xsl:template>
2929

    
2930
<xsl:template match="copyright" mode="sect4.titlepage.recto.auto.mode">
2931
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
2932
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
2933
</div>
2934
</xsl:template>
2935

    
2936
<xsl:template match="legalnotice" mode="sect4.titlepage.recto.auto.mode">
2937
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
2938
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
2939
</div>
2940
</xsl:template>
2941

    
2942
<xsl:template match="pubdate" mode="sect4.titlepage.recto.auto.mode">
2943
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
2944
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
2945
</div>
2946
</xsl:template>
2947

    
2948
<xsl:template match="revision" mode="sect4.titlepage.recto.auto.mode">
2949
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
2950
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
2951
</div>
2952
</xsl:template>
2953

    
2954
<xsl:template match="revhistory" mode="sect4.titlepage.recto.auto.mode">
2955
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
2956
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
2957
</div>
2958
</xsl:template>
2959

    
2960
<xsl:template match="abstract" mode="sect4.titlepage.recto.auto.mode">
2961
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
2962
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
2963
</div>
2964
</xsl:template>
2965

    
2966
<xsl:template name="sect5.titlepage.recto">
2967
  <xsl:choose>
2968
    <xsl:when test="sect5info/title">
2969
      <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/title"/>
2970
    </xsl:when>
2971
    <xsl:when test="info/title">
2972
      <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/title"/>
2973
    </xsl:when>
2974
    <xsl:when test="title">
2975
      <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="title"/>
2976
    </xsl:when>
2977
  </xsl:choose>
2978

    
2979
  <xsl:choose>
2980
    <xsl:when test="sect5info/subtitle">
2981
      <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/subtitle"/>
2982
    </xsl:when>
2983
    <xsl:when test="info/subtitle">
2984
      <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/subtitle"/>
2985
    </xsl:when>
2986
    <xsl:when test="subtitle">
2987
      <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="subtitle"/>
2988
    </xsl:when>
2989
  </xsl:choose>
2990

    
2991
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/corpauthor"/>
2992
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/corpauthor"/>
2993
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/authorgroup"/>
2994
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/authorgroup"/>
2995
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/author"/>
2996
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/author"/>
2997
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/othercredit"/>
2998
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/othercredit"/>
2999
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/releaseinfo"/>
3000
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/releaseinfo"/>
3001
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/copyright"/>
3002
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/copyright"/>
3003
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/legalnotice"/>
3004
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/legalnotice"/>
3005
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/pubdate"/>
3006
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/pubdate"/>
3007
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/revision"/>
3008
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/revision"/>
3009
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/revhistory"/>
3010
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/revhistory"/>
3011
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/abstract"/>
3012
  <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/abstract"/>
3013
</xsl:template>
3014

    
3015
<xsl:template name="sect5.titlepage.verso">
3016
</xsl:template>
3017

    
3018
<xsl:template name="sect5.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
3019
</xsl:template>
3020

    
3021
<xsl:template name="sect5.titlepage.before.recto">
3022
</xsl:template>
3023

    
3024
<xsl:template name="sect5.titlepage.before.verso">
3025
</xsl:template>
3026

    
3027
<xsl:template name="sect5.titlepage">
3028
  <div class="titlepage">
3029
    <xsl:variable name="recto.content">
3030
      <xsl:call-template name="sect5.titlepage.before.recto"/>
3031
      <xsl:call-template name="sect5.titlepage.recto"/>
3032
    </xsl:variable>
3033
    <xsl:variable name="recto.elements.count">
3034
      <xsl:choose>
3035
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3036
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3037
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3038
        <xsl:otherwise>1</xsl:otherwise>
3039
      </xsl:choose>
3040
    </xsl:variable>
3041
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
3042
      <div><xsl:copy-of select="$recto.content"/></div>
3043
    </xsl:if>
3044
    <xsl:variable name="verso.content">
3045
      <xsl:call-template name="sect5.titlepage.before.verso"/>
3046
      <xsl:call-template name="sect5.titlepage.verso"/>
3047
    </xsl:variable>
3048
    <xsl:variable name="verso.elements.count">
3049
      <xsl:choose>
3050
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3051
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3052
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3053
        <xsl:otherwise>1</xsl:otherwise>
3054
      </xsl:choose>
3055
    </xsl:variable>
3056
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
3057
      <div><xsl:copy-of select="$verso.content"/></div>
3058
    </xsl:if>
3059
    <xsl:call-template name="sect5.titlepage.separator"/>
3060
  </div>
3061
</xsl:template>
3062

    
3063
<xsl:template match="*" mode="sect5.titlepage.recto.mode">
3064
  <!-- if an element isn't found in this mode, -->
3065
  <!-- try the generic titlepage.mode -->
3066
  <xsl:apply-templates select="." mode="titlepage.mode"/>
3067
</xsl:template>
3068

    
3069
<xsl:template match="*" mode="sect5.titlepage.verso.mode">
3070
  <!-- if an element isn't found in this mode, -->
3071
  <!-- try the generic titlepage.mode -->
3072
  <xsl:apply-templates select="." mode="titlepage.mode"/>
3073
</xsl:template>
3074

    
3075
<xsl:template match="title" mode="sect5.titlepage.recto.auto.mode">
3076
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3077
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3078
</div>
3079
</xsl:template>
3080

    
3081
<xsl:template match="subtitle" mode="sect5.titlepage.recto.auto.mode">
3082
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3083
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3084
</div>
3085
</xsl:template>
3086

    
3087
<xsl:template match="corpauthor" mode="sect5.titlepage.recto.auto.mode">
3088
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3089
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3090
</div>
3091
</xsl:template>
3092

    
3093
<xsl:template match="authorgroup" mode="sect5.titlepage.recto.auto.mode">
3094
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3095
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3096
</div>
3097
</xsl:template>
3098

    
3099
<xsl:template match="author" mode="sect5.titlepage.recto.auto.mode">
3100
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3101
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3102
</div>
3103
</xsl:template>
3104

    
3105
<xsl:template match="othercredit" mode="sect5.titlepage.recto.auto.mode">
3106
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3107
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3108
</div>
3109
</xsl:template>
3110

    
3111
<xsl:template match="releaseinfo" mode="sect5.titlepage.recto.auto.mode">
3112
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3113
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3114
</div>
3115
</xsl:template>
3116

    
3117
<xsl:template match="copyright" mode="sect5.titlepage.recto.auto.mode">
3118
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3119
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3120
</div>
3121
</xsl:template>
3122

    
3123
<xsl:template match="legalnotice" mode="sect5.titlepage.recto.auto.mode">
3124
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3125
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3126
</div>
3127
</xsl:template>
3128

    
3129
<xsl:template match="pubdate" mode="sect5.titlepage.recto.auto.mode">
3130
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3131
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3132
</div>
3133
</xsl:template>
3134

    
3135
<xsl:template match="revision" mode="sect5.titlepage.recto.auto.mode">
3136
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3137
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3138
</div>
3139
</xsl:template>
3140

    
3141
<xsl:template match="revhistory" mode="sect5.titlepage.recto.auto.mode">
3142
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3143
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3144
</div>
3145
</xsl:template>
3146

    
3147
<xsl:template match="abstract" mode="sect5.titlepage.recto.auto.mode">
3148
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
3149
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
3150
</div>
3151
</xsl:template>
3152

    
3153
<xsl:template name="simplesect.titlepage.recto">
3154
  <xsl:choose>
3155
    <xsl:when test="simplesectinfo/title">
3156
      <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/title"/>
3157
    </xsl:when>
3158
    <xsl:when test="docinfo/title">
3159
      <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/title"/>
3160
    </xsl:when>
3161
    <xsl:when test="info/title">
3162
      <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/title"/>
3163
    </xsl:when>
3164
    <xsl:when test="title">
3165
      <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="title"/>
3166
    </xsl:when>
3167
  </xsl:choose>
3168

    
3169
  <xsl:choose>
3170
    <xsl:when test="simplesectinfo/subtitle">
3171
      <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/subtitle"/>
3172
    </xsl:when>
3173
    <xsl:when test="docinfo/subtitle">
3174
      <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
3175
    </xsl:when>
3176
    <xsl:when test="info/subtitle">
3177
      <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/subtitle"/>
3178
    </xsl:when>
3179
    <xsl:when test="subtitle">
3180
      <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="subtitle"/>
3181
    </xsl:when>
3182
  </xsl:choose>
3183

    
3184
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/corpauthor"/>
3185
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
3186
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/corpauthor"/>
3187
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/authorgroup"/>
3188
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
3189
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/authorgroup"/>
3190
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/author"/>
3191
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/author"/>
3192
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/author"/>
3193
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/othercredit"/>
3194
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
3195
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/othercredit"/>
3196
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/releaseinfo"/>
3197
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
3198
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/releaseinfo"/>
3199
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/copyright"/>
3200
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/copyright"/>
3201
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/copyright"/>
3202
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/legalnotice"/>
3203
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
3204
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/legalnotice"/>
3205
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/pubdate"/>
3206
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
3207
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/pubdate"/>
3208
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/revision"/>
3209
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/revision"/>
3210
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/revision"/>
3211
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/revhistory"/>
3212
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
3213
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/revhistory"/>
3214
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/abstract"/>
3215
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/abstract"/>
3216
  <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/abstract"/>
3217
</xsl:template>
3218

    
3219
<xsl:template name="simplesect.titlepage.verso">
3220
</xsl:template>
3221

    
3222
<xsl:template name="simplesect.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
3223
</xsl:template>
3224

    
3225
<xsl:template name="simplesect.titlepage.before.recto">
3226
</xsl:template>
3227

    
3228
<xsl:template name="simplesect.titlepage.before.verso">
3229
</xsl:template>
3230

    
3231
<xsl:template name="simplesect.titlepage">
3232
  <div class="titlepage">
3233
    <xsl:variable name="recto.content">
3234
      <xsl:call-template name="simplesect.titlepage.before.recto"/>
3235
      <xsl:call-template name="simplesect.titlepage.recto"/>
3236
    </xsl:variable>
3237
    <xsl:variable name="recto.elements.count">
3238
      <xsl:choose>
3239
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3240
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3241
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3242
        <xsl:otherwise>1</xsl:otherwise>
3243
      </xsl:choose>
3244
    </xsl:variable>
3245
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
3246
      <div><xsl:copy-of select="$recto.content"/></div>
3247
    </xsl:if>
3248
    <xsl:variable name="verso.content">
3249
      <xsl:call-template name="simplesect.titlepage.before.verso"/>
3250
      <xsl:call-template name="simplesect.titlepage.verso"/>
3251
    </xsl:variable>
3252
    <xsl:variable name="verso.elements.count">
3253
      <xsl:choose>
3254
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3255
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3256
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3257
        <xsl:otherwise>1</xsl:otherwise>
3258
      </xsl:choose>
3259
    </xsl:variable>
3260
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
3261
      <div><xsl:copy-of select="$verso.content"/></div>
3262
    </xsl:if>
3263
    <xsl:call-template name="simplesect.titlepage.separator"/>
3264
  </div>
3265
</xsl:template>
3266

    
3267
<xsl:template match="*" mode="simplesect.titlepage.recto.mode">
3268
  <!-- if an element isn't found in this mode, -->
3269
  <!-- try the generic titlepage.mode -->
3270
  <xsl:apply-templates select="." mode="titlepage.mode"/>
3271
</xsl:template>
3272

    
3273
<xsl:template match="*" mode="simplesect.titlepage.verso.mode">
3274
  <!-- if an element isn't found in this mode, -->
3275
  <!-- try the generic titlepage.mode -->
3276
  <xsl:apply-templates select="." mode="titlepage.mode"/>
3277
</xsl:template>
3278

    
3279
<xsl:template match="title" mode="simplesect.titlepage.recto.auto.mode">
3280
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3281
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3282
</div>
3283
</xsl:template>
3284

    
3285
<xsl:template match="subtitle" mode="simplesect.titlepage.recto.auto.mode">
3286
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3287
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3288
</div>
3289
</xsl:template>
3290

    
3291
<xsl:template match="corpauthor" mode="simplesect.titlepage.recto.auto.mode">
3292
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3293
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3294
</div>
3295
</xsl:template>
3296

    
3297
<xsl:template match="authorgroup" mode="simplesect.titlepage.recto.auto.mode">
3298
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3299
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3300
</div>
3301
</xsl:template>
3302

    
3303
<xsl:template match="author" mode="simplesect.titlepage.recto.auto.mode">
3304
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3305
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3306
</div>
3307
</xsl:template>
3308

    
3309
<xsl:template match="othercredit" mode="simplesect.titlepage.recto.auto.mode">
3310
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3311
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3312
</div>
3313
</xsl:template>
3314

    
3315
<xsl:template match="releaseinfo" mode="simplesect.titlepage.recto.auto.mode">
3316
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3317
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3318
</div>
3319
</xsl:template>
3320

    
3321
<xsl:template match="copyright" mode="simplesect.titlepage.recto.auto.mode">
3322
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3323
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3324
</div>
3325
</xsl:template>
3326

    
3327
<xsl:template match="legalnotice" mode="simplesect.titlepage.recto.auto.mode">
3328
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3329
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3330
</div>
3331
</xsl:template>
3332

    
3333
<xsl:template match="pubdate" mode="simplesect.titlepage.recto.auto.mode">
3334
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3335
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3336
</div>
3337
</xsl:template>
3338

    
3339
<xsl:template match="revision" mode="simplesect.titlepage.recto.auto.mode">
3340
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3341
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3342
</div>
3343
</xsl:template>
3344

    
3345
<xsl:template match="revhistory" mode="simplesect.titlepage.recto.auto.mode">
3346
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3347
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3348
</div>
3349
</xsl:template>
3350

    
3351
<xsl:template match="abstract" mode="simplesect.titlepage.recto.auto.mode">
3352
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
3353
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
3354
</div>
3355
</xsl:template>
3356

    
3357
<xsl:template name="bibliography.titlepage.recto">
3358
  <div xsl:use-attribute-sets="bibliography.titlepage.recto.style">
3359
<xsl:call-template name="component.title">
3360
<xsl:with-param name="node" select="ancestor-or-self::bibliography[1]"/>
3361
</xsl:call-template></div>
3362
  <xsl:choose>
3363
    <xsl:when test="bibliographyinfo/subtitle">
3364
      <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="bibliographyinfo/subtitle"/>
3365
    </xsl:when>
3366
    <xsl:when test="docinfo/subtitle">
3367
      <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
3368
    </xsl:when>
3369
    <xsl:when test="info/subtitle">
3370
      <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="info/subtitle"/>
3371
    </xsl:when>
3372
    <xsl:when test="subtitle">
3373
      <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="subtitle"/>
3374
    </xsl:when>
3375
  </xsl:choose>
3376

    
3377
</xsl:template>
3378

    
3379
<xsl:template name="bibliography.titlepage.verso">
3380
</xsl:template>
3381

    
3382
<xsl:template name="bibliography.titlepage.separator">
3383
</xsl:template>
3384

    
3385
<xsl:template name="bibliography.titlepage.before.recto">
3386
</xsl:template>
3387

    
3388
<xsl:template name="bibliography.titlepage.before.verso">
3389
</xsl:template>
3390

    
3391
<xsl:template name="bibliography.titlepage">
3392
  <div class="titlepage">
3393
    <xsl:variable name="recto.content">
3394
      <xsl:call-template name="bibliography.titlepage.before.recto"/>
3395
      <xsl:call-template name="bibliography.titlepage.recto"/>
3396
    </xsl:variable>
3397
    <xsl:variable name="recto.elements.count">
3398
      <xsl:choose>
3399
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3400
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3401
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3402
        <xsl:otherwise>1</xsl:otherwise>
3403
      </xsl:choose>
3404
    </xsl:variable>
3405
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
3406
      <div><xsl:copy-of select="$recto.content"/></div>
3407
    </xsl:if>
3408
    <xsl:variable name="verso.content">
3409
      <xsl:call-template name="bibliography.titlepage.before.verso"/>
3410
      <xsl:call-template name="bibliography.titlepage.verso"/>
3411
    </xsl:variable>
3412
    <xsl:variable name="verso.elements.count">
3413
      <xsl:choose>
3414
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3415
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3416
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3417
        <xsl:otherwise>1</xsl:otherwise>
3418
      </xsl:choose>
3419
    </xsl:variable>
3420
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
3421
      <div><xsl:copy-of select="$verso.content"/></div>
3422
    </xsl:if>
3423
    <xsl:call-template name="bibliography.titlepage.separator"/>
3424
  </div>
3425
</xsl:template>
3426

    
3427
<xsl:template match="*" mode="bibliography.titlepage.recto.mode">
3428
  <!-- if an element isn't found in this mode, -->
3429
  <!-- try the generic titlepage.mode -->
3430
  <xsl:apply-templates select="." mode="titlepage.mode"/>
3431
</xsl:template>
3432

    
3433
<xsl:template match="*" mode="bibliography.titlepage.verso.mode">
3434
  <!-- if an element isn't found in this mode, -->
3435
  <!-- try the generic titlepage.mode -->
3436
  <xsl:apply-templates select="." mode="titlepage.mode"/>
3437
</xsl:template>
3438

    
3439
<xsl:template match="subtitle" mode="bibliography.titlepage.recto.auto.mode">
3440
<div xsl:use-attribute-sets="bibliography.titlepage.recto.style">
3441
<xsl:apply-templates select="." mode="bibliography.titlepage.recto.mode"/>
3442
</div>
3443
</xsl:template>
3444

    
3445
<xsl:template name="glossary.titlepage.recto">
3446
  <div xsl:use-attribute-sets="glossary.titlepage.recto.style">
3447
<xsl:call-template name="component.title">
3448
<xsl:with-param name="node" select="ancestor-or-self::glossary[1]"/>
3449
</xsl:call-template></div>
3450
  <xsl:choose>
3451
    <xsl:when test="glossaryinfo/subtitle">
3452
      <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="glossaryinfo/subtitle"/>
3453
    </xsl:when>
3454
    <xsl:when test="docinfo/subtitle">
3455
      <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
3456
    </xsl:when>
3457
    <xsl:when test="info/subtitle">
3458
      <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="info/subtitle"/>
3459
    </xsl:when>
3460
    <xsl:when test="subtitle">
3461
      <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="subtitle"/>
3462
    </xsl:when>
3463
  </xsl:choose>
3464

    
3465
</xsl:template>
3466

    
3467
<xsl:template name="glossary.titlepage.verso">
3468
</xsl:template>
3469

    
3470
<xsl:template name="glossary.titlepage.separator">
3471
</xsl:template>
3472

    
3473
<xsl:template name="glossary.titlepage.before.recto">
3474
</xsl:template>
3475

    
3476
<xsl:template name="glossary.titlepage.before.verso">
3477
</xsl:template>
3478

    
3479
<xsl:template name="glossary.titlepage">
3480
  <div class="titlepage">
3481
    <xsl:variable name="recto.content">
3482
      <xsl:call-template name="glossary.titlepage.before.recto"/>
3483
      <xsl:call-template name="glossary.titlepage.recto"/>
3484
    </xsl:variable>
3485
    <xsl:variable name="recto.elements.count">
3486
      <xsl:choose>
3487
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3488
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3489
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3490
        <xsl:otherwise>1</xsl:otherwise>
3491
      </xsl:choose>
3492
    </xsl:variable>
3493
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
3494
      <div><xsl:copy-of select="$recto.content"/></div>
3495
    </xsl:if>
3496
    <xsl:variable name="verso.content">
3497
      <xsl:call-template name="glossary.titlepage.before.verso"/>
3498
      <xsl:call-template name="glossary.titlepage.verso"/>
3499
    </xsl:variable>
3500
    <xsl:variable name="verso.elements.count">
3501
      <xsl:choose>
3502
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3503
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3504
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3505
        <xsl:otherwise>1</xsl:otherwise>
3506
      </xsl:choose>
3507
    </xsl:variable>
3508
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
3509
      <div><xsl:copy-of select="$verso.content"/></div>
3510
    </xsl:if>
3511
    <xsl:call-template name="glossary.titlepage.separator"/>
3512
  </div>
3513
</xsl:template>
3514

    
3515
<xsl:template match="*" mode="glossary.titlepage.recto.mode">
3516
  <!-- if an element isn't found in this mode, -->
3517
  <!-- try the generic titlepage.mode -->
3518
  <xsl:apply-templates select="." mode="titlepage.mode"/>
3519
</xsl:template>
3520

    
3521
<xsl:template match="*" mode="glossary.titlepage.verso.mode">
3522
  <!-- if an element isn't found in this mode, -->
3523
  <!-- try the generic titlepage.mode -->
3524
  <xsl:apply-templates select="." mode="titlepage.mode"/>
3525
</xsl:template>
3526

    
3527
<xsl:template match="subtitle" mode="glossary.titlepage.recto.auto.mode">
3528
<div xsl:use-attribute-sets="glossary.titlepage.recto.style">
3529
<xsl:apply-templates select="." mode="glossary.titlepage.recto.mode"/>
3530
</div>
3531
</xsl:template>
3532

    
3533
<xsl:template name="index.titlepage.recto">
3534
  <div xsl:use-attribute-sets="index.titlepage.recto.style">
3535
<xsl:call-template name="component.title">
3536
<xsl:with-param name="node" select="ancestor-or-self::index[1]"/>
3537
</xsl:call-template></div>
3538
  <xsl:choose>
3539
    <xsl:when test="indexinfo/subtitle">
3540
      <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="indexinfo/subtitle"/>
3541
    </xsl:when>
3542
    <xsl:when test="docinfo/subtitle">
3543
      <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
3544
    </xsl:when>
3545
    <xsl:when test="info/subtitle">
3546
      <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="info/subtitle"/>
3547
    </xsl:when>
3548
    <xsl:when test="subtitle">
3549
      <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="subtitle"/>
3550
    </xsl:when>
3551
  </xsl:choose>
3552

    
3553
</xsl:template>
3554

    
3555
<xsl:template name="index.titlepage.verso">
3556
</xsl:template>
3557

    
3558
<xsl:template name="index.titlepage.separator">
3559
</xsl:template>
3560

    
3561
<xsl:template name="index.titlepage.before.recto">
3562
</xsl:template>
3563

    
3564
<xsl:template name="index.titlepage.before.verso">
3565
</xsl:template>
3566

    
3567
<xsl:template name="index.titlepage">
3568
  <div class="titlepage">
3569
    <xsl:variable name="recto.content">
3570
      <xsl:call-template name="index.titlepage.before.recto"/>
3571
      <xsl:call-template name="index.titlepage.recto"/>
3572
    </xsl:variable>
3573
    <xsl:variable name="recto.elements.count">
3574
      <xsl:choose>
3575
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3576
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3577
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3578
        <xsl:otherwise>1</xsl:otherwise>
3579
      </xsl:choose>
3580
    </xsl:variable>
3581
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
3582
      <div><xsl:copy-of select="$recto.content"/></div>
3583
    </xsl:if>
3584
    <xsl:variable name="verso.content">
3585
      <xsl:call-template name="index.titlepage.before.verso"/>
3586
      <xsl:call-template name="index.titlepage.verso"/>
3587
    </xsl:variable>
3588
    <xsl:variable name="verso.elements.count">
3589
      <xsl:choose>
3590
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3591
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3592
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3593
        <xsl:otherwise>1</xsl:otherwise>
3594
      </xsl:choose>
3595
    </xsl:variable>
3596
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
3597
      <div><xsl:copy-of select="$verso.content"/></div>
3598
    </xsl:if>
3599
    <xsl:call-template name="index.titlepage.separator"/>
3600
  </div>
3601
</xsl:template>
3602

    
3603
<xsl:template match="*" mode="index.titlepage.recto.mode">
3604
  <!-- if an element isn't found in this mode, -->
3605
  <!-- try the generic titlepage.mode -->
3606
  <xsl:apply-templates select="." mode="titlepage.mode"/>
3607
</xsl:template>
3608

    
3609
<xsl:template match="*" mode="index.titlepage.verso.mode">
3610
  <!-- if an element isn't found in this mode, -->
3611
  <!-- try the generic titlepage.mode -->
3612
  <xsl:apply-templates select="." mode="titlepage.mode"/>
3613
</xsl:template>
3614

    
3615
<xsl:template match="subtitle" mode="index.titlepage.recto.auto.mode">
3616
<div xsl:use-attribute-sets="index.titlepage.recto.style">
3617
<xsl:apply-templates select="." mode="index.titlepage.recto.mode"/>
3618
</div>
3619
</xsl:template>
3620

    
3621
<xsl:template name="setindex.titlepage.recto">
3622
  <div xsl:use-attribute-sets="setindex.titlepage.recto.style">
3623
<xsl:call-template name="component.title">
3624
<xsl:with-param name="node" select="ancestor-or-self::setindex[1]"/>
3625
</xsl:call-template></div>
3626
  <xsl:choose>
3627
    <xsl:when test="setindexinfo/subtitle">
3628
      <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="setindexinfo/subtitle"/>
3629
    </xsl:when>
3630
    <xsl:when test="docinfo/subtitle">
3631
      <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
3632
    </xsl:when>
3633
    <xsl:when test="info/subtitle">
3634
      <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="info/subtitle"/>
3635
    </xsl:when>
3636
    <xsl:when test="subtitle">
3637
      <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="subtitle"/>
3638
    </xsl:when>
3639
  </xsl:choose>
3640

    
3641
</xsl:template>
3642

    
3643
<xsl:template name="setindex.titlepage.verso">
3644
</xsl:template>
3645

    
3646
<xsl:template name="setindex.titlepage.separator">
3647
</xsl:template>
3648

    
3649
<xsl:template name="setindex.titlepage.before.recto">
3650
</xsl:template>
3651

    
3652
<xsl:template name="setindex.titlepage.before.verso">
3653
</xsl:template>
3654

    
3655
<xsl:template name="setindex.titlepage">
3656
  <div class="titlepage">
3657
    <xsl:variable name="recto.content">
3658
      <xsl:call-template name="setindex.titlepage.before.recto"/>
3659
      <xsl:call-template name="setindex.titlepage.recto"/>
3660
    </xsl:variable>
3661
    <xsl:variable name="recto.elements.count">
3662
      <xsl:choose>
3663
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3664
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3665
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
3666
        <xsl:otherwise>1</xsl:otherwise>
3667
      </xsl:choose>
3668
    </xsl:variable>
3669
    <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
3670
      <div><xsl:copy-of select="$recto.content"/></div>
3671
    </xsl:if>
3672
    <xsl:variable name="verso.content">
3673
      <xsl:call-template name="setindex.titlepage.before.verso"/>
3674
      <xsl:call-template name="setindex.titlepage.verso"/>
3675
    </xsl:variable>
3676
    <xsl:variable name="verso.elements.count">
3677
      <xsl:choose>
3678
        <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3679
        <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
3680
          <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
3681
        <xsl:otherwise>1</xsl:otherwise>
3682
      </xsl:choose>
3683
    </xsl:variable>
3684
    <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
3685
      <div><xsl:copy-of select="$verso.content"/></div>
3686
    </xsl:if>
3687
    <xsl:call-template name="setindex.titlepage.separator"/>
3688
  </div>
3689
</xsl:template>
3690

    
3691
<xsl:template match="*" mode="setindex.titlepage.recto.mode">
3692
  <!-- if an element isn't found in this mode, -->
3693
  <!-- try the generic titlepage.mode -->
3694
  <xsl:apply-templates select="." mode="titlepage.mode"/>
3695
</xsl:template>
3696

    
3697
<xsl:template match="*" mode="setindex.titlepage.verso.mode">
3698
  <!-- if an element isn't found in this mode, -->
3699
  <!-- try the generic titlepage.mode -->
3700
  <xsl:apply-templates select="." mode="titlepage.mode"/>
3701
</xsl:template>
3702

    
3703
<xsl:template match="subtitle" mode="setindex.titlepage.recto.auto.mode">
3704
<div xsl:use-attribute-sets="setindex.titlepage.recto.style">
3705
<xsl:apply-templates select="." mode="setindex.titlepage.recto.mode"/>
3706
</div>
3707
</xsl:template>
3708

    
3709
</xsl:stylesheet>
3710

    
(35-35/39)