~ubuntu-branches/ubuntu/raring/libjboss-remoting-java/raring

« back to all changes in this revision

Viewing changes to docs/guide/support/support/docbook-xsl/fo/autoidx.xsl

  • Committer: Package Import Robot
  • Author(s): Torsten Werner
  • Date: 2011-09-09 14:01:03 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: package-import@ubuntu.com-20110909140103-hqokx61534tas9rg
Tags: 2.5.3.SP1-1
* Newer but not newest upstream release. Do not build samples.
* Change debian/watch to upstream's svn repo.
* Add patch to fix compile error caused by tomcat update.
  (Closes: #628303)
* Switch to source format 3.0.
* Switch to debhelper level 7.
* Remove useless Depends.
* Update Standards-Version: 3.9.2.
* Update README.source.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
<!DOCTYPE xsl:stylesheet [
 
3
 
 
4
<!ENTITY lowercase "'abcdefghijklmnopqrstuvwxyz'">
 
5
<!ENTITY uppercase "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'">
 
6
 
 
7
<!ENTITY primary   'normalize-space(concat(primary/@sortas, primary[not(@sortas)]))'>
 
8
<!ENTITY secondary 'normalize-space(concat(secondary/@sortas, secondary[not(@sortas)]))'>
 
9
<!ENTITY tertiary  'normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas)]))'>
 
10
 
 
11
<!ENTITY sep '" "'>
 
12
<!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())'>
 
13
]>
 
14
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 
15
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
 
16
                xmlns:rx="http://www.renderx.com/XSL/Extensions"
 
17
                xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
 
18
                version="1.0">
 
19
 
 
20
<!-- ********************************************************************
 
21
     $Id: autoidx.xsl 1341 2006-08-02 16:35:13Z telrod $
 
22
     ********************************************************************
 
23
 
 
24
     This file is part of the DocBook XSL Stylesheet distribution.
 
25
     See ../README or http://docbook.sf.net/ for copyright
 
26
     and other information.
 
27
 
 
28
     ******************************************************************** -->
 
29
 
 
30
<!-- ==================================================================== -->
 
31
<!-- Derived from Jeni Tennison's work in the HTML case -->
 
32
 
 
33
<xsl:key name="letter"
 
34
         match="indexterm"
 
35
         use="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
 
36
 
 
37
<xsl:key name="primary"
 
38
         match="indexterm"
 
39
         use="&primary;"/>
 
40
 
 
41
<xsl:key name="secondary"
 
42
         match="indexterm"
 
43
         use="concat(&primary;, &sep;, &secondary;)"/>
 
44
 
 
45
<xsl:key name="tertiary"
 
46
         match="indexterm"
 
47
         use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/>
 
48
 
 
49
<xsl:key name="endofrange"
 
50
         match="indexterm[@class='endofrange']"
 
51
         use="@startref"/>
 
52
 
 
53
<xsl:key name="see-also"
 
54
         match="indexterm[seealso]"
 
55
         use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, seealso)"/>
 
56
 
 
57
<xsl:key name="see"
 
58
         match="indexterm[see]"
 
59
         use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see)"/>
 
60
 
 
61
<xsl:template name="generate-index">
 
62
  <xsl:param name="scope" select="(ancestor::book|/)[last()]"/>
 
63
 
 
64
  <xsl:variable name="terms"
 
65
                select="//indexterm[count(.|key('letter',
 
66
                                                translate(substring(&primary;, 1, 1),
 
67
                                                          &lowercase;,
 
68
                                                          &uppercase;))[&scope;][1]) = 1
 
69
                                    and not(@class = 'endofrange')]"/>
 
70
 
 
71
  <xsl:variable name="alphabetical"
 
72
                select="$terms[contains(concat(&lowercase;, &uppercase;),
 
73
                                        substring(&primary;, 1, 1))]"/>
 
74
 
 
75
  <xsl:variable name="others" select="$terms[not(contains(concat(&lowercase;,
 
76
                                                 &uppercase;),
 
77
                                             substring(&primary;, 1, 1)))]"/>
 
78
  <fo:block>
 
79
    <xsl:if test="$others">
 
80
      <xsl:call-template name="indexdiv.title">
 
81
        <xsl:with-param name="titlecontent">
 
82
          <xsl:call-template name="gentext">
 
83
            <xsl:with-param name="key" select="'index symbols'"/>
 
84
          </xsl:call-template>
 
85
        </xsl:with-param>
 
86
      </xsl:call-template>
 
87
 
 
88
      <fo:block>
 
89
        <xsl:apply-templates select="$others[count(.|key('primary',
 
90
                                     &primary;)[&scope;][1]) = 1]"
 
91
                             mode="index-symbol-div">
 
92
          <xsl:with-param name="scope" select="$scope"/>
 
93
          <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
 
94
        </xsl:apply-templates>
 
95
      </fo:block>
 
96
    </xsl:if>
 
97
 
 
98
    <xsl:apply-templates select="$alphabetical[count(.|key('letter',
 
99
                                 translate(substring(&primary;, 1, 1),
 
100
                                           &lowercase;,&uppercase;))[&scope;][1]) = 1]"
 
101
                         mode="index-div">
 
102
      <xsl:with-param name="scope" select="$scope"/>
 
103
      <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
 
104
    </xsl:apply-templates>
 
105
  </fo:block>
 
106
</xsl:template>
 
107
 
 
108
<xsl:template match="indexterm" mode="index-div">
 
109
  <xsl:param name="scope" select="."/>
 
110
 
 
111
  <xsl:variable name="key"
 
112
                select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
 
113
 
 
114
  <xsl:if test="key('letter', $key)[&scope;]
 
115
                [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
 
116
    <fo:block>
 
117
      <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
 
118
        <xsl:call-template name="indexdiv.title">
 
119
          <xsl:with-param name="titlecontent">
 
120
            <xsl:value-of select="translate($key, &lowercase;, &uppercase;)"/>
 
121
          </xsl:with-param>
 
122
        </xsl:call-template>
 
123
      </xsl:if>
 
124
      <fo:block>
 
125
        <xsl:apply-templates select="key('letter', $key)[&scope;]
 
126
                                     [count(.|key('primary', &primary;)[&scope;][1])=1]"
 
127
                             mode="index-primary">
 
128
          <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
 
129
          <xsl:with-param name="scope" select="$scope"/>
 
130
        </xsl:apply-templates>
 
131
      </fo:block>
 
132
    </fo:block>
 
133
  </xsl:if>
 
134
</xsl:template>
 
135
 
 
136
<xsl:template match="indexterm" mode="index-symbol-div">
 
137
  <xsl:param name="scope" select="."/>
 
138
 
 
139
  <xsl:variable name="key"
 
140
                select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
 
141
 
 
142
  <fo:block>
 
143
    <xsl:apply-templates select="key('letter', $key)[&scope;][count(.|key('primary', &primary;)[&scope;][1]) = 1]"
 
144
                         mode="index-primary">
 
145
      <xsl:with-param name="scope" select="$scope"/>
 
146
      <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
 
147
    </xsl:apply-templates>
 
148
  </fo:block>
 
149
</xsl:template>
 
150
 
 
151
<xsl:template match="indexterm" mode="index-primary">
 
152
  <xsl:param name="scope" select="."/>
 
153
 
 
154
  <xsl:variable name="key" select="&primary;"/>
 
155
  <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
 
156
  <fo:block>
 
157
    <xsl:if test="$axf.extensions != 0">
 
158
      <xsl:attribute name="axf:suppress-duplicate-page-number">true</xsl:attribute>
 
159
    </xsl:if>
 
160
    <xsl:value-of select="primary"/>
 
161
 
 
162
    <xsl:choose>
 
163
      <xsl:when test="$xep.extensions != 0">
 
164
        <xsl:if test="$refs[not(see) and not(seealso) and not(secondary)]">
 
165
          <xsl:text>, </xsl:text>
 
166
          <xsl:variable name="primary" select="primary"/>
 
167
          <xsl:variable name="primary.significant" select="concat(primary, $significant.flag)"/>
 
168
          <rx:page-index>
 
169
            <xsl:if test="$refs[@significance='preferred'][not(see) and not(seealso) and not(secondary)]">
 
170
              <rx:index-item xsl:use-attribute-sets="index.preferred.page.properties xep.index.item.properties"
 
171
                ref-key="{$primary.significant}"/>
 
172
            </xsl:if>
 
173
            <xsl:if test="$refs[not(@significance) or @significance!='preferred'][not(see) and not(seealso) and not(secondary)]">
 
174
              <rx:index-item xsl:use-attribute-sets="xep.index.item.properties"
 
175
                ref-key="{$primary}"/>
 
176
            </xsl:if>
 
177
          </rx:page-index>        
 
178
        </xsl:if>
 
179
      </xsl:when>
 
180
      <xsl:otherwise>
 
181
        <xsl:variable name="page-number-citations">
 
182
          <xsl:for-each select="$refs[not(see) and not(seealso)
 
183
                                and not(secondary)]">
 
184
            <xsl:apply-templates select="." mode="reference">
 
185
              <xsl:with-param name="scope" select="$scope"/>
 
186
            </xsl:apply-templates>
 
187
          </xsl:for-each>
 
188
        </xsl:variable>
 
189
 
 
190
        <xsl:choose>
 
191
          <xsl:when test="$passivetex.extensions != '0'">
 
192
            <fotex:sort xmlns:fotex="http://www.tug.org/fotex">
 
193
              <xsl:copy-of select="$page-number-citations"/>
 
194
            </fotex:sort>
 
195
          </xsl:when>
 
196
          <xsl:otherwise>
 
197
            <xsl:copy-of select="$page-number-citations"/>
 
198
          </xsl:otherwise>
 
199
        </xsl:choose>
 
200
      </xsl:otherwise>
 
201
    </xsl:choose>
 
202
 
 
203
    <xsl:if test="$refs[not(secondary)]/*[self::see]">
 
204
      <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &sep;, &sep;, see))[&scope;][1])]"
 
205
                           mode="index-see">
 
206
         <xsl:with-param name="scope" select="$scope"/>
 
207
         <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
 
208
      </xsl:apply-templates>
 
209
    </xsl:if>
 
210
 
 
211
  </fo:block>
 
212
 
 
213
  <xsl:if test="$refs/secondary or $refs[not(secondary)]/*[self::seealso]">
 
214
    <fo:block start-indent="1pc">
 
215
      <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &sep;, &sep;, seealso))[&scope;][1])]"
 
216
                           mode="index-seealso">
 
217
         <xsl:with-param name="scope" select="$scope"/>
 
218
         <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
 
219
      </xsl:apply-templates>
 
220
      <xsl:apply-templates select="$refs[secondary and count(.|key('secondary', concat($key, &sep;, &secondary;))[&scope;][1]) = 1]"
 
221
                           mode="index-secondary">
 
222
       <xsl:with-param name="scope" select="$scope"/>
 
223
       <xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/>
 
224
      </xsl:apply-templates>
 
225
    </fo:block>
 
226
  </xsl:if>
 
227
</xsl:template>
 
228
 
 
229
<xsl:template match="indexterm" mode="index-secondary">
 
230
  <xsl:param name="scope" select="."/>
 
231
 
 
232
  <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/>
 
233
  <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
 
234
  <fo:block>
 
235
    <xsl:if test="$axf.extensions != 0">
 
236
      <xsl:attribute name="axf:suppress-duplicate-page-number">true</xsl:attribute>
 
237
    </xsl:if>
 
238
    <xsl:value-of select="secondary"/>
 
239
 
 
240
    <xsl:choose>
 
241
      <xsl:when test="$xep.extensions != 0">
 
242
        <xsl:if test="$refs[not(see) and not(seealso) and not(tertiary)]">
 
243
          <xsl:text>, </xsl:text>
 
244
          <xsl:variable name="primary" select="primary"/>
 
245
          <xsl:variable name="secondary" select="secondary"/>
 
246
          <xsl:variable name="primary.significant" select="concat(primary, $significant.flag)"/>
 
247
          <rx:page-index>
 
248
            <xsl:if test="$refs[@significance='preferred'][not(see) and not(seealso) and not(tertiary)]">
 
249
              <rx:index-item xsl:use-attribute-sets="index.preferred.page.properties xep.index.item.properties">
 
250
                <xsl:attribute name="ref-key">
 
251
                  <xsl:value-of select="$primary.significant"/>
 
252
                  <xsl:text>, </xsl:text>
 
253
                  <xsl:value-of select="$secondary"/>
 
254
                </xsl:attribute>
 
255
              </rx:index-item>
 
256
            </xsl:if>
 
257
            <xsl:if test="$refs[not(@significance) or @significance!='preferred'][not(see) and not(seealso) and not(tertiary)]">
 
258
              <rx:index-item xsl:use-attribute-sets="xep.index.item.properties">
 
259
                <xsl:attribute name="ref-key">
 
260
                  <xsl:value-of select="$primary"/>
 
261
                  <xsl:text>, </xsl:text>
 
262
                  <xsl:value-of select="$secondary"/>
 
263
                </xsl:attribute>
 
264
              </rx:index-item>
 
265
            </xsl:if>
 
266
          </rx:page-index>
 
267
        </xsl:if>
 
268
      </xsl:when>
 
269
      <xsl:otherwise>
 
270
        <xsl:variable name="page-number-citations">
 
271
          <xsl:for-each select="$refs[not(see) and not(seealso)
 
272
                                and not(tertiary)]">
 
273
            <xsl:apply-templates select="." mode="reference">
 
274
              <xsl:with-param name="scope" select="$scope"/>
 
275
            </xsl:apply-templates>
 
276
          </xsl:for-each>
 
277
        </xsl:variable>
 
278
 
 
279
        <xsl:choose>
 
280
          <xsl:when test="$passivetex.extensions != '0'">
 
281
            <fotex:sort xmlns:fotex="http://www.tug.org/fotex">
 
282
              <xsl:copy-of select="$page-number-citations"/>
 
283
            </fotex:sort>
 
284
          </xsl:when>
 
285
          <xsl:otherwise>
 
286
            <xsl:copy-of select="$page-number-citations"/>
 
287
          </xsl:otherwise>
 
288
        </xsl:choose>
 
289
      </xsl:otherwise>
 
290
    </xsl:choose>
 
291
 
 
292
    <xsl:if test="$refs[not(tertiary)]/*[self::see]">
 
293
      <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, see))[&scope;][1])]"
 
294
                           mode="index-see">
 
295
        <xsl:with-param name="scope" select="$scope"/>
 
296
        <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
 
297
      </xsl:apply-templates>
 
298
    </xsl:if>
 
299
 
 
300
  </fo:block>
 
301
 
 
302
  <xsl:if test="$refs/tertiary or $refs[not(tertiary)]/*[self::seealso]">
 
303
    <fo:block start-indent="2pc">
 
304
      <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, seealso))[&scope;][1])]"
 
305
                           mode="index-seealso">
 
306
          <xsl:with-param name="scope" select="$scope"/>
 
307
          <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
 
308
      </xsl:apply-templates>
 
309
      <xsl:apply-templates select="$refs[tertiary and count(.|key('tertiary', concat($key, &sep;, &tertiary;))[&scope;][1]) = 1]" 
 
310
                           mode="index-tertiary">
 
311
          <xsl:with-param name="scope" select="$scope"/>
 
312
          <xsl:sort select="translate(&tertiary;, &lowercase;, &uppercase;)"/>
 
313
      </xsl:apply-templates>
 
314
    </fo:block>
 
315
  </xsl:if>
 
316
</xsl:template>
 
317
 
 
318
<xsl:template match="indexterm" mode="index-tertiary">
 
319
  <xsl:param name="scope" select="."/>
 
320
  <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/>
 
321
  <xsl:variable name="refs" select="key('tertiary', $key)[&scope;]"/>
 
322
  <fo:block>
 
323
    <xsl:if test="$axf.extensions != 0">
 
324
      <xsl:attribute name="axf:suppress-duplicate-page-number">true</xsl:attribute>
 
325
    </xsl:if>
 
326
    <xsl:value-of select="tertiary"/>
 
327
 
 
328
    <xsl:choose>
 
329
      <xsl:when test="$xep.extensions != 0">
 
330
        <xsl:if test="$refs[not(see) and not(seealso)]">
 
331
          <xsl:text>, </xsl:text>
 
332
          <xsl:variable name="primary" select="primary"/>
 
333
          <xsl:variable name="secondary" select="secondary"/>
 
334
          <xsl:variable name="tertiary" select="tertiary"/>
 
335
          <xsl:variable name="primary.significant" select="concat(primary, $significant.flag)"/>
 
336
          <rx:page-index>
 
337
            <xsl:if test="$refs[@significance='preferred'][not(see) and not(seealso)]">
 
338
              <rx:index-item xsl:use-attribute-sets="index.preferred.page.properties xep.index.item.properties">
 
339
                <xsl:attribute name="ref-key">
 
340
                  <xsl:value-of select="$primary.significant"/>
 
341
                  <xsl:text>, </xsl:text>
 
342
                  <xsl:value-of select="$secondary"/>
 
343
                  <xsl:text>, </xsl:text>
 
344
                  <xsl:value-of select="$tertiary"/>
 
345
                </xsl:attribute>
 
346
              </rx:index-item>
 
347
            </xsl:if>
 
348
            <xsl:if test="$refs[not(@significance) or @significance!='preferred'][not(see) and not(seealso)]">
 
349
              <rx:index-item xsl:use-attribute-sets="xep.index.item.properties">
 
350
                <xsl:attribute name="ref-key">
 
351
                  <xsl:value-of select="$primary"/>
 
352
                  <xsl:text>, </xsl:text>
 
353
                  <xsl:value-of select="$secondary"/>
 
354
                  <xsl:text>, </xsl:text>
 
355
                  <xsl:value-of select="$tertiary"/>
 
356
                </xsl:attribute>
 
357
              </rx:index-item>
 
358
            </xsl:if>
 
359
          </rx:page-index>
 
360
        </xsl:if>
 
361
      </xsl:when>
 
362
      <xsl:otherwise>
 
363
        <xsl:variable name="page-number-citations">
 
364
          <xsl:for-each select="$refs[not(see) and not(seealso)]">
 
365
            <xsl:apply-templates select="." mode="reference">
 
366
              <xsl:with-param name="scope" select="$scope"/>
 
367
            </xsl:apply-templates>
 
368
          </xsl:for-each>
 
369
        </xsl:variable>
 
370
 
 
371
        <xsl:choose>
 
372
          <xsl:when test="$passivetex.extensions != '0'">
 
373
            <fotex:sort xmlns:fotex="http://www.tug.org/fotex">
 
374
              <xsl:copy-of select="$page-number-citations"/>
 
375
            </fotex:sort>
 
376
          </xsl:when>
 
377
          <xsl:otherwise>
 
378
            <xsl:copy-of select="$page-number-citations"/>
 
379
          </xsl:otherwise>
 
380
        </xsl:choose>
 
381
      </xsl:otherwise>
 
382
    </xsl:choose>
 
383
 
 
384
    <xsl:if test="$refs/see">
 
385
      <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see))[&scope;][1])]"
 
386
                           mode="index-see">
 
387
        <xsl:with-param name="scope" select="$scope"/>
 
388
        <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
 
389
      </xsl:apply-templates>
 
390
    </xsl:if>
 
391
 
 
392
  </fo:block>
 
393
 
 
394
  <xsl:if test="$refs/seealso">
 
395
    <fo:block>
 
396
      <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, seealso))[&scope;][1])]"
 
397
                           mode="index-seealso">
 
398
        <xsl:with-param name="scope" select="$scope"/>
 
399
        <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
 
400
      </xsl:apply-templates>
 
401
    </fo:block>
 
402
  </xsl:if>
 
403
</xsl:template>
 
404
 
 
405
<xsl:template match="indexterm" mode="reference">
 
406
  <xsl:param name="scope" select="."/>
 
407
  <xsl:param name="separator" select="', '"/>
 
408
 
 
409
  <xsl:if test="$passivetex.extensions = '0'">
 
410
    <xsl:value-of select="$separator"/>
 
411
  </xsl:if>
 
412
 
 
413
  <xsl:choose>
 
414
    <xsl:when test="@zone and string(@zone)">
 
415
      <xsl:call-template name="reference">
 
416
        <xsl:with-param name="zones" select="normalize-space(@zone)"/>
 
417
        <xsl:with-param name="scope" select="$scope"/>
 
418
      </xsl:call-template>
 
419
    </xsl:when>
 
420
    <xsl:otherwise>
 
421
      <xsl:variable name="id">
 
422
        <xsl:call-template name="object.id"/>
 
423
      </xsl:variable>
 
424
 
 
425
      <fo:basic-link internal-destination="{$id}">
 
426
        <fo:page-number-citation ref-id="{$id}"/>
 
427
      </fo:basic-link>
 
428
 
 
429
      <xsl:if test="key('endofrange', @id)[&scope;]">
 
430
        <xsl:apply-templates select="key('endofrange', @id)[&scope;][last()]"
 
431
                             mode="reference">
 
432
          <xsl:with-param name="scope" select="$scope"/>
 
433
          <xsl:with-param name="separator" select="'-'"/>
 
434
        </xsl:apply-templates>
 
435
      </xsl:if>
 
436
    </xsl:otherwise>
 
437
  </xsl:choose>
 
438
</xsl:template>
 
439
 
 
440
<xsl:template name="reference">
 
441
  <xsl:param name="scope" select="."/>
 
442
  <xsl:param name="zones"/>
 
443
 
 
444
  <xsl:choose>
 
445
    <xsl:when test="contains($zones, ' ')">
 
446
      <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
 
447
      <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
 
448
 
 
449
      <xsl:variable name="id">
 
450
        <xsl:call-template name="object.id">
 
451
           <xsl:with-param name="object" select="$target[1]"/>
 
452
        </xsl:call-template>
 
453
      </xsl:variable>
 
454
 
 
455
      <fo:basic-link internal-destination="{$id}">
 
456
        <fo:page-number-citation ref-id="{$id}"/>
 
457
      </fo:basic-link>
 
458
 
 
459
      <xsl:if test="$passivetex.extensions = '0'">
 
460
        <xsl:text>, </xsl:text>
 
461
      </xsl:if>
 
462
      <xsl:call-template name="reference">
 
463
        <xsl:with-param name="zones" select="substring-after($zones, ' ')"/>
 
464
        <xsl:with-param name="scope" select="$scope"/>
 
465
      </xsl:call-template>
 
466
    </xsl:when>
 
467
    <xsl:otherwise>
 
468
      <xsl:variable name="zone" select="$zones"/>
 
469
      <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
 
470
 
 
471
      <xsl:variable name="id">
 
472
        <xsl:call-template name="object.id">
 
473
          <xsl:with-param name="object" select="$target[1]"/>
 
474
        </xsl:call-template>
 
475
      </xsl:variable>
 
476
 
 
477
      <fo:basic-link internal-destination="{$id}">
 
478
        <fo:page-number-citation ref-id="{$id}"/>
 
479
      </fo:basic-link>
 
480
    </xsl:otherwise>
 
481
  </xsl:choose>
 
482
</xsl:template>
 
483
 
 
484
<xsl:template match="indexterm" mode="index-see">
 
485
   <xsl:param name="scope" select="."/>
 
486
 
 
487
   <fo:inline>
 
488
     <xsl:text> (</xsl:text>
 
489
     <xsl:call-template name="gentext">
 
490
       <xsl:with-param name="key" select="'see'"/>
 
491
     </xsl:call-template>
 
492
     <xsl:text> </xsl:text>
 
493
     <xsl:value-of select="see"/>
 
494
     <xsl:text>)</xsl:text>
 
495
   </fo:inline>
 
496
</xsl:template>
 
497
 
 
498
<xsl:template match="indexterm" mode="index-seealso">
 
499
   <xsl:param name="scope" select="."/>
 
500
 
 
501
   <fo:block>
 
502
     <xsl:text>(</xsl:text>
 
503
     <xsl:call-template name="gentext">
 
504
       <xsl:with-param name="key" select="'seealso'"/>
 
505
     </xsl:call-template>
 
506
     <xsl:text> </xsl:text>
 
507
     <xsl:value-of select="seealso"/>
 
508
     <xsl:text>)</xsl:text>
 
509
   </fo:block>
 
510
</xsl:template>
 
511
 
 
512
<!-- ====================================================================== -->
 
513
 
 
514
<xsl:template name="generate-index-markup">
 
515
  <xsl:param name="scope" select="(ancestor::book|/)[last()]"/>
 
516
 
 
517
  <xsl:variable name="terms" select="$scope//indexterm[count(.|key('letter',
 
518
                                     translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;))[&scope;][1]) = 1]"/>
 
519
  <xsl:variable name="alphabetical"
 
520
                select="$terms[contains(concat(&lowercase;, &uppercase;),
 
521
                                        substring(&primary;, 1, 1))]"/>
 
522
  <xsl:variable name="others" select="$terms[not(contains(concat(&lowercase;,
 
523
                                                 &uppercase;),
 
524
                                             substring(&primary;, 1, 1)))]"/>
 
525
 
 
526
  <xsl:text>&lt;index&gt;&#10;</xsl:text>
 
527
  <xsl:if test="$others">
 
528
    <xsl:text>&#10;&lt;indexdiv&gt;&#10;</xsl:text>
 
529
    <xsl:text>&lt;title&gt;</xsl:text>
 
530
    <xsl:call-template name="gentext">
 
531
      <xsl:with-param name="key" select="'index symbols'"/>
 
532
    </xsl:call-template>
 
533
    <xsl:text>&lt;/title&gt;&#10;</xsl:text>
 
534
    <xsl:apply-templates select="$others[count(.|key('primary',
 
535
                                 &primary;)[&scope;][1]) = 1]"
 
536
                         mode="index-symbol-div-markup">
 
537
      <xsl:with-param name="scope" select="$scope"/>
 
538
      <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
 
539
    </xsl:apply-templates>
 
540
    <xsl:text>&lt;/indexdiv&gt;&#10;</xsl:text>
 
541
  </xsl:if>
 
542
 
 
543
  <xsl:apply-templates select="$alphabetical[count(.|key('letter',
 
544
                               translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;))[&scope;][1]) = 1]"
 
545
                       mode="index-div-markup">
 
546
      <xsl:with-param name="scope" select="$scope"/>
 
547
      <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
 
548
  </xsl:apply-templates>
 
549
  <xsl:text>&lt;/index&gt;&#10;</xsl:text>
 
550
</xsl:template>
 
551
 
 
552
<xsl:template match="*" mode="index-markup">
 
553
  <xsl:param name="scope" select="."/>
 
554
 
 
555
  <xsl:text>&lt;</xsl:text>
 
556
  <xsl:value-of select="name(.)"/>
 
557
  <xsl:text>&gt;&#10;</xsl:text>
 
558
  <xsl:apply-templates mode="index-markup">
 
559
    <xsl:with-param name="scope" select="$scope"/>
 
560
  </xsl:apply-templates>
 
561
</xsl:template>
 
562
 
 
563
<xsl:template match="indexterm" mode="index-div-markup">
 
564
  <xsl:param name="scope" select="."/>
 
565
  <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
 
566
  <xsl:text>&#10;&lt;indexdiv&gt;&#10;</xsl:text>
 
567
  <xsl:text>&lt;title&gt;</xsl:text>
 
568
  <xsl:value-of select="translate($key, &lowercase;, &uppercase;)"/>
 
569
  <xsl:text>&lt;/title&gt;&#10;</xsl:text>
 
570
 
 
571
  <xsl:apply-templates select="key('letter', $key)[&scope;][count(.|key('primary', &primary;)[&scope;][1]) = 1]"
 
572
                       mode="index-primary-markup">
 
573
    <xsl:with-param name="scope" select="$scope"/>
 
574
    <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
 
575
  </xsl:apply-templates>
 
576
  <xsl:text>&lt;/indexdiv&gt;&#10;</xsl:text>
 
577
</xsl:template>
 
578
 
 
579
<xsl:template match="indexterm" mode="index-symbol-div-markup">
 
580
  <xsl:param name="scope" select="."/>
 
581
  <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
 
582
 
 
583
  <xsl:apply-templates select="key('letter', $key)[&scope;][count(.|key('primary', &primary;)[&scope;][1]) = 1]"
 
584
                       mode="index-primary-markup">
 
585
    <xsl:with-param name="scope" select="$scope"/>
 
586
    <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
 
587
  </xsl:apply-templates>
 
588
</xsl:template>
 
589
 
 
590
<xsl:template match="indexterm" mode="index-primary-markup">
 
591
  <xsl:param name="scope" select="."/>
 
592
  <xsl:variable name="key" select="&primary;"/>
 
593
  <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
 
594
  <xsl:variable name="pages" select="$refs[not(see) and not(seealso)]"/>
 
595
 
 
596
  <xsl:text>&#10;&lt;indexentry&gt;&#10;</xsl:text>
 
597
  <xsl:text>&lt;primaryie&gt;</xsl:text>
 
598
  <xsl:text>&lt;phrase&gt;</xsl:text>
 
599
  <xsl:call-template name="escape-text">
 
600
    <xsl:with-param name="text" select="string(primary)"/>
 
601
  </xsl:call-template>
 
602
  <xsl:text>&lt;/phrase&gt;</xsl:text>
 
603
  <xsl:if test="$pages">,</xsl:if>
 
604
  <xsl:text>&#10;</xsl:text>
 
605
 
 
606
  <xsl:for-each select="$pages">
 
607
    <xsl:apply-templates select="." mode="reference-markup">
 
608
      <xsl:with-param name="scope" select="$scope"/>
 
609
    </xsl:apply-templates>
 
610
  </xsl:for-each>
 
611
 
 
612
  <xsl:text>&lt;/primaryie&gt;&#10;</xsl:text>
 
613
 
 
614
  <xsl:if test="$refs/secondary or $refs[not(secondary)]/*[self::see or self::seealso]">
 
615
    <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &sep;, &sep;, see))[&scope;][1])]"
 
616
                         mode="index-see-markup">
 
617
      <xsl:with-param name="scope" select="$scope"/>
 
618
      <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
 
619
    </xsl:apply-templates>
 
620
 
 
621
    <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &sep;, &sep;, seealso))[&scope;][1])]"
 
622
                         mode="index-seealso-markup">
 
623
      <xsl:with-param name="scope" select="$scope"/>
 
624
      <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
 
625
    </xsl:apply-templates>
 
626
 
 
627
    <xsl:apply-templates select="$refs[secondary and count(.|key('secondary', concat($key, &sep;, &secondary;))[&scope;][1]) = 1]" 
 
628
                         mode="index-secondary-markup">
 
629
      <xsl:with-param name="scope" select="$scope"/>
 
630
      <xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/>
 
631
    </xsl:apply-templates>
 
632
  </xsl:if>
 
633
  <xsl:text>&lt;/indexentry&gt;&#10;</xsl:text>
 
634
</xsl:template>
 
635
 
 
636
<xsl:template match="indexterm" mode="index-secondary-markup">
 
637
  <xsl:param name="scope" select="."/>
 
638
  <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/>
 
639
  <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
 
640
  <xsl:variable name="pages" select="$refs[not(see) and not(seealso)]"/>
 
641
 
 
642
  <xsl:text>&lt;secondaryie&gt;</xsl:text>
 
643
  <xsl:text>&lt;phrase&gt;</xsl:text>
 
644
  <xsl:call-template name="escape-text">
 
645
    <xsl:with-param name="text" select="string(secondary)"/>
 
646
  </xsl:call-template>
 
647
  <xsl:text>&lt;/phrase&gt;</xsl:text>
 
648
  <xsl:if test="$pages">,</xsl:if>
 
649
  <xsl:text>&#10;</xsl:text>
 
650
 
 
651
  <xsl:for-each select="$pages">
 
652
    <xsl:apply-templates select="." mode="reference-markup">
 
653
      <xsl:with-param name="scope" select="$scope"/>
 
654
    </xsl:apply-templates>
 
655
  </xsl:for-each>
 
656
 
 
657
  <xsl:text>&lt;/secondaryie&gt;&#10;</xsl:text>
 
658
 
 
659
  <xsl:if test="$refs/tertiary or $refs[not(tertiary)]/*[self::see or self::seealso]">
 
660
    <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, see))[&scope;][1])]"
 
661
                         mode="index-see-markup">
 
662
      <xsl:with-param name="scope" select="$scope"/>
 
663
      <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
 
664
    </xsl:apply-templates>
 
665
    <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, seealso))[&scope;][1])]"
 
666
                         mode="index-seealso-markup">
 
667
      <xsl:with-param name="scope" select="$scope"/>
 
668
      <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
 
669
    </xsl:apply-templates>
 
670
    <xsl:apply-templates select="$refs[tertiary and count(.|key('tertiary', concat($key, &sep;, &tertiary;))[&scope;][1]) = 1]" 
 
671
                         mode="index-tertiary-markup">
 
672
      <xsl:with-param name="scope" select="$scope"/>
 
673
      <xsl:sort select="translate(&tertiary;, &lowercase;, &uppercase;)"/>
 
674
    </xsl:apply-templates>
 
675
  </xsl:if>
 
676
</xsl:template>
 
677
 
 
678
<xsl:template match="indexterm" mode="index-tertiary-markup">
 
679
  <xsl:param name="scope" select="."/>
 
680
  <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/>
 
681
  <xsl:variable name="refs" select="key('tertiary', $key)[&scope;]"/>
 
682
  <xsl:variable name="pages" select="$refs[not(see) and not(seealso)]"/>
 
683
 
 
684
  <xsl:text>&lt;tertiaryie&gt;</xsl:text>
 
685
  <xsl:text>&lt;phrase&gt;</xsl:text>
 
686
  <xsl:call-template name="escape-text">
 
687
    <xsl:with-param name="text" select="string(tertiary)"/>
 
688
  </xsl:call-template>
 
689
  <xsl:text>&lt;/phrase&gt;</xsl:text>
 
690
  <xsl:if test="$pages">,</xsl:if>
 
691
  <xsl:text>&#10;</xsl:text>
 
692
 
 
693
  <xsl:for-each select="$pages">
 
694
    <xsl:apply-templates select="." mode="reference-markup">
 
695
      <xsl:with-param name="scope" select="$scope"/>
 
696
    </xsl:apply-templates>
 
697
  </xsl:for-each>
 
698
 
 
699
  <xsl:text>&lt;/tertiaryie&gt;&#10;</xsl:text>
 
700
 
 
701
  <xsl:variable name="see" select="$refs/see | $refs/seealso"/>
 
702
  <xsl:if test="$see">
 
703
    <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see))[&scope;][1])]"
 
704
                         mode="index-see-markup">
 
705
      <xsl:with-param name="scope" select="$scope"/>
 
706
      <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
 
707
    </xsl:apply-templates>
 
708
    <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, seealso))[&scope;][1])]"
 
709
                         mode="index-seealso-markup">
 
710
      <xsl:with-param name="scope" select="$scope"/>
 
711
      <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
 
712
    </xsl:apply-templates>
 
713
  </xsl:if>
 
714
</xsl:template>
 
715
 
 
716
<xsl:template match="indexterm" mode="reference-markup">
 
717
  <xsl:param name="scope" select="."/>
 
718
  <xsl:choose>
 
719
    <xsl:when test="@zone and string(@zone)">
 
720
      <xsl:call-template name="reference-markup">
 
721
        <xsl:with-param name="zones" select="normalize-space(@zone)"/>
 
722
        <xsl:with-param name="scope" select="$scope"/>
 
723
      </xsl:call-template>
 
724
    </xsl:when>
 
725
    <xsl:otherwise>
 
726
      <xsl:variable name="id">
 
727
        <xsl:call-template name="object.id"/>
 
728
      </xsl:variable>
 
729
 
 
730
 
 
731
      <xsl:choose>
 
732
        <xsl:when test="@startref and @class='endofrange'">
 
733
          <xsl:text>&lt;phrase role="pageno"&gt;</xsl:text>
 
734
          <xsl:text>&lt;link linkend="</xsl:text>
 
735
          <xsl:value-of select="@startref"/>
 
736
          <xsl:text>"&gt;</xsl:text>
 
737
          <fo:basic-link internal-destination="{@startref}">
 
738
            <fo:page-number-citation ref-id="{@startref}"/>
 
739
            <xsl:text>-</xsl:text>
 
740
            <fo:page-number-citation ref-id="{$id}"/>
 
741
          </fo:basic-link>
 
742
          <xsl:text>&lt;/link&gt;</xsl:text>
 
743
          <xsl:text>&lt;/phrase&gt;&#10;</xsl:text>
 
744
        </xsl:when>
 
745
        <xsl:otherwise>
 
746
          <xsl:text>&lt;phrase role="pageno"&gt;</xsl:text>
 
747
          <xsl:if test="@id">
 
748
            <xsl:text>&lt;link linkend="</xsl:text>
 
749
            <xsl:value-of select="$id"/>
 
750
            <xsl:text>"&gt;</xsl:text>
 
751
          </xsl:if>
 
752
          <fo:basic-link internal-destination="{$id}">
 
753
            <fo:page-number-citation ref-id="{$id}"/>
 
754
          </fo:basic-link>
 
755
          <xsl:if test="@id">
 
756
            <xsl:text>&lt;/link&gt;</xsl:text>
 
757
          </xsl:if>
 
758
          <xsl:text>&lt;/phrase&gt;&#10;</xsl:text>
 
759
        </xsl:otherwise>
 
760
      </xsl:choose>
 
761
    </xsl:otherwise>
 
762
  </xsl:choose>
 
763
</xsl:template>
 
764
 
 
765
<xsl:template name="reference-markup">
 
766
  <xsl:param name="scope" select="."/>
 
767
  <xsl:param name="zones"/>
 
768
  <xsl:choose>
 
769
    <xsl:when test="contains($zones, ' ')">
 
770
      <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
 
771
      <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
 
772
 
 
773
      <xsl:variable name="id">
 
774
        <xsl:call-template name="object.id">
 
775
          <xsl:with-param name="object" select="$target[1]"/>
 
776
        </xsl:call-template>
 
777
      </xsl:variable>
 
778
 
 
779
      <xsl:text>&lt;phrase fole="pageno"&gt;</xsl:text>
 
780
      <xsl:if test="$target[1]/@id">
 
781
        <xsl:text>&lt;link linkend="</xsl:text>
 
782
        <xsl:value-of select="$id"/>
 
783
        <xsl:text>"&gt;</xsl:text>
 
784
      </xsl:if>
 
785
      <fo:basic-link internal-destination="{$id}">
 
786
        <fo:page-number-citation ref-id="{$id}"/>
 
787
      </fo:basic-link>
 
788
      <xsl:if test="$target[1]/@id">
 
789
        <xsl:text>&lt;/link&gt;</xsl:text>
 
790
      </xsl:if>
 
791
      <xsl:text>&lt;/phrase&gt;&#10;</xsl:text>
 
792
 
 
793
      <xsl:call-template name="reference">
 
794
        <xsl:with-param name="zones" select="substring-after($zones, ' ')"/>
 
795
        <xsl:with-param name="scope" select="$scope"/>
 
796
      </xsl:call-template>
 
797
    </xsl:when>
 
798
    <xsl:otherwise>
 
799
      <xsl:variable name="zone" select="$zones"/>
 
800
      <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
 
801
 
 
802
      <xsl:variable name="id">
 
803
        <xsl:call-template name="object.id">
 
804
          <xsl:with-param name="object" select="$target[1]"/>
 
805
        </xsl:call-template>
 
806
      </xsl:variable>
 
807
 
 
808
      <xsl:text>&lt;phrase role="pageno"&gt;</xsl:text>
 
809
      <xsl:if test="$target[1]/@id">
 
810
        <xsl:text>&lt;link linkend="</xsl:text>
 
811
        <xsl:value-of select="$id"/>
 
812
        <xsl:text>"&gt;</xsl:text>
 
813
      </xsl:if>
 
814
      <fo:basic-link internal-destination="{$id}">
 
815
        <fo:page-number-citation ref-id="{$id}"/>
 
816
      </fo:basic-link>
 
817
      <xsl:if test="$target[1]/@id">
 
818
        <xsl:text>&lt;/link&gt;</xsl:text>
 
819
      </xsl:if>
 
820
      <xsl:text>&lt;/phrase&gt;&#10;</xsl:text>
 
821
    </xsl:otherwise>
 
822
  </xsl:choose>
 
823
</xsl:template>
 
824
 
 
825
<xsl:template match="indexterm" mode="index-see-markup">
 
826
  <xsl:param name="scope" select="."/>
 
827
  <fo:block>
 
828
    <xsl:text>&lt;seeie&gt;</xsl:text>
 
829
    <xsl:text>&lt;phrase&gt;</xsl:text>
 
830
    <xsl:call-template name="escape-text">
 
831
      <xsl:with-param name="text" select="string(see)"/>
 
832
    </xsl:call-template>
 
833
    <xsl:text>&lt;/phrase&gt;</xsl:text>
 
834
    <xsl:text>&lt;/seeie&gt;&#10;</xsl:text>
 
835
  </fo:block>
 
836
</xsl:template>
 
837
 
 
838
<xsl:template match="indexterm" mode="index-seealso-markup">
 
839
  <xsl:param name="scope" select="."/>
 
840
  <fo:block>
 
841
    <xsl:text>&lt;seealsoie&gt;</xsl:text>
 
842
    <xsl:text>&lt;phrase&gt;</xsl:text>
 
843
    <xsl:call-template name="escape-text">
 
844
      <xsl:with-param name="text" select="string(seealso)"/>
 
845
    </xsl:call-template>
 
846
    <xsl:text>&lt;/phrase&gt;</xsl:text>
 
847
    <xsl:text>&lt;/seealsoie&gt;&#10;</xsl:text>
 
848
  </fo:block>
 
849
</xsl:template>
 
850
 
 
851
<xsl:template name="escape-text">
 
852
  <xsl:param name="text" select="''"/>
 
853
 
 
854
  <xsl:variable name="ltpos" select="substring-before($text, '&lt;')"/>
 
855
  <xsl:variable name="amppos" select="substring-before($text, '&amp;')"/>
 
856
 
 
857
  <xsl:choose>
 
858
    <xsl:when test="contains($text,'&lt;') and contains($text, '&amp;')
 
859
                    and string-length($ltpos) &lt; string-length($amppos)">
 
860
      <xsl:value-of select="$ltpos"/>
 
861
      <xsl:text>&amp;lt;</xsl:text>
 
862
      <xsl:call-template name="escape-text">
 
863
        <xsl:with-param name="text" select="substring-after($text, '&lt;')"/>
 
864
      </xsl:call-template>
 
865
    </xsl:when>
 
866
 
 
867
    <xsl:when test="contains($text,'&lt;') and contains($text, '&amp;')
 
868
                    and string-length($amppos) &lt; string-length($ltpos)">
 
869
      <xsl:value-of select="$amppos"/>
 
870
      <xsl:text>&amp;amp;</xsl:text>
 
871
      <xsl:call-template name="escape-text">
 
872
        <xsl:with-param name="text" select="substring-after($text, '&amp;')"/>
 
873
      </xsl:call-template>
 
874
    </xsl:when>
 
875
 
 
876
    <xsl:when test="contains($text, '&lt;')">
 
877
      <xsl:value-of select="$ltpos"/>
 
878
      <xsl:text>&amp;lt;</xsl:text>
 
879
      <xsl:call-template name="escape-text">
 
880
        <xsl:with-param name="text" select="substring-after($text, '&lt;')"/>
 
881
      </xsl:call-template>
 
882
    </xsl:when>
 
883
 
 
884
    <xsl:when test="contains($text, '&amp;')">
 
885
      <xsl:value-of select="$amppos"/>
 
886
      <xsl:text>&amp;amp;</xsl:text>
 
887
      <xsl:call-template name="escape-text">
 
888
        <xsl:with-param name="text" select="substring-after($text, '&amp;')"/>
 
889
      </xsl:call-template>
 
890
    </xsl:when>
 
891
 
 
892
    <xsl:otherwise>
 
893
      <xsl:value-of select="$text"/>
 
894
    </xsl:otherwise>
 
895
  </xsl:choose>
 
896
</xsl:template>
 
897
 
 
898
</xsl:stylesheet>